提交 d6645f3f 编写于 作者: J Joao Moreno

Revert "smoke: let's catch the sucker"

This reverts commit d4758821.
上级 776419c4
......@@ -11,7 +11,7 @@ import * as strings from 'vs/base/common/strings';
import Event, { Emitter } from 'vs/base/common/event';
import { KeyCode } from 'vs/base/common/keyCodes';
import { Disposable } from 'vs/base/common/lifecycle';
import { ITypeData, TextAreaState, ITextAreaWrapper, log } from 'vs/editor/browser/controller/textAreaState';
import { ITypeData, TextAreaState, ITextAreaWrapper } from 'vs/editor/browser/controller/textAreaState';
import * as browser from 'vs/base/browser/browser';
import * as platform from 'vs/base/common/platform';
import * as dom from 'vs/base/browser/dom';
......@@ -220,7 +220,6 @@ export class TextAreaInput extends Disposable {
}));
this._register(dom.addDisposableListener(textArea.domNode, 'input', () => {
log.push(`${Date.now()}: input, last known state: ${this._textAreaState}, current state: ${this._textAreaState.readFromTextArea(this._textArea)}`);
// Pretend here we touched the text area, as the `input` event will most likely
// result in a `selectionchange` event which we want to ignore
this._textArea.setIgnoreSelectionChangeTime('received input event');
......
......@@ -9,9 +9,6 @@ import { Position } from 'vs/editor/common/core/position';
import { EndOfLinePreference } from 'vs/editor/common/editorCommon';
import * as strings from 'vs/base/common/strings';
export let log: string[] = [];
(<any>this).myLog = log;
export interface ITextAreaWrapper {
getValue(): string;
setValue(reason: string, value: string): void;
......@@ -76,7 +73,6 @@ export class TextAreaState {
}
public writeToTextArea(reason: string, textArea: ITextAreaWrapper, select: boolean): void {
log.push(`${Date.now()}: writeToTextArea - ${reason} - ${this}`);
// console.log(Date.now() + ': applyToTextArea ' + reason + ': ' + this.toString());
textArea.setValue(reason, this.value);
if (select) {
......
......@@ -14,7 +14,6 @@ import { IViewModel } from 'vs/editor/common/viewModel/viewModel';
import { ViewOutgoingEvents } from 'vs/editor/browser/view/viewOutgoingEvents';
import { CoreNavigationCommands, CoreEditorCommand } from 'vs/editor/common/controller/coreCommands';
import { Configuration } from 'vs/editor/browser/config/configuration';
import { log } from 'vs/editor/browser/controller/textAreaState';
export interface ExecCoreEditorCommandFunc {
(editorCommand: CoreEditorCommand, args: any): void;
......@@ -64,7 +63,6 @@ export class ViewController {
}
public paste(source: string, text: string, pasteOnNewLine: boolean): void {
log.push(`${Date.now()}: viewController.paste: ${text}, ${pasteOnNewLine}`);
this.commandService.executeCommand(editorCommon.Handler.Paste, {
text: text,
pasteOnNewLine: pasteOnNewLine,
......@@ -72,14 +70,12 @@ export class ViewController {
}
public type(source: string, text: string): void {
log.push(`${Date.now()}: viewController.type: ${text}`);
this.commandService.executeCommand(editorCommon.Handler.Type, {
text: text
});
}
public replacePreviousChar(source: string, text: string, replaceCharCnt: number): void {
log.push(`${Date.now()}: viewController.replacePreviousChar: ${text}, ${replaceCharCnt}`);
this.commandService.executeCommand(editorCommon.Handler.ReplacePreviousChar, {
text: text,
replaceCharCnt: replaceCharCnt
......@@ -87,22 +83,18 @@ export class ViewController {
}
public compositionStart(source: string): void {
log.push(`${Date.now()}: viewController.compositionStart`);
this.commandService.executeCommand(editorCommon.Handler.CompositionStart, {});
}
public compositionEnd(source: string): void {
log.push(`${Date.now()}: viewController.compositionEnd`);
this.commandService.executeCommand(editorCommon.Handler.CompositionEnd, {});
}
public cut(source: string): void {
log.push(`${Date.now()}: viewController.cut`);
this.commandService.executeCommand(editorCommon.Handler.Cut, {});
}
public setSelection(source: string, modelSelection: Selection): void {
log.push(`${Date.now()}: viewController.setSelection: ${modelSelection}`);
this._execCoreEditorCommandFunc(CoreNavigationCommands.SetSelection, {
source: source,
selection: modelSelection
......
......@@ -8,41 +8,32 @@ import { SpectronApplication } from '../../spectron/application';
describe('Dataloss', () => {
let app: SpectronApplication;
before(() => { app = new SpectronApplication(); return app.start('Dataloss'); });
after(async () => {
const log = await app.client.spectron.client.execute(() => {
return (window as any).myLog as string[];
});
console.log(log.value.join('\n'));
await app.stop();
});
after(() => app.stop());
it(`verifies that 'hot exit' works for dirty files`, async function () {
await app.workbench.newUntitledFile();
const untitled = 'Untitled-1';
const textToTypeInUntitled = 'Hello, Unitled Code alexandru dimaaaaa joao moreno';
const textToTypeInUntitled = 'Hello, Unitled Code';
await app.workbench.editor.waitForTypeInEditor(untitled, textToTypeInUntitled);
await app.screenCapturer.capture('Untitled file before reload');
await app.workbench.editor.waitForEditorContents(untitled, c => c.indexOf(textToTypeInUntitled) > -1);
const readmeMd = 'readme.md';
const textToType = 'Hello, Code alexandru dimaaaaa joao moreno';
const textToType = 'Hello, Code';
await app.workbench.explorer.openFile(readmeMd);
await app.workbench.editor.waitForTypeInEditor(readmeMd, textToType);
await app.screenCapturer.capture(`${readmeMd} before reload`);
await app.workbench.editor.waitForEditorContents(readmeMd, c => c.indexOf(textToType) > -1);
// await app.reload();
// await app.screenCapturer.capture('After reload');
await app.reload();
await app.screenCapturer.capture('After reload');
// await app.workbench.waitForActiveTab(readmeMd, true);
// await app.screenCapturer.capture(`${readmeMd} after reload`);
await app.workbench.waitForActiveTab(readmeMd, true);
await app.screenCapturer.capture(`${readmeMd} after reload`);
await app.workbench.editor.waitForEditorContents(readmeMd, c => c.indexOf(textToType) > -1);
// await app.workbench.waitForTab(untitled, true);
// await app.workbench.selectTab(untitled, true);
// await app.screenCapturer.capture('Untitled file after reload');
await app.workbench.waitForTab(untitled, true);
await app.workbench.selectTab(untitled, true);
await app.screenCapturer.capture('Untitled file after reload');
await app.workbench.editor.waitForEditorContents(untitled, c => c.indexOf(textToTypeInUntitled) > -1);
});
});
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册