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

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

Issue 2527363002: Delete obsolete prerender experiment code (Closed)
Patch Set: Fix android compilation Created 4 years 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 2552 matching lines...) Expand 10 before | Expand all | Expand 10 after
2563 // Validate that the sessionStorage namespace remains the same when swapping 2563 // Validate that the sessionStorage namespace remains the same when swapping
2564 // in a prerendered page. 2564 // in a prerendered page.
2565 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderSessionStorage) { 2565 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderSessionStorage) {
2566 set_loader_path("/prerender/prerender_loader_with_session_storage.html"); 2566 set_loader_path("/prerender/prerender_loader_with_session_storage.html");
2567 PrerenderTestURL(GetCrossDomainTestUrl("prerender/prerender_page.html"), 2567 PrerenderTestURL(GetCrossDomainTestUrl("prerender/prerender_page.html"),
2568 FINAL_STATUS_USED, 1); 2568 FINAL_STATUS_USED, 1);
2569 NavigateToDestURL(); 2569 NavigateToDestURL();
2570 GoBackToPageBeforePrerender(); 2570 GoBackToPageBeforePrerender();
2571 } 2571 }
2572 2572
2573 // Checks that the control group works. An XHR PUT cannot be detected in the
2574 // control group.
2575 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, ControlGroup) {
2576 RestorePrerenderMode restore_prerender_mode;
2577 PrerenderManager::SetMode(
2578 PrerenderManager::PRERENDER_MODE_EXPERIMENT_CONTROL_GROUP);
2579 DisableJavascriptCalls();
2580 PrerenderTestURL("/prerender/prerender_xhr_put.html",
2581 FINAL_STATUS_WOULD_HAVE_BEEN_USED, 0);
2582 NavigateToDestURL();
2583 }
2584
2585 // Checks that the control group correctly hits WOULD_HAVE_BEEN_USED
2586 // renderer-initiated navigations. (This verifies that the ShouldFork logic
2587 // behaves correctly.)
2588 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, ControlGroupRendererInitiated) {
2589 RestorePrerenderMode restore_prerender_mode;
2590 PrerenderManager::SetMode(
2591 PrerenderManager::PRERENDER_MODE_EXPERIMENT_CONTROL_GROUP);
2592 DisableJavascriptCalls();
2593 PrerenderTestURL("/prerender/prerender_xhr_put.html",
2594 FINAL_STATUS_WOULD_HAVE_BEEN_USED, 0);
2595 OpenDestURLViaClick();
2596 }
2597
2598 // Checks that the referrer policy is used when prerendering. 2573 // Checks that the referrer policy is used when prerendering.
2599 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderReferrerPolicy) { 2574 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderReferrerPolicy) {
2600 set_loader_path("/prerender/prerender_loader_with_referrer_policy.html"); 2575 set_loader_path("/prerender/prerender_loader_with_referrer_policy.html");
2601 PrerenderTestURL("/prerender/prerender_referrer_policy.html", 2576 PrerenderTestURL("/prerender/prerender_referrer_policy.html",
2602 FINAL_STATUS_USED, 1); 2577 FINAL_STATUS_USED, 1);
2603 NavigateToDestURL(); 2578 NavigateToDestURL();
2604 } 2579 }
2605 2580
2606 // Checks that the referrer policy is used when prerendering on HTTPS. 2581 // Checks that the referrer policy is used when prerendering on HTTPS.
2607 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, 2582 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after
3347 browser()->tab_strip_model()->GetActiveWebContents(); 3322 browser()->tab_strip_model()->GetActiveWebContents();
3348 bool display_test_result = false; 3323 bool display_test_result = false;
3349 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(web_contents, 3324 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(web_contents,
3350 "DidDisplayReallyPass()", 3325 "DidDisplayReallyPass()",
3351 &display_test_result)); 3326 &display_test_result));
3352 ASSERT_TRUE(display_test_result); 3327 ASSERT_TRUE(display_test_result);
3353 } 3328 }
3354 #endif // !defined(DISABLE_NACL) 3329 #endif // !defined(DISABLE_NACL)
3355 3330
3356 } // namespace prerender 3331 } // namespace prerender
OLDNEW
« no previous file with comments | « chrome/browser/android/offline_pages/prerender_adapter.cc ('k') | chrome/browser/prerender/prerender_contents.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698