OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/chromeos/login/test/oobe_base_test.h" | 5 #include "chrome/browser/chromeos/login/test/oobe_base_test.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 void OobeBaseTest::WaitForGaiaPageReload() { | 230 void OobeBaseTest::WaitForGaiaPageReload() { |
231 // Starts listening to message before executing the JS code that generates | 231 // Starts listening to message before executing the JS code that generates |
232 // the message below. | 232 // the message below. |
233 content::DOMMessageQueue message_queue; | 233 content::DOMMessageQueue message_queue; |
234 | 234 |
235 JS().Evaluate( | 235 JS().Evaluate( |
236 "(function() {" | 236 "(function() {" |
237 " var authenticator = $('gaia-signin').gaiaAuthHost_;" | 237 " var authenticator = $('gaia-signin').gaiaAuthHost_;" |
238 " var f = function() {" | 238 " var f = function() {" |
239 " authenticator.removeEventListener('ready', f);" | 239 " authenticator.removeEventListener('ready', f);" |
240 " window.domAutomationController.setAutomationId(0);" | |
241 " window.domAutomationController.send('GaiaReady');" | 240 " window.domAutomationController.send('GaiaReady');" |
242 " };" | 241 " };" |
243 " authenticator.addEventListener('ready', f);" | 242 " authenticator.addEventListener('ready', f);" |
244 "})();"); | 243 "})();"); |
245 | 244 |
246 std::string message; | 245 std::string message; |
247 do { | 246 do { |
248 ASSERT_TRUE(message_queue.WaitForMessage(&message)); | 247 ASSERT_TRUE(message_queue.WaitForMessage(&message)); |
249 } while (message != "\"GaiaReady\""); | 248 } while (message != "\"GaiaReady\""); |
250 } | 249 } |
(...skipping 21 matching lines...) Expand all Loading... |
272 "document.getElementById('$FieldId').value = '$FieldValue';" | 271 "document.getElementById('$FieldId').value = '$FieldValue';" |
273 "var e = new Event('input');" | 272 "var e = new Event('input');" |
274 "document.getElementById('$FieldId').dispatchEvent(e);" | 273 "document.getElementById('$FieldId').dispatchEvent(e);" |
275 "})();"; | 274 "})();"; |
276 base::ReplaceSubstringsAfterOffset(&js, 0, "$FieldId", field_id); | 275 base::ReplaceSubstringsAfterOffset(&js, 0, "$FieldId", field_id); |
277 base::ReplaceSubstringsAfterOffset(&js, 0, "$FieldValue", field_value); | 276 base::ReplaceSubstringsAfterOffset(&js, 0, "$FieldValue", field_value); |
278 ExecuteJsInSigninFrame(js); | 277 ExecuteJsInSigninFrame(js); |
279 } | 278 } |
280 | 279 |
281 } // namespace chromeos | 280 } // namespace chromeos |
OLD | NEW |