| 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 704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 715 return browser; | 715 return browser; |
| 716 } | 716 } |
| 717 | 717 |
| 718 IN_PROC_BROWSER_TEST_F(MergeSessionTest, PageThrottle) { | 718 IN_PROC_BROWSER_TEST_F(MergeSessionTest, PageThrottle) { |
| 719 StartNewUserSession(false); | 719 StartNewUserSession(false); |
| 720 | 720 |
| 721 // Try to open a page from google.com. | 721 // Try to open a page from google.com. |
| 722 Browser* browser = | 722 Browser* browser = |
| 723 FindOrCreateVisibleBrowser(profile()); | 723 FindOrCreateVisibleBrowser(profile()); |
| 724 ui_test_utils::NavigateToURLWithDisposition( | 724 ui_test_utils::NavigateToURLWithDisposition( |
| 725 browser, | 725 browser, fake_google_page_url_, WindowOpenDisposition::CURRENT_TAB, |
| 726 fake_google_page_url_, | 726 ui_test_utils::BROWSER_TEST_NONE); |
| 727 CURRENT_TAB, ui_test_utils::BROWSER_TEST_NONE); | |
| 728 | 727 |
| 729 // Wait until we get send merge session request. | 728 // Wait until we get send merge session request. |
| 730 WaitForMergeSessionToStart(); | 729 WaitForMergeSessionToStart(); |
| 731 | 730 |
| 732 // Make sure the page is blocked by the throttle. | 731 // Make sure the page is blocked by the throttle. |
| 733 EXPECT_FALSE(fake_google_.IsPageRequested()); | 732 EXPECT_FALSE(fake_google_.IsPageRequested()); |
| 734 | 733 |
| 735 // Check that throttle page is displayed instead. | 734 // Check that throttle page is displayed instead. |
| 736 base::string16 title; | 735 base::string16 title; |
| 737 ui_test_utils::GetCurrentTabTitle(browser, &title); | 736 ui_test_utils::GetCurrentTabTitle(browser, &title); |
| (...skipping 68 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 |