mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 18:49:00 +01:00
Clean up some editor input debt and lifecycle issues (#24439)
This commit is contained in:
@@ -128,12 +128,18 @@ suite('editor tests', () => {
|
||||
});
|
||||
|
||||
return Promise.all([
|
||||
commands.executeCommand('workbench.action.closeAllEditors'),
|
||||
delay(800).then(() => commands.executeCommand('workbench.action.closeAllEditors')), // TODO@Ben TODO@Joh this delay is a hack
|
||||
p
|
||||
]).then(() => undefined);
|
||||
});
|
||||
});
|
||||
|
||||
function delay(time) {
|
||||
return new Promise(function (fulfill) {
|
||||
setTimeout(fulfill, time);
|
||||
});
|
||||
}
|
||||
|
||||
test('issue #20867: vscode.window.visibleTextEditors returns closed document 2/2', () => {
|
||||
|
||||
const file10Path = join(workspace.rootPath || '', './10linefile.ts');
|
||||
@@ -165,8 +171,11 @@ suite('editor tests', () => {
|
||||
|
||||
// hide doesn't what it means because it triggers a close event and because it
|
||||
// detached the editor. For this test that's what we want.
|
||||
editors[0].hide();
|
||||
return p;
|
||||
delay(800).then(() => { // TODO@Ben TODO@Joh this delay is a hack
|
||||
editors[0].hide();
|
||||
|
||||
return p;
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ suite('workspace-namespace', () => {
|
||||
|
||||
test('openTextDocument', () => {
|
||||
let len = workspace.textDocuments.length;
|
||||
return workspace.openTextDocument(join(workspace.rootPath || '', './far.js')).then(doc => {
|
||||
return workspace.openTextDocument(join(workspace.rootPath || '', './simple.txt')).then(doc => {
|
||||
assert.ok(doc);
|
||||
assert.equal(workspace.textDocuments.length, len + 1);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user