66'use strict' ;
77
88import { NullThreadService } from 'vs/platform/test/common/nullThreadService' ;
9- import { create } from 'vs/base/common/types' ;
109import { SyncDescriptor0 } from 'vs/platform/instantiation/common/descriptors' ;
1110import { TPromise } from 'vs/base/common/winjs.base' ;
12- import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation' ;
1311
1412export class TestThreadService extends NullThreadService {
1513
@@ -21,10 +19,12 @@ export class TestThreadService extends NullThreadService {
2119 return this . _callCountValue ;
2220 }
2321
24- private set _callCount ( value :number ) {
22+ private set _callCount ( value : number ) {
2523 this . _callCountValue = value ;
2624 if ( this . _callCountValue === 0 ) {
27- this . _completeIdle && this . _completeIdle ( ) ;
25+ if ( this . _completeIdle ) {
26+ this . _completeIdle ( ) ;
27+ }
2828 this . _idle = undefined ;
2929 }
3030 }
@@ -49,18 +49,19 @@ export class TestThreadService extends NullThreadService {
4949
5050 protected _registerAndInstantiateMainProcessActor < T > ( id : string , descriptor : SyncDescriptor0 < T > ) : T {
5151
52- let _calls :{ path : string ; args : any [ ] } [ ] = [ ] ;
52+ let _calls : { path : string ; args : any [ ] } [ ] = [ ] ;
5353 let _instance : any ;
5454
5555 return this . _getOrCreateProxyInstance ( {
5656
57-
5857 callOnRemote : ( proxyId : string , path : string , args : any [ ] ) : TPromise < any > => {
5958
6059 this . _callCount ++ ;
6160 _calls . push ( { path, args} ) ;
6261
63- return TPromise . timeout ( 0 ) . then ( ( ) => {
62+ return new TPromise < any > ( ( c ) => {
63+ setTimeout ( c , 0 ) ;
64+ } ) . then ( ( ) => {
6465 if ( ! _instance ) {
6566 _instance = this . _instantiationService . createInstance ( descriptor . ctor ) ;
6667 }
@@ -91,4 +92,4 @@ export class TestThreadService extends NullThreadService {
9192}
9293
9394const Instance = new TestThreadService ( ) ;
94- export default Instance ;
95+ export default Instance ;
0 commit comments