vsavkin 89eefcd7b5 cleanup(tooling): move tooling to the browser platform and rename profile into instrumentation
BREAKING CHANGE

Before

import * as p from 'angular2/profile';
import * as t from 'angular2/tools';

After

import * as p from 'angular2/instrumentation';
import * as t from 'angular2/platform/browser';
2015-11-24 19:29:52 +00:00

30 lines
880 B
Dart

import 'package:angular2/testing_internal.dart' show SpyObject;
import 'package:angular2/core.dart' show Injector, bind;
import 'package:angular2/src/core/application_ref.dart' show ApplicationRef;
import 'package:angular2/src/core/linker/dynamic_component_loader.dart'
show ComponentRef_;
import 'dart:js';
@proxy
class SpyApplicationRef extends SpyObject implements ApplicationRef {
tick() {}
noSuchMethod(m) => super.noSuchMethod(m);
}
@proxy
class SpyComponentRef extends SpyObject implements ComponentRef_ {
Injector injector;
SpyComponentRef() {
this.injector =
Injector.resolveAndCreate([bind(ApplicationRef).toClass(SpyApplicationRef)]);
}
noSuchMethod(m) => super.noSuchMethod(m);
}
void callNgProfilerTimeChangeDetection([config]) {
context['ng']['profiler']
.callMethod('timeChangeDetection', config != null ? [config] : []);
}