Change shutdown listeners (#4282)

* change shutdown to use proper notification

* change to use storage service

* remove unused imports

* fix test

* change shutdown methods to private

* remove unusde imports

* fix tests

* formatting
This commit is contained in:
Anthony Dresser
2019-03-13 15:15:51 -07:00
committed by GitHub
parent 08d4cc9690
commit b6584c9ddf
16 changed files with 51 additions and 43 deletions

View File

@@ -19,6 +19,7 @@ import { INotebookProvider } from 'sql/workbench/services/notebook/common/notebo
import { INotebookManagerDetails, INotebookSessionDetails, INotebookKernelDetails, INotebookFutureDetails } from 'sql/workbench/api/common/sqlExtHostTypes';
import { LocalContentManager } from 'sql/workbench/services/notebook/node/localContentManager';
import { ContextKeyServiceStub } from 'sqltest/stubs/contextKeyServiceStub';
import { TestLifecycleService } from 'vs/workbench/test/workbenchTestServices';
suite('MainThreadNotebook Tests', () => {
@@ -27,12 +28,13 @@ suite('MainThreadNotebook Tests', () => {
let notebookUri: URI;
let mockNotebookService: TypeMoq.Mock<NotebookService>;
let providerId = 'TestProvider';
setup(() => {
mockProxy = TypeMoq.Mock.ofType(ExtHostNotebookStub);
let extContext = <IExtHostContext>{
getProxy: proxyType => mockProxy.object
};
mockNotebookService = TypeMoq.Mock.ofType(NotebookService, undefined, undefined, undefined, undefined, undefined, new ContextKeyServiceStub());
mockNotebookService = TypeMoq.Mock.ofType(NotebookService, undefined, new TestLifecycleService(), undefined, undefined, undefined, undefined, new ContextKeyServiceStub());
notebookUri = URI.parse('file:/user/default/my.ipynb');
mainThreadNotebook = new MainThreadNotebook(extContext, mockNotebookService.object);
});