| 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.
|
|
|