| 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 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 // spawning sandbox host process. See crbug.com/322732. | 278 // spawning sandbox host process. See crbug.com/322732. |
| 279 embedded_test_server()->StopThread(); | 279 embedded_test_server()->StopThread(); |
| 280 | 280 |
| 281 InProcessBrowserTest::SetUp(); | 281 InProcessBrowserTest::SetUp(); |
| 282 } | 282 } |
| 283 | 283 |
| 284 virtual void SetUpInProcessBrowserTestFixture() override { | 284 virtual void SetUpInProcessBrowserTestFixture() override { |
| 285 host_resolver()->AddRule("*", "127.0.0.1"); | 285 host_resolver()->AddRule("*", "127.0.0.1"); |
| 286 } | 286 } |
| 287 | 287 |
| 288 virtual void SetUpCommandLine(CommandLine* command_line) override { | 288 virtual void SetUpCommandLine(base::CommandLine* command_line) override { |
| 289 command_line->AppendSwitch(switches::kLoginManager); | 289 command_line->AppendSwitch(switches::kLoginManager); |
| 290 command_line->AppendSwitch(switches::kForceLoginManagerInTests); | 290 command_line->AppendSwitch(switches::kForceLoginManagerInTests); |
| 291 command_line->AppendSwitch(::switches::kDisableBackgroundNetworking); | 291 command_line->AppendSwitch(::switches::kDisableBackgroundNetworking); |
| 292 command_line->AppendSwitchASCII(switches::kLoginProfile, "user"); | 292 command_line->AppendSwitchASCII(switches::kLoginProfile, "user"); |
| 293 | 293 |
| 294 const GURL gaia_url = gaia_https_forwarder_->GetURL(""); | 294 const GURL gaia_url = gaia_https_forwarder_->GetURL(""); |
| 295 command_line->AppendSwitchASCII(::switches::kGaiaUrl, gaia_url.spec()); | 295 command_line->AppendSwitchASCII(::switches::kGaiaUrl, gaia_url.spec()); |
| 296 command_line->AppendSwitchASCII(::switches::kLsoUrl, gaia_url.spec()); | 296 command_line->AppendSwitchASCII(::switches::kLsoUrl, gaia_url.spec()); |
| 297 command_line->AppendSwitchASCII(::switches::kGoogleApisUrl, | 297 command_line->AppendSwitchASCII(::switches::kGoogleApisUrl, |
| 298 gaia_url.spec()); | 298 gaia_url.spec()); |
| (...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 657 } | 657 } |
| 658 | 658 |
| 659 class SAMLEnrollmentTest : public SamlTest, | 659 class SAMLEnrollmentTest : public SamlTest, |
| 660 public content::WebContentsObserver { | 660 public content::WebContentsObserver { |
| 661 public: | 661 public: |
| 662 SAMLEnrollmentTest(); | 662 SAMLEnrollmentTest(); |
| 663 ~SAMLEnrollmentTest() override; | 663 ~SAMLEnrollmentTest() override; |
| 664 | 664 |
| 665 // SamlTest: | 665 // SamlTest: |
| 666 void SetUp() override; | 666 void SetUp() override; |
| 667 void SetUpCommandLine(CommandLine* command_line) override; | 667 void SetUpCommandLine(base::CommandLine* command_line) override; |
| 668 void SetUpOnMainThread() override; | 668 void SetUpOnMainThread() override; |
| 669 void StartSamlAndWaitForIdpPageLoad(const std::string& gaia_email) override; | 669 void StartSamlAndWaitForIdpPageLoad(const std::string& gaia_email) override; |
| 670 | 670 |
| 671 // content::WebContentsObserver: | 671 // content::WebContentsObserver: |
| 672 void RenderFrameCreated(content::RenderFrameHost* render_frame_host) override; | 672 void RenderFrameCreated(content::RenderFrameHost* render_frame_host) override; |
| 673 void DidFinishLoad(content::RenderFrameHost* render_frame_host, | 673 void DidFinishLoad(content::RenderFrameHost* render_frame_host, |
| 674 const GURL& validated_url) override; | 674 const GURL& validated_url) override; |
| 675 | 675 |
| 676 void WaitForEnrollmentSuccess(); | 676 void WaitForEnrollmentSuccess(); |
| 677 | 677 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 698 temp_dir_.path().AppendASCII("policy.json"); | 698 temp_dir_.path().AppendASCII("policy.json"); |
| 699 ASSERT_EQ(static_cast<int>(strlen(kPolicy)), | 699 ASSERT_EQ(static_cast<int>(strlen(kPolicy)), |
| 700 base::WriteFile(policy_file, kPolicy, strlen(kPolicy))); | 700 base::WriteFile(policy_file, kPolicy, strlen(kPolicy))); |
| 701 | 701 |
| 702 test_server_.reset(new policy::LocalPolicyTestServer(policy_file)); | 702 test_server_.reset(new policy::LocalPolicyTestServer(policy_file)); |
| 703 ASSERT_TRUE(test_server_->Start()); | 703 ASSERT_TRUE(test_server_->Start()); |
| 704 | 704 |
| 705 SamlTest::SetUp(); | 705 SamlTest::SetUp(); |
| 706 } | 706 } |
| 707 | 707 |
| 708 void SAMLEnrollmentTest::SetUpCommandLine(CommandLine* command_line) { | 708 void SAMLEnrollmentTest::SetUpCommandLine(base::CommandLine* command_line) { |
| 709 command_line->AppendSwitchASCII(policy::switches::kDeviceManagementUrl, | 709 command_line->AppendSwitchASCII(policy::switches::kDeviceManagementUrl, |
| 710 test_server_->GetServiceURL().spec()); | 710 test_server_->GetServiceURL().spec()); |
| 711 command_line->AppendSwitch(policy::switches::kDisablePolicyKeyVerification); | 711 command_line->AppendSwitch(policy::switches::kDisablePolicyKeyVerification); |
| 712 command_line->AppendSwitch(switches::kEnterpriseEnrollmentSkipRobotAuth); | 712 command_line->AppendSwitch(switches::kEnterpriseEnrollmentSkipRobotAuth); |
| 713 | 713 |
| 714 SamlTest::SetUpCommandLine(command_line); | 714 SamlTest::SetUpCommandLine(command_line); |
| 715 } | 715 } |
| 716 | 716 |
| 717 void SAMLEnrollmentTest::SetUpOnMainThread() { | 717 void SAMLEnrollmentTest::SetUpOnMainThread() { |
| 718 Observe(GetLoginUI()->GetWebContents()); | 718 Observe(GetLoginUI()->GetWebContents()); |
| (...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1134 kTestAuthSIDCookie1, | 1134 kTestAuthSIDCookie1, |
| 1135 kTestAuthLSIDCookie1); | 1135 kTestAuthLSIDCookie1); |
| 1136 | 1136 |
| 1137 GetCookies(); | 1137 GetCookies(); |
| 1138 EXPECT_EQ(kTestAuthSIDCookie1, GetCookieValue(kGAIASIDCookieName)); | 1138 EXPECT_EQ(kTestAuthSIDCookie1, GetCookieValue(kGAIASIDCookieName)); |
| 1139 EXPECT_EQ(kTestAuthLSIDCookie1, GetCookieValue(kGAIALSIDCookieName)); | 1139 EXPECT_EQ(kTestAuthLSIDCookie1, GetCookieValue(kGAIALSIDCookieName)); |
| 1140 EXPECT_EQ(kSAMLIdPCookieValue1, GetCookieValue(kSAMLIdPCookieName)); | 1140 EXPECT_EQ(kSAMLIdPCookieValue1, GetCookieValue(kSAMLIdPCookieName)); |
| 1141 } | 1141 } |
| 1142 | 1142 |
| 1143 } // namespace chromeos | 1143 } // namespace chromeos |
| OLD | NEW |