mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-20 08:38:56 +01:00
Some clean up
This commit is contained in:
@@ -229,7 +229,7 @@ suite('window namespace tests', () => {
|
||||
const terminal = window.createTerminal({ name: 'foo', pty });
|
||||
});
|
||||
|
||||
test('should fire provide dimensions on start as the terminal has been shown', (done) => {
|
||||
test('should not provide dimensions on start as the terminal has not been shown yet', (done) => {
|
||||
const reg1 = window.onDidOpenTerminal(term => {
|
||||
equal(terminal, term);
|
||||
reg1.dispose();
|
||||
@@ -237,6 +237,32 @@ suite('window namespace tests', () => {
|
||||
const pty: Pseudoterminal = {
|
||||
onDidWrite: new EventEmitter<string>().event,
|
||||
open: (dimensions) => {
|
||||
equal(dimensions, undefined);
|
||||
const reg3 = window.onDidCloseTerminal(() => {
|
||||
reg3.dispose();
|
||||
done();
|
||||
});
|
||||
// Show a terminal and wait a brief period before dispose, this will cause
|
||||
// the panel to init it's dimenisons and be provided to following terminals.
|
||||
// The following test depends on this.
|
||||
terminal.show();
|
||||
setTimeout(() => terminal.dispose(), 200);
|
||||
},
|
||||
close: () => {}
|
||||
};
|
||||
const terminal = window.createTerminal({ name: 'foo', pty });
|
||||
});
|
||||
|
||||
test('should provide dimensions on start as the terminal has been shown', (done) => {
|
||||
const reg1 = window.onDidOpenTerminal(term => {
|
||||
equal(terminal, term);
|
||||
reg1.dispose();
|
||||
});
|
||||
const pty: Pseudoterminal = {
|
||||
onDidWrite: new EventEmitter<string>().event,
|
||||
open: (dimensions) => {
|
||||
// This test depends on Terminal.show being called some time before such
|
||||
// that the panel dimensions are initialized and cached.
|
||||
ok(dimensions!.columns > 0);
|
||||
ok(dimensions!.rows > 0);
|
||||
const reg3 = window.onDidCloseTerminal(() => {
|
||||
|
||||
Reference in New Issue
Block a user