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" |
11 #include "chrome/browser/chromeos/login/existing_user_controller.h" | 11 #include "chrome/browser/chromeos/login/existing_user_controller.h" |
12 #include "chrome/browser/chromeos/login/session/user_session_manager.h" | 12 #include "chrome/browser/chromeos/login/session/user_session_manager.h" |
13 #include "chrome/browser/chromeos/login/session/user_session_manager_test_api.h" | 13 #include "chrome/browser/chromeos/login/session/user_session_manager_test_api.h" |
14 #include "chrome/browser/chromeos/login/test/https_forwarder.h" | 14 #include "chrome/browser/chromeos/login/test/https_forwarder.h" |
15 #include "chrome/browser/chromeos/login/ui/webui_login_view.h" | 15 #include "chrome/browser/chromeos/login/ui/webui_login_view.h" |
16 #include "chrome/browser/chromeos/net/network_portal_detector_test_impl.h" | 16 #include "chrome/browser/chromeos/net/network_portal_detector_test_impl.h" |
17 #include "chrome/browser/lifetime/application_lifetime.h" | 17 #include "chrome/browser/lifetime/application_lifetime.h" |
18 #include "chrome/browser/ui/webui/signin/inline_login_ui.h" | 18 #include "chrome/browser/ui/webui/signin/get_auth_frame.h" |
19 #include "chrome/common/chrome_paths.h" | 19 #include "chrome/common/chrome_paths.h" |
20 #include "chrome/common/chrome_switches.h" | 20 #include "chrome/common/chrome_switches.h" |
21 #include "chromeos/chromeos_switches.h" | 21 #include "chromeos/chromeos_switches.h" |
22 #include "chromeos/dbus/fake_shill_manager_client.h" | 22 #include "chromeos/dbus/fake_shill_manager_client.h" |
23 #include "components/policy/core/common/policy_switches.h" | 23 #include "components/policy/core/common/policy_switches.h" |
24 #include "components/user_manager/fake_user_manager.h" | 24 #include "components/user_manager/fake_user_manager.h" |
25 #include "content/public/browser/notification_observer.h" | 25 #include "content/public/browser/notification_observer.h" |
26 #include "content/public/browser/notification_registrar.h" | 26 #include "content/public/browser/notification_registrar.h" |
27 #include "content/public/browser/notification_service.h" | 27 #include "content/public/browser/notification_service.h" |
28 #include "content/public/test/browser_test_utils.h" | 28 #include "content/public/test/browser_test_utils.h" |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 WizardController* wizard_controller = WizardController::default_controller(); | 238 WizardController* wizard_controller = WizardController::default_controller(); |
239 if (wizard_controller) | 239 if (wizard_controller) |
240 wizard_controller->SkipToLoginForTesting(LoginScreenContext()); | 240 wizard_controller->SkipToLoginForTesting(LoginScreenContext()); |
241 | 241 |
242 WizardController::SkipPostLoginScreensForTesting(); | 242 WizardController::SkipPostLoginScreensForTesting(); |
243 | 243 |
244 login_screen_load_observer_->Wait(); | 244 login_screen_load_observer_->Wait(); |
245 } | 245 } |
246 | 246 |
247 void OobeBaseTest::ExecuteJsInSigninFrame(const std::string& js) { | 247 void OobeBaseTest::ExecuteJsInSigninFrame(const std::string& js) { |
248 content::RenderFrameHost* frame = InlineLoginUI::GetAuthFrame( | 248 content::RenderFrameHost* frame = |
249 GetLoginUI()->GetWebContents(), GURL(), gaia_frame_parent_); | 249 signin::GetAuthFrame(GetLoginUI()->GetWebContents(), gaia_frame_parent_); |
250 ASSERT_TRUE(content::ExecuteScript(frame, js)); | 250 ASSERT_TRUE(content::ExecuteScript(frame, js)); |
251 } | 251 } |
252 | 252 |
253 void OobeBaseTest::SetSignFormField(const std::string& field_id, | 253 void OobeBaseTest::SetSignFormField(const std::string& field_id, |
254 const std::string& field_value) { | 254 const std::string& field_value) { |
255 std::string js = | 255 std::string js = |
256 "(function(){" | 256 "(function(){" |
257 "document.getElementById('$FieldId').value = '$FieldValue';" | 257 "document.getElementById('$FieldId').value = '$FieldValue';" |
258 "var e = new Event('input');" | 258 "var e = new Event('input');" |
259 "document.getElementById('$FieldId').dispatchEvent(e);" | 259 "document.getElementById('$FieldId').dispatchEvent(e);" |
260 "})();"; | 260 "})();"; |
261 base::ReplaceSubstringsAfterOffset(&js, 0, "$FieldId", field_id); | 261 base::ReplaceSubstringsAfterOffset(&js, 0, "$FieldId", field_id); |
262 base::ReplaceSubstringsAfterOffset(&js, 0, "$FieldValue", field_value); | 262 base::ReplaceSubstringsAfterOffset(&js, 0, "$FieldValue", field_value); |
263 ExecuteJsInSigninFrame(js); | 263 ExecuteJsInSigninFrame(js); |
264 } | 264 } |
265 | 265 |
266 } // namespace chromeos | 266 } // namespace chromeos |
OLD | NEW |