mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 13:46:13 +00:00
Type terminal smoke tests
This commit is contained in:
parent
94fec827fe
commit
f607ee4481
5
src/typings/vscode-xterm.d.ts
vendored
5
src/typings/vscode-xterm.d.ts
vendored
|
@ -676,8 +676,13 @@ declare module 'vscode-xterm' {
|
|||
ybase: number;
|
||||
ydisp: number;
|
||||
x: number;
|
||||
lines: any[];
|
||||
|
||||
translateBufferLineToString(lineIndex: number, trimRight: boolean): string;
|
||||
};
|
||||
|
||||
send(text: string): void;
|
||||
|
||||
/**
|
||||
* Emit an event on the terminal.
|
||||
*/
|
||||
|
|
|
@ -13,6 +13,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
|
|||
import { getTopLeftOffset, getClientArea } from 'vs/base/browser/dom';
|
||||
import * as electron from 'electron';
|
||||
import { IWindowService } from 'vs/platform/windows/common/windows';
|
||||
import { Terminal } from 'vscode-xterm';
|
||||
|
||||
function serializeElement(element: Element, recursive: boolean): IElement {
|
||||
const attributes = Object.create(null);
|
||||
|
@ -172,7 +173,7 @@ class WindowDriver implements IWindowDriver {
|
|||
throw new Error('Terminal not found: ' + selector);
|
||||
}
|
||||
|
||||
const xterm = (element as any).xterm;
|
||||
const xterm: Terminal = (element as any).xterm;
|
||||
|
||||
if (!xterm) {
|
||||
throw new Error('Xterm not found: ' + selector);
|
||||
|
@ -180,8 +181,8 @@ class WindowDriver implements IWindowDriver {
|
|||
|
||||
const lines: string[] = [];
|
||||
|
||||
for (let i = 0; i < xterm.buffer.lines.length; i++) {
|
||||
lines.push(xterm.buffer.translateBufferLineToString(i, true));
|
||||
for (let i = 0; i < xterm._core.buffer.lines.length; i++) {
|
||||
lines.push(xterm._core.buffer.translateBufferLineToString(i, true));
|
||||
}
|
||||
|
||||
return lines;
|
||||
|
@ -194,13 +195,13 @@ class WindowDriver implements IWindowDriver {
|
|||
throw new Error('Element not found');
|
||||
}
|
||||
|
||||
const xterm = (element as any).xterm;
|
||||
const xterm: Terminal = (element as any).xterm;
|
||||
|
||||
if (!xterm) {
|
||||
throw new Error('Xterm not found');
|
||||
}
|
||||
|
||||
xterm.send(text);
|
||||
xterm._core.send(text);
|
||||
}
|
||||
|
||||
async openDevTools(): TPromise<void> {
|
||||
|
|
Loading…
Reference in a new issue