From 817c79ca7749fe80208f028827d49de696e2e6b5 Mon Sep 17 00:00:00 2001 From: Julie Ralph Date: Thu, 16 Apr 2015 11:00:13 -0700 Subject: [PATCH] refactor(testability): rename function to get testability Previously, getting testability was `window.angular2.getTestability` This was because the plan was to export the API to the window as angular2. However, the decision was changed to make this just `angular` in https://github.com/angular/angular/commit/3177576ad6889fd7cb592d27ff0cd5c0d85bd9d6 To decouple testability from the rest of the Angular API, just make it one function, `window.getAngularTestability`. --- .../angular2/src/core/testability/get_testability.dart | 7 ++----- .../angular2/src/core/testability/get_testability.es6 | 9 +-------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/modules/angular2/src/core/testability/get_testability.dart b/modules/angular2/src/core/testability/get_testability.dart index 5cc430f908..9ea1fae5ce 100644 --- a/modules/angular2/src/core/testability/get_testability.dart +++ b/modules/angular2/src/core/testability/get_testability.dart @@ -85,12 +85,9 @@ class PublicTestability implements _JsObjectProxyable { class GetTestability { static addToWindow(TestabilityRegistry registry) { - js.context['angular2'] = _jsify({ - 'getTestability': (Element elem) { + js.context['getAngularTestability'] = _jsify((Element elem) { Testability testability = registry.findTestabilityInTree(elem); return _jsify(new PublicTestability(testability)); - }, - 'resumeBootstrap': ([arg]) {}, - }); + }); } } diff --git a/modules/angular2/src/core/testability/get_testability.es6 b/modules/angular2/src/core/testability/get_testability.es6 index d8ff9d2b5a..06a5ba2f96 100644 --- a/modules/angular2/src/core/testability/get_testability.es6 +++ b/modules/angular2/src/core/testability/get_testability.es6 @@ -19,10 +19,7 @@ class PublicTestability { export class GetTestability { static addToWindow(registry: TestabilityRegistry) { - if (!global.angular2) { - global.angular2 = {}; - } - global.angular2.getTestability = function(elem): PublicTestability { + global.getAngularTestability = function(elem): PublicTestability { var testability = registry.findTestabilityInTree(elem); if (testability == null) { @@ -30,9 +27,5 @@ export class GetTestability { } return new PublicTestability(testability); }; - global.angular2.resumeBootstrap = function() { - // Intentionally left blank. This will allow Protractor to run - // against angular2 without turning off Angular synchronization. - }; } }