Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1704)

Unified Diff: chrome/browser/resources/chromeos/login/login_shared.js

Issue 2828443004: Update readyForTesting var even on Oobe.initialize() failure. (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/chromeos/login/login_shared.js
diff --git a/chrome/browser/resources/chromeos/login/login_shared.js b/chrome/browser/resources/chromeos/login/login_shared.js
index 00832b5b8724636ad562c8528fcaca1d92a2e40b..857bba5f0c9321939b45ef07c37c0e61ce6e1e74 100644
--- a/chrome/browser/resources/chromeos/login/login_shared.js
+++ b/chrome/browser/resources/chromeos/login/login_shared.js
@@ -282,8 +282,8 @@ cr.define('cr.ui', function() {
/**
* Some ForTesting APIs directly access to DOM. Because this script is loaded
* in header, DOM tree may not be available at beginning.
- * In DOMContentLoaded, this is marked to true, indicating ForTesting methods
- * can be called.
+ * In DOMContentLoaded, after Oobe.initialize() is done, this is marked to
+ * true, indicating ForTesting methods can be called.
* External script using ForTesting APIs should wait for this condition.
* @type {boolean}
*/
@@ -449,8 +449,17 @@ disableTextSelectAndDrag(function(e) {
'use strict';
document.addEventListener('DOMContentLoaded', function() {
- Oobe.initialize();
- Oobe.readyForTesting = true;
+ try {
+ Oobe.initialize();
+ } finally {
+ // TODO(crbug.com/712078): Do not set readyForTesting in case of that
+ // initialize() is failed. Currently, in some situation, initialize()
+ // raises an exception unexpectedly. It means testing APIs should not
+ // be called then. However, checking it here now causes bots failures
+ // unfortunately. So, as a short term workaround, here set
+ // readyForTesting even on failures, just to make test bots happy.
+ Oobe.readyForTesting = true;
+ }
});
// Install a global error handler so stack traces are included in logs.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698