Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(216)

Side by Side Diff: chrome/browser/prerender/prerender_browsertest.cc

Issue 2506713002: Avoid parsing the webstore base url so much. (Closed)
Patch Set: rdevlin review Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 2940 matching lines...) Expand 10 before | Expand all | Expand 10 after
2951 } 2951 }
2952 2952
2953 // Checks that prerenders are aborted on cross-process navigation from 2953 // Checks that prerenders are aborted on cross-process navigation from
2954 // a client redirect. 2954 // a client redirect.
2955 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, 2955 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
2956 PrerenderCrossProcessClientRedirect) { 2956 PrerenderCrossProcessClientRedirect) {
2957 // Cross-process navigation logic for renderer-initiated navigations 2957 // Cross-process navigation logic for renderer-initiated navigations
2958 // is partially controlled by the renderer, namely 2958 // is partially controlled by the renderer, namely
2959 // ChromeContentRendererClient. This test instead relies on the Web 2959 // ChromeContentRendererClient. This test instead relies on the Web
2960 // Store triggering such navigations. 2960 // Store triggering such navigations.
2961 std::string webstore_url = extension_urls::GetWebstoreLaunchURL(); 2961 GURL webstore_url = extension_urls::GetWebstoreLaunchURL();
2962 2962
2963 // Mock out requests to the Web Store. 2963 // Mock out requests to the Web Store.
2964 base::FilePath file(GetTestPath("prerender_page.html")); 2964 base::FilePath file(GetTestPath("prerender_page.html"));
2965 BrowserThread::PostTask( 2965 BrowserThread::PostTask(
2966 BrowserThread::IO, FROM_HERE, 2966 BrowserThread::IO, FROM_HERE,
2967 base::Bind(&CreateMockInterceptorOnIO, GURL(webstore_url), file)); 2967 base::Bind(&CreateMockInterceptorOnIO, webstore_url, file));
2968 2968
2969 PrerenderTestURL(CreateClientRedirect(webstore_url), 2969 PrerenderTestURL(CreateClientRedirect(webstore_url.spec()),
2970 FINAL_STATUS_OPEN_URL, 1); 2970 FINAL_STATUS_OPEN_URL, 1);
2971 } 2971 }
2972 2972
2973 // Checks that a deferred redirect to an image is not loaded until the page is 2973 // Checks that a deferred redirect to an image is not loaded until the page is
2974 // visible. Also test the right histogram events are emitted in this case. 2974 // visible. Also test the right histogram events are emitted in this case.
2975 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderDeferredImage) { 2975 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderDeferredImage) {
2976 DisableJavascriptCalls(); 2976 DisableJavascriptCalls();
2977 2977
2978 // The prerender will not completely load until after the swap, so wait for a 2978 // The prerender will not completely load until after the swap, so wait for a
2979 // title change before calling DidPrerenderPass. 2979 // title change before calling DidPrerenderPass.
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
3406 browser()->tab_strip_model()->GetActiveWebContents(); 3406 browser()->tab_strip_model()->GetActiveWebContents();
3407 bool display_test_result = false; 3407 bool display_test_result = false;
3408 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(web_contents, 3408 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(web_contents,
3409 "DidDisplayReallyPass()", 3409 "DidDisplayReallyPass()",
3410 &display_test_result)); 3410 &display_test_result));
3411 ASSERT_TRUE(display_test_result); 3411 ASSERT_TRUE(display_test_result);
3412 } 3412 }
3413 #endif // !defined(DISABLE_NACL) 3413 #endif // !defined(DISABLE_NACL)
3414 3414
3415 } // namespace prerender 3415 } // namespace prerender
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698