| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <deque> | 6 #include <deque> |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <unordered_map> | 9 #include <unordered_map> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 2880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2891 } | 2891 } |
| 2892 | 2892 |
| 2893 // Checks that prerenders are aborted on cross-process navigation from | 2893 // Checks that prerenders are aborted on cross-process navigation from |
| 2894 // a client redirect. | 2894 // a client redirect. |
| 2895 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, | 2895 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, |
| 2896 PrerenderCrossProcessClientRedirect) { | 2896 PrerenderCrossProcessClientRedirect) { |
| 2897 // Cross-process navigation logic for renderer-initiated navigations | 2897 // Cross-process navigation logic for renderer-initiated navigations |
| 2898 // is partially controlled by the renderer, namely | 2898 // is partially controlled by the renderer, namely |
| 2899 // ChromeContentRendererClient. This test instead relies on the Web | 2899 // ChromeContentRendererClient. This test instead relies on the Web |
| 2900 // Store triggering such navigations. | 2900 // Store triggering such navigations. |
| 2901 std::string webstore_url = extension_urls::GetWebstoreLaunchURL(); | 2901 GURL webstore_url = extension_urls::GetWebstoreLaunchURL(); |
| 2902 | 2902 |
| 2903 // Mock out requests to the Web Store. | 2903 // Mock out requests to the Web Store. |
| 2904 base::FilePath file(GetTestPath("prerender_page.html")); | 2904 base::FilePath file(GetTestPath("prerender_page.html")); |
| 2905 BrowserThread::PostTask( | 2905 BrowserThread::PostTask( |
| 2906 BrowserThread::IO, FROM_HERE, | 2906 BrowserThread::IO, FROM_HERE, |
| 2907 base::Bind(&CreateMockInterceptorOnIO, GURL(webstore_url), file)); | 2907 base::Bind(&CreateMockInterceptorOnIO, webstore_url, file)); |
| 2908 | 2908 |
| 2909 PrerenderTestURL(CreateClientRedirect(webstore_url), | 2909 PrerenderTestURL(CreateClientRedirect(webstore_url.spec()), |
| 2910 FINAL_STATUS_OPEN_URL, 1); | 2910 FINAL_STATUS_OPEN_URL, 1); |
| 2911 } | 2911 } |
| 2912 | 2912 |
| 2913 // Checks that a deferred redirect to an image is not loaded until the page is | 2913 // Checks that a deferred redirect to an image is not loaded until the page is |
| 2914 // visible. Also test the right histogram events are emitted in this case. | 2914 // visible. Also test the right histogram events are emitted in this case. |
| 2915 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderDeferredImage) { | 2915 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderDeferredImage) { |
| 2916 DisableJavascriptCalls(); | 2916 DisableJavascriptCalls(); |
| 2917 | 2917 |
| 2918 // The prerender will not completely load until after the swap, so wait for a | 2918 // The prerender will not completely load until after the swap, so wait for a |
| 2919 // title change before calling DidPrerenderPass. | 2919 // title change before calling DidPrerenderPass. |
| (...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3346 browser()->tab_strip_model()->GetActiveWebContents(); | 3346 browser()->tab_strip_model()->GetActiveWebContents(); |
| 3347 bool display_test_result = false; | 3347 bool display_test_result = false; |
| 3348 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(web_contents, | 3348 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(web_contents, |
| 3349 "DidDisplayReallyPass()", | 3349 "DidDisplayReallyPass()", |
| 3350 &display_test_result)); | 3350 &display_test_result)); |
| 3351 ASSERT_TRUE(display_test_result); | 3351 ASSERT_TRUE(display_test_result); |
| 3352 } | 3352 } |
| 3353 #endif // !defined(DISABLE_NACL) | 3353 #endif // !defined(DISABLE_NACL) |
| 3354 | 3354 |
| 3355 } // namespace prerender | 3355 } // namespace prerender |
| OLD | NEW |