2015-10-13 03:29:13 -04:00
|
|
|
import {SpyObject} from 'angular2/testing_internal';
|
2016-04-14 15:35:24 -04:00
|
|
|
import {ReflectiveInjector, provide} from 'angular2/core';
|
2015-11-06 20:34:07 -05:00
|
|
|
import {global} from 'angular2/src/facade/lang';
|
2015-10-28 13:34:13 -04:00
|
|
|
import {ApplicationRef, ApplicationRef_} from 'angular2/src/core/application_ref';
|
|
|
|
|
|
|
|
export class SpyApplicationRef extends SpyObject {
|
|
|
|
constructor() { super(ApplicationRef_); }
|
|
|
|
}
|
2015-09-04 17:44:24 -04:00
|
|
|
|
2015-09-15 20:13:48 -04:00
|
|
|
export class SpyComponentRef extends SpyObject {
|
2015-09-04 17:44:24 -04:00
|
|
|
injector;
|
|
|
|
constructor() {
|
|
|
|
super();
|
2016-04-14 15:35:24 -04:00
|
|
|
this.injector = ReflectiveInjector.resolveAndCreate(
|
|
|
|
[provide(ApplicationRef, {useClass: SpyApplicationRef})]);
|
2015-09-04 17:44:24 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export function callNgProfilerTimeChangeDetection(config?): void {
|
|
|
|
(<any>global).ng.profiler.timeChangeDetection(config);
|
|
|
|
}
|