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" |
11 #include "base/synchronization/waitable_event.h" | 11 #include "base/synchronization/waitable_event.h" |
12 #include "chrome/browser/browser_process.h" | 12 #include "chrome/browser/browser_process.h" |
13 #include "chrome/browser/chrome_notification_types.h" | 13 #include "chrome/browser/chrome_notification_types.h" |
14 #include "chrome/browser/chromeos/login/signin/oauth2_login_manager.h" | 14 #include "chrome/browser/chromeos/login/signin/oauth2_login_manager.h" |
15 #include "chrome/browser/chromeos/login/signin/oauth2_login_manager_factory.h" | 15 #include "chrome/browser/chromeos/login/signin/oauth2_login_manager_factory.h" |
16 #include "chrome/browser/chromeos/login/signin_specifics.h" | 16 #include "chrome/browser/chromeos/login/signin_specifics.h" |
17 #include "chrome/browser/chromeos/login/startup_utils.h" | 17 #include "chrome/browser/chromeos/login/startup_utils.h" |
18 #include "chrome/browser/chromeos/login/test/oobe_base_test.h" | 18 #include "chrome/browser/chromeos/login/test/oobe_base_test.h" |
19 #include "chrome/browser/chromeos/login/wizard_controller.h" | 19 #include "chrome/browser/chromeos/login/wizard_controller.h" |
| 20 #include "chrome/browser/extensions/chrome_extension_test_notification_observer.
h" |
20 #include "chrome/browser/profiles/profile_manager.h" | 21 #include "chrome/browser/profiles/profile_manager.h" |
21 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" | 22 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" |
22 #include "chrome/browser/ui/browser.h" | 23 #include "chrome/browser/ui/browser.h" |
23 #include "chrome/browser/ui/browser_tabstrip.h" | 24 #include "chrome/browser/ui/browser_tabstrip.h" |
24 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" | 25 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" |
25 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 26 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
26 #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" | 27 #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" |
27 #include "chrome/common/chrome_switches.h" | 28 #include "chrome/common/chrome_switches.h" |
28 #include "chrome/test/base/ui_test_utils.h" | 29 #include "chrome/test/base/ui_test_utils.h" |
29 #include "chromeos/login/auth/key.h" | 30 #include "chromeos/login/auth/key.h" |
(...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
758 } | 759 } |
759 | 760 |
760 IN_PROC_BROWSER_TEST_F(MergeSessionTest, XHRThrottle) { | 761 IN_PROC_BROWSER_TEST_F(MergeSessionTest, XHRThrottle) { |
761 StartNewUserSession(false); | 762 StartNewUserSession(false); |
762 | 763 |
763 // Wait until we get send merge session request. | 764 // Wait until we get send merge session request. |
764 WaitForMergeSessionToStart(); | 765 WaitForMergeSessionToStart(); |
765 | 766 |
766 // Reset ExtensionBrowserTest::observer_ to the right browser object. | 767 // Reset ExtensionBrowserTest::observer_ to the right browser object. |
767 Browser* browser = FindOrCreateVisibleBrowser(profile()); | 768 Browser* browser = FindOrCreateVisibleBrowser(profile()); |
768 observer_.reset(new ExtensionTestNotificationObserver(browser)); | 769 observer_.reset(new ChromeExtensionTestNotificationObserver(browser)); |
769 | 770 |
770 // Run background page tests. The tests will just wait for XHR request | 771 // Run background page tests. The tests will just wait for XHR request |
771 // to complete. | 772 // to complete. |
772 extensions::ResultCatcher catcher; | 773 extensions::ResultCatcher catcher; |
773 | 774 |
774 std::unique_ptr<ExtensionTestMessageListener> non_google_xhr_listener( | 775 std::unique_ptr<ExtensionTestMessageListener> non_google_xhr_listener( |
775 new ExtensionTestMessageListener("non-google-xhr-received", false)); | 776 new ExtensionTestMessageListener("non-google-xhr-received", false)); |
776 | 777 |
777 // Load extension with a background page. The background page will | 778 // Load extension with a background page. The background page will |
778 // attempt to load |fake_google_page_url_| via XHR. | 779 // attempt to load |fake_google_page_url_| via XHR. |
(...skipping 26 matching lines...) Expand all Loading... |
805 | 806 |
806 if (!catcher.GetNextResult()) { | 807 if (!catcher.GetNextResult()) { |
807 std::string message = catcher.message(); | 808 std::string message = catcher.message(); |
808 ADD_FAILURE() << "Tests failed: " << message; | 809 ADD_FAILURE() << "Tests failed: " << message; |
809 } | 810 } |
810 | 811 |
811 EXPECT_TRUE(fake_google_.IsPageRequested()); | 812 EXPECT_TRUE(fake_google_.IsPageRequested()); |
812 } | 813 } |
813 | 814 |
814 } // namespace chromeos | 815 } // namespace chromeos |
OLD | NEW |