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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/bind_helpers.h" | 6 #include "base/bind_helpers.h" |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 #include "chrome/browser/chromeos/login/ui/webui_login_display.h" | 26 #include "chrome/browser/chromeos/login/ui/webui_login_display.h" |
27 #include "chrome/browser/chromeos/login/users/user_manager.h" | 27 #include "chrome/browser/chromeos/login/users/user_manager.h" |
28 #include "chrome/browser/chromeos/login/wizard_controller.h" | 28 #include "chrome/browser/chromeos/login/wizard_controller.h" |
29 #include "chrome/browser/chromeos/policy/device_policy_builder.h" | 29 #include "chrome/browser/chromeos/policy/device_policy_builder.h" |
30 #include "chrome/browser/chromeos/policy/device_policy_cros_browser_test.h" | 30 #include "chrome/browser/chromeos/policy/device_policy_cros_browser_test.h" |
31 #include "chrome/browser/chromeos/policy/proto/chrome_device_policy.pb.h" | 31 #include "chrome/browser/chromeos/policy/proto/chrome_device_policy.pb.h" |
32 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 32 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
33 #include "chrome/browser/chromeos/settings/cros_settings.h" | 33 #include "chrome/browser/chromeos/settings/cros_settings.h" |
34 #include "chrome/browser/lifetime/application_lifetime.h" | 34 #include "chrome/browser/lifetime/application_lifetime.h" |
35 #include "chrome/browser/profiles/profile.h" | 35 #include "chrome/browser/profiles/profile.h" |
| 36 #include "chrome/browser/ui/webui/signin/inline_login_ui.h" |
36 #include "chrome/common/chrome_paths.h" | 37 #include "chrome/common/chrome_paths.h" |
37 #include "chrome/common/chrome_switches.h" | 38 #include "chrome/common/chrome_switches.h" |
38 #include "chrome/grit/generated_resources.h" | 39 #include "chrome/grit/generated_resources.h" |
39 #include "chrome/test/base/in_process_browser_test.h" | 40 #include "chrome/test/base/in_process_browser_test.h" |
40 #include "chromeos/chromeos_switches.h" | 41 #include "chromeos/chromeos_switches.h" |
41 #include "chromeos/dbus/dbus_thread_manager.h" | 42 #include "chromeos/dbus/dbus_thread_manager.h" |
42 #include "chromeos/dbus/fake_dbus_thread_manager.h" | 43 #include "chromeos/dbus/fake_dbus_thread_manager.h" |
43 #include "chromeos/dbus/fake_session_manager_client.h" | 44 #include "chromeos/dbus/fake_session_manager_client.h" |
44 #include "chromeos/dbus/session_manager_client.h" | 45 #include "chromeos/dbus/session_manager_client.h" |
45 #include "chromeos/settings/cros_settings_names.h" | 46 #include "chromeos/settings/cros_settings_names.h" |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 return error_message; | 430 return error_message; |
430 } | 431 } |
431 | 432 |
432 content::WebUI* GetLoginUI() { | 433 content::WebUI* GetLoginUI() { |
433 return static_cast<LoginDisplayHostImpl*>( | 434 return static_cast<LoginDisplayHostImpl*>( |
434 LoginDisplayHostImpl::default_host())->GetOobeUI()->web_ui(); | 435 LoginDisplayHostImpl::default_host())->GetOobeUI()->web_ui(); |
435 } | 436 } |
436 | 437 |
437 // Executes JavaScript code in the auth iframe hosted by gaia_auth extension. | 438 // Executes JavaScript code in the auth iframe hosted by gaia_auth extension. |
438 void ExecuteJsInSigninFrame(const std::string& js) { | 439 void ExecuteJsInSigninFrame(const std::string& js) { |
439 content::RenderFrameHost* frame = | 440 content::RenderFrameHost* frame = InlineLoginUI::GetAuthIframe( |
440 LoginDisplayHostImpl::GetGaiaAuthIframe(GetLoginUI()->GetWebContents()); | 441 GetLoginUI()->GetWebContents(), GURL(), "signin-frame"); |
441 ASSERT_TRUE(content::ExecuteScript(frame, js)); | 442 ASSERT_TRUE(content::ExecuteScript(frame, js)); |
442 } | 443 } |
443 | 444 |
444 FakeSamlIdp* fake_saml_idp() { return &fake_saml_idp_; } | 445 FakeSamlIdp* fake_saml_idp() { return &fake_saml_idp_; } |
445 | 446 |
446 protected: | 447 protected: |
447 scoped_ptr<content::WindowedNotificationObserver> login_screen_load_observer_; | 448 scoped_ptr<content::WindowedNotificationObserver> login_screen_load_observer_; |
448 | 449 |
449 private: | 450 private: |
450 FakeGaia fake_gaia_; | 451 FakeGaia fake_gaia_; |
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
975 kTestAuthSIDCookie1, | 976 kTestAuthSIDCookie1, |
976 kTestAuthLSIDCookie1); | 977 kTestAuthLSIDCookie1); |
977 | 978 |
978 GetCookies(); | 979 GetCookies(); |
979 EXPECT_EQ(kTestAuthSIDCookie1, GetCookieValue(kGAIASIDCookieName)); | 980 EXPECT_EQ(kTestAuthSIDCookie1, GetCookieValue(kGAIASIDCookieName)); |
980 EXPECT_EQ(kTestAuthLSIDCookie1, GetCookieValue(kGAIALSIDCookieName)); | 981 EXPECT_EQ(kTestAuthLSIDCookie1, GetCookieValue(kGAIALSIDCookieName)); |
981 EXPECT_EQ(kSAMLIdPCookieValue1, GetCookieValue(kSAMLIdPCookieName)); | 982 EXPECT_EQ(kSAMLIdPCookieValue1, GetCookieValue(kSAMLIdPCookieName)); |
982 } | 983 } |
983 | 984 |
984 } // namespace chromeos | 985 } // namespace chromeos |
OLD | NEW |