Merge VS Code 1.23.1 (#1520)

This commit is contained in:
Matt Irvine
2018-06-05 11:24:51 -07:00
committed by GitHub
parent e3baf5c443
commit 0c58f09e59
3651 changed files with 74249 additions and 48599 deletions

View File

@@ -3,130 +3,109 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as assert from 'assert';
import { SpectronApplication, Quality } from '../../spectron/application';
import { Application, Quality } from '../../application';
import * as rimraf from 'rimraf';
export interface ICreateAppFn {
(quality: Quality): SpectronApplication | null;
(quality: Quality): Application;
}
export function setup(userDataDir: string, createApp: ICreateAppFn) {
describe('Data Migration', () => {
afterEach(async function () {
await new Promise((c, e) => rimraf(userDataDir, { maxBusyTries: 10 }, err => err ? e(err) : c()));
});
it('checks if the Untitled file is restored migrating from stable to latest', async function () {
const stableApp = createApp(Quality.Stable);
// it('checks if the Untitled file is restored migrating from stable to latest', async function () {
// const stableApp = createApp(Quality.Stable);
if (!stableApp) {
this.skip();
return;
}
// if (!stableApp) {
// this.skip();
// return;
// }
await stableApp.start();
stableApp.suiteName = 'Data Migration';
// await stableApp.start();
const textToType = 'Very dirty file';
// const textToType = 'Very dirty file';
await stableApp.workbench.newUntitledFile();
await stableApp.workbench.editor.waitForTypeInEditor('Untitled-1', textToType);
// await stableApp.workbench.editors.newUntitledFile();
// await stableApp.workbench.editor.waitForTypeInEditor('Untitled-1', textToType);
await stableApp.stop();
await new Promise(c => setTimeout(c, 500)); // wait until all resources are released (e.g. locked local storage)
// await stableApp.stop();
// await new Promise(c => setTimeout(c, 500)); // wait until all resources are released (e.g. locked local storage)
// Checking latest version for the restored state
const app = createApp(Quality.Insiders);
// // Checking latest version for the restored state
// const app = createApp(Quality.Insiders);
if (!app) {
return assert(false);
}
// await app.start(false);
await app.start(false);
app.suiteName = 'Data Migration';
// await app.workbench.editors.waitForActiveTab('Untitled-1', true);
// await app.workbench.editor.waitForEditorContents('Untitled-1', c => c.indexOf(textToType) > -1);
assert.ok(await app.workbench.waitForActiveTab('Untitled-1', true), `Untitled-1 tab is not present after migration.`);
// await app.stop();
// });
await app.workbench.editor.waitForEditorContents('Untitled-1', c => c.indexOf(textToType) > -1);
await app.screenCapturer.capture('Untitled file text');
// it('checks if the newly created dirty file is restored migrating from stable to latest', async function () {
// const stableApp = createApp(Quality.Stable);
await app.stop();
});
// if (!stableApp) {
// this.skip();
// return;
// }
it('checks if the newly created dirty file is restored migrating from stable to latest', async function () {
const stableApp = createApp(Quality.Stable);
// await stableApp.start();
if (!stableApp) {
this.skip();
return;
}
// const fileName = 'app.js';
// const textPart = 'This is going to be an unsaved file';
await stableApp.start();
stableApp.suiteName = 'Data Migration';
// await stableApp.workbench.quickopen.openFile(fileName);
const fileName = 'app.js';
const textPart = 'This is going to be an unsaved file';
// await stableApp.workbench.editor.waitForTypeInEditor(fileName, textPart);
await stableApp.workbench.quickopen.openFile(fileName);
// await stableApp.stop();
// await new Promise(c => setTimeout(c, 500)); // wait until all resources are released (e.g. locked local storage)
await stableApp.workbench.editor.waitForTypeInEditor(fileName, textPart);
// // Checking latest version for the restored state
// const app = createApp(Quality.Insiders);
await stableApp.stop();
await new Promise(c => setTimeout(c, 500)); // wait until all resources are released (e.g. locked local storage)
// await app.start(false);
// Checking latest version for the restored state
const app = createApp(Quality.Insiders);
// await app.workbench.editors.waitForActiveTab(fileName);
// await app.workbench.editor.waitForEditorContents(fileName, c => c.indexOf(textPart) > -1);
if (!app) {
return assert(false);
}
// await app.stop();
// });
await app.start(false);
app.suiteName = 'Data Migration';
// it('checks if opened tabs are restored migrating from stable to latest', async function () {
// const stableApp = createApp(Quality.Stable);
assert.ok(await app.workbench.waitForActiveTab(fileName), `dirty file tab is not present after migration.`);
await app.workbench.editor.waitForEditorContents(fileName, c => c.indexOf(textPart) > -1);
// if (!stableApp) {
// this.skip();
// return;
// }
await app.stop();
});
// await stableApp.start();
it('checks if opened tabs are restored migrating from stable to latest', async function () {
const stableApp = createApp(Quality.Stable);
// const fileName1 = 'app.js', fileName2 = 'jsconfig.json', fileName3 = 'readme.md';
if (!stableApp) {
this.skip();
return;
}
// await stableApp.workbench.quickopen.openFile(fileName1);
// await stableApp.workbench.runCommand('View: Keep Editor');
// await stableApp.workbench.quickopen.openFile(fileName2);
// await stableApp.workbench.runCommand('View: Keep Editor');
// await stableApp.workbench.quickopen.openFile(fileName3);
// await stableApp.stop();
await stableApp.start();
stableApp.suiteName = 'Data Migration';
// const app = createApp(Quality.Insiders);
const fileName1 = 'app.js', fileName2 = 'jsconfig.json', fileName3 = 'readme.md';
// await app.start(false);
await stableApp.workbench.quickopen.openFile(fileName1);
await stableApp.workbench.quickopen.runCommand('View: Keep Editor');
await stableApp.workbench.quickopen.openFile(fileName2);
await stableApp.workbench.quickopen.runCommand('View: Keep Editor');
await stableApp.workbench.quickopen.openFile(fileName3);
await stableApp.stop();
// await app.workbench.editors.waitForTab(fileName1);
// await app.workbench.editors.waitForTab(fileName2);
// await app.workbench.editors.waitForTab(fileName3);
const app = createApp(Quality.Insiders);
if (!app) {
return assert(false);
}
await app.start(false);
app.suiteName = 'Data Migration';
assert.ok(await app.workbench.waitForTab(fileName1), `${fileName1} tab was not restored after migration.`);
assert.ok(await app.workbench.waitForTab(fileName2), `${fileName2} tab was not restored after migration.`);
assert.ok(await app.workbench.waitForTab(fileName3), `${fileName3} tab was not restored after migration.`);
await app.stop();
});
// await app.stop();
// });
});
}