| 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "base/synchronization/waitable_event.h" | 10 #include "base/synchronization/waitable_event.h" |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 | 127 |
| 128 DISALLOW_COPY_AND_ASSIGN(OAuth2LoginManagerStateWaiter); | 128 DISALLOW_COPY_AND_ASSIGN(OAuth2LoginManagerStateWaiter); |
| 129 }; | 129 }; |
| 130 | 130 |
| 131 } // namespace | 131 } // namespace |
| 132 | 132 |
| 133 class OAuth2Test : public OobeBaseTest { | 133 class OAuth2Test : public OobeBaseTest { |
| 134 protected: | 134 protected: |
| 135 OAuth2Test() {} | 135 OAuth2Test() {} |
| 136 | 136 |
| 137 virtual void SetUpCommandLine(CommandLine* command_line) override { | 137 virtual void SetUpCommandLine(base::CommandLine* command_line) override { |
| 138 OobeBaseTest::SetUpCommandLine(command_line); | 138 OobeBaseTest::SetUpCommandLine(command_line); |
| 139 | 139 |
| 140 // Disable sync sinc we don't really need this for these tests and it also | 140 // Disable sync sinc we don't really need this for these tests and it also |
| 141 // makes OAuth2Test.MergeSession test flaky http://crbug.com/408867. | 141 // makes OAuth2Test.MergeSession test flaky http://crbug.com/408867. |
| 142 command_line->AppendSwitch(switches::kDisableSync); | 142 command_line->AppendSwitch(switches::kDisableSync); |
| 143 } | 143 } |
| 144 | 144 |
| 145 void SetupGaiaServerForNewAccount() { | 145 void SetupGaiaServerForNewAccount() { |
| 146 FakeGaia::MergeSessionParams params; | 146 FakeGaia::MergeSessionParams params; |
| 147 params.auth_sid_cookie = kTestAuthSIDCookie; | 147 params.auth_sid_cookie = kTestAuthSIDCookie; |
| (...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 609 | 609 |
| 610 DISALLOW_COPY_AND_ASSIGN(DelayedFakeGaia); | 610 DISALLOW_COPY_AND_ASSIGN(DelayedFakeGaia); |
| 611 }; | 611 }; |
| 612 | 612 |
| 613 class MergeSessionTest : public OAuth2Test { | 613 class MergeSessionTest : public OAuth2Test { |
| 614 protected: | 614 protected: |
| 615 MergeSessionTest() : delayed_fake_gaia_(new DelayedFakeGaia()) { | 615 MergeSessionTest() : delayed_fake_gaia_(new DelayedFakeGaia()) { |
| 616 fake_gaia_.reset(delayed_fake_gaia_); | 616 fake_gaia_.reset(delayed_fake_gaia_); |
| 617 } | 617 } |
| 618 | 618 |
| 619 virtual void SetUpCommandLine(CommandLine* command_line) override { | 619 virtual void SetUpCommandLine(base::CommandLine* command_line) override { |
| 620 OAuth2Test::SetUpCommandLine(command_line); | 620 OAuth2Test::SetUpCommandLine(command_line); |
| 621 | 621 |
| 622 // Get fake URL for fake google.com. | 622 // Get fake URL for fake google.com. |
| 623 const GURL& server_url = embedded_test_server()->base_url(); | 623 const GURL& server_url = embedded_test_server()->base_url(); |
| 624 std::string google_host("www.google.com"); | 624 std::string google_host("www.google.com"); |
| 625 GURL::Replacements replace_google_host; | 625 GURL::Replacements replace_google_host; |
| 626 replace_google_host.SetHostStr(google_host); | 626 replace_google_host.SetHostStr(google_host); |
| 627 GURL google_url = server_url.ReplaceComponents(replace_google_host); | 627 GURL google_url = server_url.ReplaceComponents(replace_google_host); |
| 628 fake_google_page_url_ = google_url.Resolve(kHelloPagePath); | 628 fake_google_page_url_ = google_url.Resolve(kHelloPagePath); |
| 629 | 629 |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 792 | 792 |
| 793 if (!catcher.GetNextResult()) { | 793 if (!catcher.GetNextResult()) { |
| 794 std::string message = catcher.message(); | 794 std::string message = catcher.message(); |
| 795 ADD_FAILURE() << "Tests failed: " << message; | 795 ADD_FAILURE() << "Tests failed: " << message; |
| 796 } | 796 } |
| 797 | 797 |
| 798 EXPECT_TRUE(fake_google_.IsPageRequested()); | 798 EXPECT_TRUE(fake_google_.IsPageRequested()); |
| 799 } | 799 } |
| 800 | 800 |
| 801 } // namespace chromeos | 801 } // namespace chromeos |
| OLD | NEW |