| 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 748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 759 } | 759 } |
| 760 | 760 |
| 761 IN_PROC_BROWSER_TEST_F(MergeSessionTest, XHRThrottle) { | 761 IN_PROC_BROWSER_TEST_F(MergeSessionTest, XHRThrottle) { |
| 762 StartNewUserSession(false); | 762 StartNewUserSession(false); |
| 763 | 763 |
| 764 // Wait until we get send merge session request. | 764 // Wait until we get send merge session request. |
| 765 WaitForMergeSessionToStart(); | 765 WaitForMergeSessionToStart(); |
| 766 | 766 |
| 767 // Reset ExtensionBrowserTest::observer_ to the right browser object. | 767 // Reset ExtensionBrowserTest::observer_ to the right browser object. |
| 768 Browser* browser = FindOrCreateVisibleBrowser(profile()); | 768 Browser* browser = FindOrCreateVisibleBrowser(profile()); |
| 769 observer_.reset(new ChromeExtensionTestNotificationObserver(browser)); | 769 observer_.reset( |
| 770 new extensions::ChromeExtensionTestNotificationObserver(browser)); |
| 770 | 771 |
| 771 // Run background page tests. The tests will just wait for XHR request | 772 // Run background page tests. The tests will just wait for XHR request |
| 772 // to complete. | 773 // to complete. |
| 773 extensions::ResultCatcher catcher; | 774 extensions::ResultCatcher catcher; |
| 774 | 775 |
| 775 std::unique_ptr<ExtensionTestMessageListener> non_google_xhr_listener( | 776 std::unique_ptr<ExtensionTestMessageListener> non_google_xhr_listener( |
| 776 new ExtensionTestMessageListener("non-google-xhr-received", false)); | 777 new ExtensionTestMessageListener("non-google-xhr-received", false)); |
| 777 | 778 |
| 778 // Load extension with a background page. The background page will | 779 // Load extension with a background page. The background page will |
| 779 // attempt to load |fake_google_page_url_| via XHR. | 780 // attempt to load |fake_google_page_url_| via XHR. |
| (...skipping 26 matching lines...) Expand all Loading... |
| 806 | 807 |
| 807 if (!catcher.GetNextResult()) { | 808 if (!catcher.GetNextResult()) { |
| 808 std::string message = catcher.message(); | 809 std::string message = catcher.message(); |
| 809 ADD_FAILURE() << "Tests failed: " << message; | 810 ADD_FAILURE() << "Tests failed: " << message; |
| 810 } | 811 } |
| 811 | 812 |
| 812 EXPECT_TRUE(fake_google_.IsPageRequested()); | 813 EXPECT_TRUE(fake_google_.IsPageRequested()); |
| 813 } | 814 } |
| 814 | 815 |
| 815 } // namespace chromeos | 816 } // namespace chromeos |
| OLD | NEW |