| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <deque> | 5 #include <deque> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 #include "chrome/browser/task_manager/task_manager.h" | 38 #include "chrome/browser/task_manager/task_manager.h" |
| 39 #include "chrome/browser/task_manager/task_manager_browsertest_util.h" | 39 #include "chrome/browser/task_manager/task_manager_browsertest_util.h" |
| 40 #include "chrome/browser/ui/browser.h" | 40 #include "chrome/browser/ui/browser.h" |
| 41 #include "chrome/browser/ui/browser_commands.h" | 41 #include "chrome/browser/ui/browser_commands.h" |
| 42 #include "chrome/browser/ui/browser_finder.h" | 42 #include "chrome/browser/ui/browser_finder.h" |
| 43 #include "chrome/browser/ui/browser_navigator.h" | 43 #include "chrome/browser/ui/browser_navigator.h" |
| 44 #include "chrome/browser/ui/browser_window.h" | 44 #include "chrome/browser/ui/browser_window.h" |
| 45 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 45 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 46 #include "chrome/common/chrome_paths.h" | 46 #include "chrome/common/chrome_paths.h" |
| 47 #include "chrome/common/chrome_switches.h" | 47 #include "chrome/common/chrome_switches.h" |
| 48 #include "chrome/common/extensions/extension_constants.h" | |
| 49 #include "chrome/common/pref_names.h" | 48 #include "chrome/common/pref_names.h" |
| 50 #include "chrome/test/base/in_process_browser_test.h" | 49 #include "chrome/test/base/in_process_browser_test.h" |
| 51 #include "chrome/test/base/test_switches.h" | 50 #include "chrome/test/base/test_switches.h" |
| 52 #include "chrome/test/base/ui_test_utils.h" | 51 #include "chrome/test/base/ui_test_utils.h" |
| 53 #include "content/public/browser/browser_message_filter.h" | 52 #include "content/public/browser/browser_message_filter.h" |
| 54 #include "content/public/browser/devtools_agent_host.h" | 53 #include "content/public/browser/devtools_agent_host.h" |
| 55 #include "content/public/browser/devtools_client_host.h" | 54 #include "content/public/browser/devtools_client_host.h" |
| 56 #include "content/public/browser/devtools_manager.h" | 55 #include "content/public/browser/devtools_manager.h" |
| 57 #include "content/public/browser/notification_service.h" | 56 #include "content/public/browser/notification_service.h" |
| 58 #include "content/public/browser/render_process_host.h" | 57 #include "content/public/browser/render_process_host.h" |
| 59 #include "content/public/browser/render_view_host.h" | 58 #include "content/public/browser/render_view_host.h" |
| 60 #include "content/public/browser/site_instance.h" | 59 #include "content/public/browser/site_instance.h" |
| 61 #include "content/public/browser/web_contents.h" | 60 #include "content/public/browser/web_contents.h" |
| 62 #include "content/public/common/url_constants.h" | 61 #include "content/public/common/url_constants.h" |
| 63 #include "content/public/test/browser_test_utils.h" | 62 #include "content/public/test/browser_test_utils.h" |
| 64 #include "content/public/test/test_navigation_observer.h" | 63 #include "content/public/test/test_navigation_observer.h" |
| 65 #include "content/public/test/test_utils.h" | 64 #include "content/public/test/test_utils.h" |
| 66 #include "content/test/net/url_request_mock_http_job.h" | 65 #include "content/test/net/url_request_mock_http_job.h" |
| 66 #include "extensions/common/extension_urls.h" |
| 67 #include "extensions/common/switches.h" | 67 #include "extensions/common/switches.h" |
| 68 #include "grit/generated_resources.h" | 68 #include "grit/generated_resources.h" |
| 69 #include "net/base/escape.h" | 69 #include "net/base/escape.h" |
| 70 #include "net/dns/mock_host_resolver.h" | 70 #include "net/dns/mock_host_resolver.h" |
| 71 #include "net/url_request/url_request_context.h" | 71 #include "net/url_request/url_request_context.h" |
| 72 #include "net/url_request/url_request_context_getter.h" | 72 #include "net/url_request/url_request_context_getter.h" |
| 73 #include "net/url_request/url_request_filter.h" | 73 #include "net/url_request/url_request_filter.h" |
| 74 #include "net/url_request/url_request_job.h" | 74 #include "net/url_request/url_request_job.h" |
| 75 #include "ui/base/l10n/l10n_util.h" | 75 #include "ui/base/l10n/l10n_util.h" |
| 76 #include "url/gurl.h" | 76 #include "url/gurl.h" |
| (...skipping 3084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3161 } | 3161 } |
| 3162 | 3162 |
| 3163 // Checks that prerenders are aborted on cross-process navigation from | 3163 // Checks that prerenders are aborted on cross-process navigation from |
| 3164 // a client redirect. | 3164 // a client redirect. |
| 3165 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, | 3165 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, |
| 3166 PrerenderCrossProcessClientRedirect) { | 3166 PrerenderCrossProcessClientRedirect) { |
| 3167 // Cross-process navigation logic for renderer-initiated navigations | 3167 // Cross-process navigation logic for renderer-initiated navigations |
| 3168 // is partially controlled by the renderer, namely | 3168 // is partially controlled by the renderer, namely |
| 3169 // ChromeContentRendererClient. This test instead relies on the Web | 3169 // ChromeContentRendererClient. This test instead relies on the Web |
| 3170 // Store triggering such navigations. | 3170 // Store triggering such navigations. |
| 3171 std::string webstore_url = extension_urls::GetWebstoreLaunchURL(); | 3171 std::string webstore_url = extensions::GetWebstoreLaunchURL(); |
| 3172 | 3172 |
| 3173 // Mock out requests to the Web Store. | 3173 // Mock out requests to the Web Store. |
| 3174 base::FilePath file(FILE_PATH_LITERAL( | 3174 base::FilePath file(FILE_PATH_LITERAL( |
| 3175 "chrome/test/data/prerender/prerender_page.html")); | 3175 "chrome/test/data/prerender/prerender_page.html")); |
| 3176 BrowserThread::PostTask( | 3176 BrowserThread::PostTask( |
| 3177 BrowserThread::IO, FROM_HERE, | 3177 BrowserThread::IO, FROM_HERE, |
| 3178 base::Bind(&CreateMockProtocolHandlerOnIO, | 3178 base::Bind(&CreateMockProtocolHandlerOnIO, |
| 3179 GURL(webstore_url), file)); | 3179 GURL(webstore_url), file)); |
| 3180 | 3180 |
| 3181 PrerenderTestURL(CreateClientRedirect(webstore_url), | 3181 PrerenderTestURL(CreateClientRedirect(webstore_url), |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3271 std::string post_data = "DATA"; | 3271 std::string post_data = "DATA"; |
| 3272 content::OpenURLParams params(dest_url(), Referrer(), CURRENT_TAB, | 3272 content::OpenURLParams params(dest_url(), Referrer(), CURRENT_TAB, |
| 3273 content::PAGE_TRANSITION_TYPED, false); | 3273 content::PAGE_TRANSITION_TYPED, false); |
| 3274 params.uses_post = true; | 3274 params.uses_post = true; |
| 3275 params.browser_initiated_post_data = | 3275 params.browser_initiated_post_data = |
| 3276 base::RefCountedString::TakeString(&post_data); | 3276 base::RefCountedString::TakeString(&post_data); |
| 3277 NavigateToURLWithParams(params, false); | 3277 NavigateToURLWithParams(params, false); |
| 3278 } | 3278 } |
| 3279 | 3279 |
| 3280 } // namespace prerender | 3280 } // namespace prerender |
| OLD | NEW |