Chromium Code Reviews| 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 <cstring> | 5 #include <cstring> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 44 #include "chrome/common/chrome_paths.h" | 44 #include "chrome/common/chrome_paths.h" |
| 45 #include "chrome/common/chrome_switches.h" | 45 #include "chrome/common/chrome_switches.h" |
| 46 #include "chrome/common/extensions/features/feature_channel.h" | 46 #include "chrome/common/extensions/features/feature_channel.h" |
| 47 #include "chrome/common/pref_names.h" | 47 #include "chrome/common/pref_names.h" |
| 48 #include "chrome/grit/generated_resources.h" | 48 #include "chrome/grit/generated_resources.h" |
| 49 #include "chrome/test/base/in_process_browser_test.h" | 49 #include "chrome/test/base/in_process_browser_test.h" |
| 50 #include "chromeos/chromeos_switches.h" | 50 #include "chromeos/chromeos_switches.h" |
| 51 #include "chromeos/dbus/dbus_thread_manager.h" | 51 #include "chromeos/dbus/dbus_thread_manager.h" |
| 52 #include "chromeos/dbus/fake_session_manager_client.h" | 52 #include "chromeos/dbus/fake_session_manager_client.h" |
| 53 #include "chromeos/dbus/session_manager_client.h" | 53 #include "chromeos/dbus/session_manager_client.h" |
| 54 #include "chromeos/dbus/shill_manager_client.h" | |
| 54 #include "chromeos/settings/cros_settings_names.h" | 55 #include "chromeos/settings/cros_settings_names.h" |
| 55 #include "components/policy/core/browser/browser_policy_connector.h" | 56 #include "components/policy/core/browser/browser_policy_connector.h" |
| 56 #include "components/policy/core/common/mock_configuration_policy_provider.h" | 57 #include "components/policy/core/common/mock_configuration_policy_provider.h" |
| 57 #include "components/policy/core/common/policy_map.h" | 58 #include "components/policy/core/common/policy_map.h" |
| 58 #include "components/policy/core/common/policy_switches.h" | 59 #include "components/policy/core/common/policy_switches.h" |
| 59 #include "components/policy/core/common/policy_types.h" | 60 #include "components/policy/core/common/policy_types.h" |
| 60 #include "components/user_manager/user.h" | 61 #include "components/user_manager/user.h" |
| 61 #include "components/user_manager/user_manager.h" | 62 #include "components/user_manager/user_manager.h" |
| 62 #include "content/public/browser/browser_thread.h" | 63 #include "content/public/browser/browser_thread.h" |
| 63 #include "content/public/browser/render_frame_host.h" | 64 #include "content/public/browser/render_frame_host.h" |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 285 OobeBaseTest::SetUpCommandLine(command_line); | 286 OobeBaseTest::SetUpCommandLine(command_line); |
| 286 } | 287 } |
| 287 | 288 |
| 288 void SetUpOnMainThread() override { | 289 void SetUpOnMainThread() override { |
| 289 fake_gaia_->SetFakeMergeSessionParams( | 290 fake_gaia_->SetFakeMergeSessionParams( |
| 290 kFirstSAMLUserEmail, kTestAuthSIDCookie1, kTestAuthLSIDCookie1); | 291 kFirstSAMLUserEmail, kTestAuthSIDCookie1, kTestAuthLSIDCookie1); |
| 291 | 292 |
| 292 embedded_test_server()->RegisterRequestHandler(base::Bind( | 293 embedded_test_server()->RegisterRequestHandler(base::Bind( |
| 293 &FakeSamlIdp::HandleRequest, base::Unretained(&fake_saml_idp_))); | 294 &FakeSamlIdp::HandleRequest, base::Unretained(&fake_saml_idp_))); |
| 294 | 295 |
| 296 // Set up fake networks. | |
| 297 DBusThreadManager::Get() | |
| 298 ->GetShillManagerClient() | |
| 299 ->GetTestInterface() | |
| 300 ->SetupDefaultEnvironment(); | |
|
xiyuan
2015/04/23 16:09:23
nit: Move this to SAMLPolicyTest::SetUpOnMainThrea
achuithb
2015/04/23 22:11:16
Done.
| |
| 301 | |
| 295 OobeBaseTest::SetUpOnMainThread(); | 302 OobeBaseTest::SetUpOnMainThread(); |
| 296 } | 303 } |
| 297 | 304 |
| 298 virtual void StartSamlAndWaitForIdpPageLoad(const std::string& gaia_email) { | 305 virtual void StartSamlAndWaitForIdpPageLoad(const std::string& gaia_email) { |
| 299 WaitForSigninScreen(); | 306 WaitForSigninScreen(); |
| 300 | 307 |
| 301 if (!saml_load_injected_) { | 308 if (!saml_load_injected_) { |
| 302 saml_load_injected_ = true; | 309 saml_load_injected_ = true; |
| 303 | 310 |
| 304 ASSERT_TRUE(content::ExecuteScript( | 311 ASSERT_TRUE(content::ExecuteScript( |
| (...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1111 EXPECT_EQ(kTestAuthSIDCookie1, GetCookieValue(kGAIASIDCookieName)); | 1118 EXPECT_EQ(kTestAuthSIDCookie1, GetCookieValue(kGAIASIDCookieName)); |
| 1112 EXPECT_EQ(kTestAuthLSIDCookie1, GetCookieValue(kGAIALSIDCookieName)); | 1119 EXPECT_EQ(kTestAuthLSIDCookie1, GetCookieValue(kGAIALSIDCookieName)); |
| 1113 EXPECT_EQ(kSAMLIdPCookieValue1, GetCookieValue(kSAMLIdPCookieName)); | 1120 EXPECT_EQ(kSAMLIdPCookieValue1, GetCookieValue(kSAMLIdPCookieName)); |
| 1114 } | 1121 } |
| 1115 | 1122 |
| 1116 INSTANTIATE_TEST_CASE_P(SamlSuite, | 1123 INSTANTIATE_TEST_CASE_P(SamlSuite, |
| 1117 SAMLPolicyTest, | 1124 SAMLPolicyTest, |
| 1118 testing::Bool()); | 1125 testing::Bool()); |
| 1119 | 1126 |
| 1120 } // namespace chromeos | 1127 } // namespace chromeos |
| OLD | NEW |