@@ -12,6 +12,7 @@ import { InstantiationService } from 'vs/platform/instantiation/common/instantia
1212import { IExtensionPoint } from 'vs/workbench/services/extensions/common/extensionsRegistry' ;
1313import { Event , Emitter } from 'vs/base/common/event' ;
1414import { NullLogService } from 'vs/platform/log/common/log' ;
15+ import { IProgressService2 } from 'vs/platform/progress/common/progress' ;
1516
1617class SimpleExtensionService implements IExtensionService {
1718 _serviceBrand : any ;
@@ -54,6 +55,17 @@ class SimpleExtensionService implements IExtensionService {
5455
5556suite ( 'CommandService' , function ( ) {
5657
58+ interface Ctor < T > {
59+ new ( ) : T ;
60+ }
61+ function mock < T > ( ) : Ctor < T > {
62+ return function ( ) { } as any ;
63+ }
64+
65+ let progressService = new class extends mock < IProgressService2 > ( ) {
66+ withProgress ( ) { return null ; }
67+ } ;
68+
5769 let commandRegistration : IDisposable ;
5870
5971 setup ( function ( ) {
@@ -73,7 +85,7 @@ suite('CommandService', function () {
7385 lastEvent = activationEvent ;
7486 return super . activateByEvent ( activationEvent ) ;
7587 }
76- } , new NullLogService ( ) ) ;
88+ } , new NullLogService ( ) , progressService ) ;
7789
7890 return service . executeCommand ( 'foo' ) . then ( ( ) => {
7991 assert . ok ( lastEvent , 'onCommand:foo' ) ;
@@ -91,7 +103,7 @@ suite('CommandService', function () {
91103 activateByEvent ( activationEvent : string ) : TPromise < void > {
92104 return TPromise . wrapError < void > ( new Error ( 'bad_activate' ) ) ;
93105 }
94- } , new NullLogService ( ) ) ;
106+ } , new NullLogService ( ) , progressService ) ;
95107
96108 return service . executeCommand ( 'foo' ) . then ( ( ) => assert . ok ( false ) , err => {
97109 assert . equal ( err . message , 'bad_activate' ) ;
@@ -107,7 +119,7 @@ suite('CommandService', function () {
107119 whenInstalledExtensionsRegistered ( ) {
108120 return new TPromise < boolean > ( _resolve => { /*ignore*/ } ) ;
109121 }
110- } , new NullLogService ( ) ) ;
122+ } , new NullLogService ( ) , progressService ) ;
111123
112124 service . executeCommand ( 'bar' ) ;
113125 assert . equal ( callCounter , 1 ) ;
@@ -124,7 +136,7 @@ suite('CommandService', function () {
124136 whenInstalledExtensionsRegistered ( ) {
125137 return whenInstalledExtensionsRegistered ;
126138 }
127- } , new NullLogService ( ) ) ;
139+ } , new NullLogService ( ) , progressService ) ;
128140
129141 let r = service . executeCommand ( 'bar' ) ;
130142 assert . equal ( callCounter , 0 ) ;
0 commit comments