| 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 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 void SetUpCommandLine(base::CommandLine* command_line) override { | 619 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"); | |
| 625 GURL::Replacements replace_google_host; | 624 GURL::Replacements replace_google_host; |
| 626 replace_google_host.SetHostStr(google_host); | 625 replace_google_host.SetHostStr("www.google.com"); |
| 627 GURL google_url = server_url.ReplaceComponents(replace_google_host); | 626 GURL google_url = server_url.ReplaceComponents(replace_google_host); |
| 628 fake_google_page_url_ = google_url.Resolve(kHelloPagePath); | 627 fake_google_page_url_ = google_url.Resolve(kHelloPagePath); |
| 629 | 628 |
| 630 std::string non_google_host("www.somethingelse.org"); | |
| 631 GURL::Replacements replace_non_google_host; | 629 GURL::Replacements replace_non_google_host; |
| 632 replace_non_google_host.SetHostStr(non_google_host); | 630 replace_non_google_host.SetHostStr("www.somethingelse.org"); |
| 633 GURL non_google_url = server_url.ReplaceComponents(replace_non_google_host); | 631 GURL non_google_url = server_url.ReplaceComponents(replace_non_google_host); |
| 634 non_google_page_url_ = non_google_url.Resolve(kRandomPagePath); | 632 non_google_page_url_ = non_google_url.Resolve(kRandomPagePath); |
| 635 } | 633 } |
| 636 | 634 |
| 637 void SetUp() override { | 635 void SetUp() override { |
| 638 embedded_test_server()->RegisterRequestHandler( | 636 embedded_test_server()->RegisterRequestHandler( |
| 639 base::Bind(&FakeGoogle::HandleRequest, | 637 base::Bind(&FakeGoogle::HandleRequest, |
| 640 base::Unretained(&fake_google_))); | 638 base::Unretained(&fake_google_))); |
| 641 OAuth2Test::SetUp(); | 639 OAuth2Test::SetUp(); |
| 642 } | 640 } |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 792 | 790 |
| 793 if (!catcher.GetNextResult()) { | 791 if (!catcher.GetNextResult()) { |
| 794 std::string message = catcher.message(); | 792 std::string message = catcher.message(); |
| 795 ADD_FAILURE() << "Tests failed: " << message; | 793 ADD_FAILURE() << "Tests failed: " << message; |
| 796 } | 794 } |
| 797 | 795 |
| 798 EXPECT_TRUE(fake_google_.IsPageRequested()); | 796 EXPECT_TRUE(fake_google_.IsPageRequested()); |
| 799 } | 797 } |
| 800 | 798 |
| 801 } // namespace chromeos | 799 } // namespace chromeos |
| OLD | NEW |