提交 c8914ccd 编写于 作者: B Benjamin Pasero

fix tests

上级 1af680b8
......@@ -32,7 +32,7 @@ export class TextFileEditorModelManager implements ITextFileEditorModelManager {
private mapResourceToDisposeListener: { [resource: string]: IDisposable; };
private mapResourceToStateChangeListener: { [resource: string]: IDisposable; };
private mapResourcePathToModel: { [resource: string]: TextFileEditorModel; };
private mapResourceToPendingModelLoaders: { [resource: string]: TPromise<TextFileEditorModel>};
private mapResourceToPendingModelLoaders: { [resource: string]: TPromise<TextFileEditorModel> };
constructor(
@ILifecycleService private lifecycleService: ILifecycleService,
......@@ -183,15 +183,19 @@ export class TextFileEditorModelManager implements ITextFileEditorModelManager {
// Install state change listener
this.mapResourceToStateChangeListener[resource.toString()] = model.onDidStateChange(state => {
const event = new TextFileModelChangeEvent(model, state);
switch(state) {
switch (state) {
case StateChange.DIRTY:
this._onModelDirty.fire(event);
break;
case StateChange.SAVE_ERROR:
this._onModelSaveError.fire(event);
break;
case StateChange.SAVED:
this._onModelSaved.fire(event);
break;
case StateChange.REVERTED:
this._onModelReverted.fire(event);
break;
}
});
}
......
......@@ -301,6 +301,10 @@ suite('Files - TextFileEditorModelManager', () => {
model2.dispose();
return model1.revert().then(() => { // should not trigger another event if disposed
assert.equal(dirtyCounter, 2);
assert.equal(revertedCounter, 1);
assert.equal(savedCounter, 1);
done();
});
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册