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/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 WebUILoginDisplay* OobeBaseTest::GetLoginDisplay() { | 208 WebUILoginDisplay* OobeBaseTest::GetLoginDisplay() { |
209 ExistingUserController* controller = | 209 ExistingUserController* controller = |
210 ExistingUserController::current_controller(); | 210 ExistingUserController::current_controller(); |
211 CHECK(controller); | 211 CHECK(controller); |
212 return static_cast<WebUILoginDisplay*>( | 212 return static_cast<WebUILoginDisplay*>( |
213 controller->login_display()); | 213 controller->login_display()); |
214 } | 214 } |
215 | 215 |
216 void OobeBaseTest::WaitForGaiaPageLoad() { | 216 void OobeBaseTest::WaitForGaiaPageLoad() { |
217 WaitForSigninScreen(); | 217 WaitForSigninScreen(); |
218 WaitForGaiaPageReload(); | |
219 } | |
220 | 218 |
221 void OobeBaseTest::WaitForGaiaPageReload() { | |
222 JS().Evaluate( | 219 JS().Evaluate( |
223 "$('gaia-signin').gaiaAuthHost_.addEventListener('ready'," | 220 "$('gaia-signin').gaiaAuthHost_.addEventListener('ready'," |
224 "function() {" | 221 "function() {" |
225 "window.domAutomationController.setAutomationId(0);" | 222 "window.domAutomationController.setAutomationId(0);" |
226 "window.domAutomationController.send('GaiaReady');" | 223 "window.domAutomationController.send('GaiaReady');" |
227 "});"); | 224 "});"); |
228 | 225 |
229 content::DOMMessageQueue message_queue; | 226 content::DOMMessageQueue message_queue; |
230 std::string message; | 227 std::string message; |
231 do { | 228 do { |
(...skipping 24 matching lines...) Expand all Loading... |
256 "document.getElementById('$FieldId').value = '$FieldValue';" | 253 "document.getElementById('$FieldId').value = '$FieldValue';" |
257 "var e = new Event('input');" | 254 "var e = new Event('input');" |
258 "document.getElementById('$FieldId').dispatchEvent(e);" | 255 "document.getElementById('$FieldId').dispatchEvent(e);" |
259 "})();"; | 256 "})();"; |
260 base::ReplaceSubstringsAfterOffset(&js, 0, "$FieldId", field_id); | 257 base::ReplaceSubstringsAfterOffset(&js, 0, "$FieldId", field_id); |
261 base::ReplaceSubstringsAfterOffset(&js, 0, "$FieldValue", field_value); | 258 base::ReplaceSubstringsAfterOffset(&js, 0, "$FieldValue", field_value); |
262 ExecuteJsInSigninFrame(js); | 259 ExecuteJsInSigninFrame(js); |
263 } | 260 } |
264 | 261 |
265 } // namespace chromeos | 262 } // namespace chromeos |
OLD | NEW |