fix(closure): prevent closure renaming of testability interface (#11146)

This commit is contained in:
Alex Eagle
2016-08-29 13:08:28 -07:00
committed by Victor Berchet
parent d7de5c4f8e
commit 875e66409c
4 changed files with 16 additions and 30 deletions

View File

@ -12,27 +12,6 @@ import {getDOM} from '../dom/dom_adapter';
import {ListWrapper} from '../facade/collection';
import {global, isPresent} from '../facade/lang';
class PublicTestability {
/** @internal */
_testability: Testability;
constructor(testability: Testability) { this._testability = testability; }
isStable(): boolean { return this._testability.isStable(); }
whenStable(callback: Function) { this._testability.whenStable(callback); }
findBindings(using: any, provider: string, exactMatch: boolean): any[] {
return this.findProviders(using, provider, exactMatch);
}
findProviders(using: any, provider: string, exactMatch: boolean): any[] {
return this._testability.findBindings(using, provider, exactMatch);
}
}
export class BrowserGetTestability implements GetTestability {
static init() { setTestabilityGetter(new BrowserGetTestability()); }
@ -42,13 +21,10 @@ export class BrowserGetTestability implements GetTestability {
if (testability == null) {
throw new Error('Could not find testability for element.');
}
return new PublicTestability(testability);
return testability;
};
global.getAllAngularTestabilities = () => {
var testabilities = registry.getAllTestabilities();
return testabilities.map((testability) => { return new PublicTestability(testability); });
};
global.getAllAngularTestabilities = () => { return registry.getAllTestabilities(); };
global.getAllAngularRootElements = () => registry.getAllRootElements();