| 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 #include <utility> | 6 #include <utility> |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 700 FakeGoogle fake_google_; | 700 FakeGoogle fake_google_; |
| 701 DelayedFakeGaia* delayed_fake_gaia_; | 701 DelayedFakeGaia* delayed_fake_gaia_; |
| 702 GURL fake_google_page_url_; | 702 GURL fake_google_page_url_; |
| 703 GURL non_google_page_url_; | 703 GURL non_google_page_url_; |
| 704 | 704 |
| 705 private: | 705 private: |
| 706 DISALLOW_COPY_AND_ASSIGN(MergeSessionTest); | 706 DISALLOW_COPY_AND_ASSIGN(MergeSessionTest); |
| 707 }; | 707 }; |
| 708 | 708 |
| 709 Browser* FindOrCreateVisibleBrowser(Profile* profile) { | 709 Browser* FindOrCreateVisibleBrowser(Profile* profile) { |
| 710 chrome::ScopedTabbedBrowserDisplayer displayer( | 710 chrome::ScopedTabbedBrowserDisplayer displayer(profile); |
| 711 profile, chrome::GetActiveDesktop()); | |
| 712 Browser* browser = displayer.browser(); | 711 Browser* browser = displayer.browser(); |
| 713 if (browser->tab_strip_model()->count() == 0) | 712 if (browser->tab_strip_model()->count() == 0) |
| 714 chrome::AddTabAt(browser, GURL(), -1, true); | 713 chrome::AddTabAt(browser, GURL(), -1, true); |
| 715 return browser; | 714 return browser; |
| 716 } | 715 } |
| 717 | 716 |
| 718 IN_PROC_BROWSER_TEST_F(MergeSessionTest, PageThrottle) { | 717 IN_PROC_BROWSER_TEST_F(MergeSessionTest, PageThrottle) { |
| 719 StartNewUserSession(false); | 718 StartNewUserSession(false); |
| 720 | 719 |
| 721 // Try to open a page from google.com. | 720 // Try to open a page from google.com. |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 806 | 805 |
| 807 if (!catcher.GetNextResult()) { | 806 if (!catcher.GetNextResult()) { |
| 808 std::string message = catcher.message(); | 807 std::string message = catcher.message(); |
| 809 ADD_FAILURE() << "Tests failed: " << message; | 808 ADD_FAILURE() << "Tests failed: " << message; |
| 810 } | 809 } |
| 811 | 810 |
| 812 EXPECT_TRUE(fake_google_.IsPageRequested()); | 811 EXPECT_TRUE(fake_google_.IsPageRequested()); |
| 813 } | 812 } |
| 814 | 813 |
| 815 } // namespace chromeos | 814 } // namespace chromeos |
| OLD | NEW |