提交 40871a23 编写于 作者: B Benjamin Pasero

clean up failing test

上级 20521ebf
......@@ -95,7 +95,7 @@ export function detectEncodingByBOM(file: string): TPromise<string> {
return stream.readExactlyByFile(file, 3).then(({ buffer, bytesRead }) => detectEncodingByBOMFromBuffer(buffer, bytesRead));
}
const MINIMUM_THRESHOLD = 0.2; // TODO@Ben Decide how much this should be.
const MINIMUM_THRESHOLD = 0.2;
jschardet.Constants.MINIMUM_THRESHOLD = MINIMUM_THRESHOLD;
const IGNORE_ENCODINGS = ['ascii', 'utf-8', 'utf-16', 'utf-32'];
......
......@@ -25,7 +25,7 @@ suite('IPC', () => {
test('createChannel', () => {
if (process.env['VSCODE_PID']) {
return undefined; // TODO@Ben find out why test fails when run from within VS Code
return undefined; // this test fails when run from within VS Code
}
const client = createClient();
......@@ -42,7 +42,7 @@ suite('IPC', () => {
test('cancellation', () => {
if (process.env['VSCODE_PID']) {
return undefined; // TODO@Ben find out why test fails when run from within VS Code
return undefined; // this test fails when run from within VS Code
}
const client = createClient();
......@@ -62,7 +62,7 @@ suite('IPC', () => {
test('events', () => {
if (process.env['VSCODE_PID']) {
return undefined; // TODO@Ben find out why test fails when run from within VS Code
return undefined; // this test fails when run from within VS Code
}
const client = createClient();
......@@ -88,7 +88,7 @@ suite('IPC', () => {
test('event dispose', () => {
if (process.env['VSCODE_PID']) {
return undefined; // TODO@Ben find out why test fails when run from within VS Code
return undefined; // this test fails when run from within VS Code
}
const client = createClient();
......
......@@ -14,7 +14,7 @@ suite('Ports', () => {
this.timeout(1000 * 10); // higher timeout for this test
if (process.env['VSCODE_PID']) {
return done(); // TODO@Ben find out why test fails when run from within VS Code
return done(); // this test fails when run from within VS Code
}
// get an initial freeport >= 7000
......
......@@ -27,7 +27,7 @@ function fork(id: string): cp.ChildProcess {
suite('Processes', () => {
test('buffered sending - simple data', function (done: () => void) {
if (process.env['VSCODE_PID']) {
return done(); // TODO@Ben find out why test fails when run from within VS Code
return done(); // this test fails when run from within VS Code
}
const child = fork('vs/base/test/node/processes/fixtures/fork');
......
......@@ -102,7 +102,7 @@ function setupIPC(accessor: ServicesAccessor): TPromise<Server> {
return connect(environmentService.mainIPCHandle, 'main').then(
client => {
// Tests from CLI require to be the only instance currently (TODO@Ben support multiple instances and output)
// Tests from CLI require to be the only instance currently
if (environmentService.extensionTestsPath && !environmentService.debugExtensionHost.break) {
const msg = 'Running extension tests from the command line is currently only supported if no other instance of Code is running.';
console.error(msg);
......
......@@ -516,9 +516,7 @@ registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => {
collector.addRule(`.monaco-shell { color: ${windowForeground}; }`);
}
// TODO@Ben the workbench background color is not really surfacing anywhere but on Windows
// not setting it will cause many part of the worbench to not use subpixel-antialiasing causing
// these parts to look fuzzy on higher resolution displays.
// We need to set the workbench background color so that on Windows we get subpixel-antialiasing.
let workbenchBackground: string;
switch (theme.type) {
case 'dark':
......
......@@ -120,22 +120,6 @@ export class WalkThroughInput extends EditorInput {
}
return this.promise;
// TODO: replicate above?
// return this.promise.then(ref => {
// const model = ref.object;
// if (!(model instanceof ResourceEditorModel)) {
// ref.dispose();
// this.promise = null;
// return TPromise.wrapError(`Unexpected model for ResourceInput: ${this.resource}`); // TODO@Ben eventually also files should be supported, but we guard due to the dangerous dispose of the model in dispose()
// }
// // TODO@Joao this should never happen
// model.onDispose(() => this.dispose());
// return model;
// });
}
matches(otherInput: any): boolean {
......
......@@ -228,35 +228,6 @@ suite('Files - TextFileEditorModel', () => {
}, error => onError(error, done));
});
test('Auto Save triggered when model changes', function (done) {
let eventCounter = 0;
const model: TextFileEditorModel = instantiationService.createInstance(TextFileEditorModel, toResource.call(this, '/path/index.txt'), 'utf8');
(<any>model).autoSaveAfterMillies = 10;
(<any>model).autoSaveAfterMilliesEnabled = true;
model.onDidStateChange(e => {
if (e === StateChange.DIRTY || e === StateChange.SAVED) {
eventCounter++;
}
});
model.load().done(() => {
model.textEditorModel.setValue('foo');
return TPromise.timeout(200).then(() => {
assert.ok(!model.isDirty());
assert.equal(eventCounter, 2);
model.dispose();
assert.ok(!accessor.modelService.getModel(model.getResource()));
done();
});
}, error => onError(error, done));
});
test('save() and isDirty() - proper with check for mtimes', function (done) {
const input1 = createFileInput(instantiationService, toResource.call(this, '/path/index_async2.txt'));
const input2 = createFileInput(instantiationService, toResource.call(this, '/path/index_async.txt'));
......@@ -375,26 +346,6 @@ suite('Files - TextFileEditorModel', () => {
}, error => onError(error, done));
});
// TODO@Ben unreliable test
// test('Orphaned models - state and event', function (done) {
// const model: TextFileEditorModel = instantiationService.createInstance(TextFileEditorModel, toResource.call(this, '/path/index_async.txt'), 'utf8');
// const unbind = model.onDidStateChange(e => {
// if (e === StateChange.ORPHANED_CHANGE) {
// unbind.dispose();
// done();
// }
// });
// accessor.fileService.fireFileChanges(new FileChangesEvent([{ resource: model.getResource(), type: FileChangeType.DELETED }]));
// return TPromise.timeout(110).then(() => {
// assert.ok(model.hasState(ModelState.ORPHAN));
// accessor.fileService.fireFileChanges(new FileChangesEvent([{ resource: model.getResource(), type: FileChangeType.ADDED }]));
// assert.ok(!model.hasState(ModelState.ORPHAN));
// });
// });
test('SaveSequentializer - pending basics', function (done) {
const sequentializer = new SaveSequentializer();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册