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 16 matching lines...) Expand all Loading... |
27 #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" | 27 #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" |
28 #include "chrome/test/base/ui_test_utils.h" | 28 #include "chrome/test/base/ui_test_utils.h" |
29 #include "chromeos/login/auth/key.h" | 29 #include "chromeos/login/auth/key.h" |
30 #include "chromeos/login/auth/user_context.h" | 30 #include "chromeos/login/auth/user_context.h" |
31 #include "components/signin/core/browser/profile_oauth2_token_service.h" | 31 #include "components/signin/core/browser/profile_oauth2_token_service.h" |
32 #include "components/user_manager/user.h" | 32 #include "components/user_manager/user.h" |
33 #include "components/user_manager/user_manager.h" | 33 #include "components/user_manager/user_manager.h" |
34 #include "content/public/browser/notification_service.h" | 34 #include "content/public/browser/notification_service.h" |
35 #include "content/public/test/browser_test_utils.h" | 35 #include "content/public/test/browser_test_utils.h" |
36 #include "extensions/browser/process_manager.h" | 36 #include "extensions/browser/process_manager.h" |
| 37 #include "extensions/test/result_catcher.h" |
37 #include "google_apis/gaia/gaia_constants.h" | 38 #include "google_apis/gaia/gaia_constants.h" |
38 #include "google_apis/gaia/gaia_urls.h" | 39 #include "google_apis/gaia/gaia_urls.h" |
39 #include "net/cookies/canonical_cookie.h" | 40 #include "net/cookies/canonical_cookie.h" |
40 #include "net/cookies/cookie_monster.h" | 41 #include "net/cookies/cookie_monster.h" |
41 #include "net/cookies/cookie_store.h" | 42 #include "net/cookies/cookie_store.h" |
42 #include "net/test/embedded_test_server/http_request.h" | 43 #include "net/test/embedded_test_server/http_request.h" |
43 #include "net/test/embedded_test_server/http_response.h" | 44 #include "net/test/embedded_test_server/http_response.h" |
44 #include "net/url_request/url_request_context.h" | 45 #include "net/url_request/url_request_context.h" |
45 #include "net/url_request/url_request_context_getter.h" | 46 #include "net/url_request/url_request_context_getter.h" |
46 | 47 |
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
738 | 739 |
739 // Wait until we get send merge session request. | 740 // Wait until we get send merge session request. |
740 WaitForMergeSessionToStart(); | 741 WaitForMergeSessionToStart(); |
741 | 742 |
742 // Reset ExtensionBrowserTest::observer_ to the right browser object. | 743 // Reset ExtensionBrowserTest::observer_ to the right browser object. |
743 Browser* browser = FindOrCreateVisibleBrowser(profile()); | 744 Browser* browser = FindOrCreateVisibleBrowser(profile()); |
744 observer_.reset(new ExtensionTestNotificationObserver(browser)); | 745 observer_.reset(new ExtensionTestNotificationObserver(browser)); |
745 | 746 |
746 // Run background page tests. The tests will just wait for XHR request | 747 // Run background page tests. The tests will just wait for XHR request |
747 // to complete. | 748 // to complete. |
748 ResultCatcher catcher; | 749 extensions::ResultCatcher catcher; |
749 | 750 |
750 scoped_ptr<ExtensionTestMessageListener> non_google_xhr_listener( | 751 scoped_ptr<ExtensionTestMessageListener> non_google_xhr_listener( |
751 new ExtensionTestMessageListener("non-google-xhr-received", false)); | 752 new ExtensionTestMessageListener("non-google-xhr-received", false)); |
752 | 753 |
753 // Load extension with a background page. The background page will | 754 // Load extension with a background page. The background page will |
754 // attempt to load |fake_google_page_url_| via XHR. | 755 // attempt to load |fake_google_page_url_| via XHR. |
755 const extensions::Extension* ext = LoadExtension( | 756 const extensions::Extension* ext = LoadExtension( |
756 test_data_dir_.AppendASCII("merge_session")); | 757 test_data_dir_.AppendASCII("merge_session")); |
757 ASSERT_TRUE(ext); | 758 ASSERT_TRUE(ext); |
758 | 759 |
(...skipping 22 matching lines...) Expand all Loading... |
781 | 782 |
782 if (!catcher.GetNextResult()) { | 783 if (!catcher.GetNextResult()) { |
783 std::string message = catcher.message(); | 784 std::string message = catcher.message(); |
784 ADD_FAILURE() << "Tests failed: " << message; | 785 ADD_FAILURE() << "Tests failed: " << message; |
785 } | 786 } |
786 | 787 |
787 EXPECT_TRUE(fake_google_.IsPageRequested()); | 788 EXPECT_TRUE(fake_google_.IsPageRequested()); |
788 } | 789 } |
789 | 790 |
790 } // namespace chromeos | 791 } // namespace chromeos |
OLD | NEW |