Index: remoting/webapp/crd/js/remoting.js |
diff --git a/remoting/webapp/crd/js/remoting.js b/remoting/webapp/crd/js/remoting.js |
index c2bedd1ddff9465c9e59bc3bb261aa8c1a990fb5..1aede84d3fef67ab00ee3a35b9ad2509b301b348 100644 |
--- a/remoting/webapp/crd/js/remoting.js |
+++ b/remoting/webapp/crd/js/remoting.js |
@@ -47,6 +47,26 @@ function consentRequired_(authContinue) { |
} |
/** |
+ * Entry point for test code. In order to make test and production code as |
+ * similar as possible, the same entry point is used for production code, |
+ * but since production code should never have 'source' set to 'about_page', |
+ * it will continue with initialization immediately. As a fail-safe, the |
+ * mechanism by which initialization completes when under test is controlled |
+ * by a simple UI, making it possible to use the app even if the previous |
+ * assumption fails to hold in some corner cases. |
+ */ |
+remoting.initForTesting = function() { |
garykac
2014/12/02 16:43:22
This belongs in (the newly created) crd_main.js.
|
+ var urlParams = getUrlParameters_(); |
+ if (urlParams['source'] === 'about_page') { |
+ document.getElementById('browser-test-continue-init').addEventListener( |
+ 'click', remoting.init, false); |
+ document.getElementById('browser-test-deferred-init').hidden = false; |
+ } else { |
+ remoting.init(); |
+ } |
+}; |
+ |
+/** |
* Entry point for app initialization. |
*/ |
remoting.init = function() { |