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

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

Issue 2537503002: [Prerender] Get the prerender mode from Finch field trial. (Closed)
Patch Set: cleanup 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 556 matching lines...) Expand 10 before | Expand all | Expand 10 after
567 567
568 std::vector<std::unique_ptr<TestPrerender>> PrerenderTestURL( 568 std::vector<std::unique_ptr<TestPrerender>> PrerenderTestURL(
569 const std::string& html_file, 569 const std::string& html_file,
570 const std::vector<FinalStatus>& expected_final_status_queue, 570 const std::vector<FinalStatus>& expected_final_status_queue,
571 int expected_number_of_loads) { 571 int expected_number_of_loads) {
572 GURL url = src_server()->GetURL(MakeAbsolute(html_file)); 572 GURL url = src_server()->GetURL(MakeAbsolute(html_file));
573 return PrerenderTestURLImpl(url, expected_final_status_queue, 573 return PrerenderTestURLImpl(url, expected_final_status_queue,
574 expected_number_of_loads); 574 expected_number_of_loads);
575 } 575 }
576 576
577 void SetUpCommandLine(base::CommandLine* command_line) override { 577 void SetUpOnMainThread() override {
578 PrerenderInProcessBrowserTest::SetUpCommandLine(command_line); 578 test_utils::PrerenderInProcessBrowserTest::SetUpOnMainThread();
579 command_line->AppendSwitchASCII(switches::kPrerenderMode, 579 prerender::PrerenderManager::SetMode(
580 switches::kPrerenderModeSwitchValueEnabled); 580 prerender::PrerenderManager::PRERENDER_MODE_ENABLED);
581 } 581 }
582 582
583 void SetUpInProcessBrowserTestFixture() override { 583 void SetUpInProcessBrowserTestFixture() override {
584 test_utils::PrerenderInProcessBrowserTest:: 584 test_utils::PrerenderInProcessBrowserTest::
585 SetUpInProcessBrowserTestFixture(); 585 SetUpInProcessBrowserTestFixture();
586 586
587 // Although PreferHtmlOverPlugins is redundant with the Field Trial testing 587 // Although PreferHtmlOverPlugins is redundant with the Field Trial testing
588 // configuration, the official builders don't use those, so enable it here. 588 // configuration, the official builders don't use those, so enable it here.
589 feature_list_.InitAndEnableFeature(features::kPreferHtmlOverPlugins); 589 feature_list_.InitAndEnableFeature(features::kPreferHtmlOverPlugins);
590 } 590 }
(...skipping 2027 matching lines...) Expand 10 before | Expand all | Expand 10 after
2618 public: 2618 public:
2619 PrerenderBrowserTestWithExtensions() { 2619 PrerenderBrowserTestWithExtensions() {
2620 // The individual tests start the test server through ExtensionApiTest, so 2620 // The individual tests start the test server through ExtensionApiTest, so
2621 // the port number can be passed through to the extension. 2621 // the port number can be passed through to the extension.
2622 set_autostart_test_server(false); 2622 set_autostart_test_server(false);
2623 } 2623 }
2624 2624
2625 void SetUp() override { PrerenderBrowserTest::SetUp(); } 2625 void SetUp() override { PrerenderBrowserTest::SetUp(); }
2626 2626
2627 void SetUpCommandLine(base::CommandLine* command_line) override { 2627 void SetUpCommandLine(base::CommandLine* command_line) override {
2628 PrerenderBrowserTest::SetUpCommandLine(command_line);
2629 ExtensionApiTest::SetUpCommandLine(command_line); 2628 ExtensionApiTest::SetUpCommandLine(command_line);
2630 } 2629 }
2631 2630
2632 void SetUpInProcessBrowserTestFixture() override { 2631 void SetUpInProcessBrowserTestFixture() override {
2633 PrerenderBrowserTest::SetUpInProcessBrowserTestFixture(); 2632 PrerenderBrowserTest::SetUpInProcessBrowserTestFixture();
2634 ExtensionApiTest::SetUpInProcessBrowserTestFixture(); 2633 ExtensionApiTest::SetUpInProcessBrowserTestFixture();
2635 } 2634 }
2636 2635
2637 void TearDownInProcessBrowserTestFixture() override { 2636 void TearDownInProcessBrowserTestFixture() override {
2638 PrerenderBrowserTest::TearDownInProcessBrowserTestFixture(); 2637 PrerenderBrowserTest::TearDownInProcessBrowserTestFixture();
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after
3290 } 3289 }
3291 3290
3292 // Can't run tests with NaCl plugins if built with DISABLE_NACL. 3291 // Can't run tests with NaCl plugins if built with DISABLE_NACL.
3293 #if !defined(DISABLE_NACL) 3292 #if !defined(DISABLE_NACL)
3294 class PrerenderBrowserTestWithNaCl : public PrerenderBrowserTest { 3293 class PrerenderBrowserTestWithNaCl : public PrerenderBrowserTest {
3295 public: 3294 public:
3296 PrerenderBrowserTestWithNaCl() {} 3295 PrerenderBrowserTestWithNaCl() {}
3297 ~PrerenderBrowserTestWithNaCl() override {} 3296 ~PrerenderBrowserTestWithNaCl() override {}
3298 3297
3299 void SetUpCommandLine(base::CommandLine* command_line) override { 3298 void SetUpCommandLine(base::CommandLine* command_line) override {
3300 PrerenderBrowserTest::SetUpCommandLine(command_line);
3301 command_line->AppendSwitch(switches::kEnableNaCl); 3299 command_line->AppendSwitch(switches::kEnableNaCl);
3302 } 3300 }
3303 }; 3301 };
3304 3302
3305 // PrerenderNaClPluginEnabled crashes on ARM: http://crbug.com/585251 3303 // PrerenderNaClPluginEnabled crashes on ARM: http://crbug.com/585251
3306 #if defined(ARCH_CPU_ARM_FAMILY) 3304 #if defined(ARCH_CPU_ARM_FAMILY)
3307 #define MAYBE_PrerenderNaClPluginEnabled DISABLED_PrerenderNaClPluginEnabled 3305 #define MAYBE_PrerenderNaClPluginEnabled DISABLED_PrerenderNaClPluginEnabled
3308 #else 3306 #else
3309 #define MAYBE_PrerenderNaClPluginEnabled PrerenderNaClPluginEnabled 3307 #define MAYBE_PrerenderNaClPluginEnabled PrerenderNaClPluginEnabled
3310 #endif 3308 #endif
(...skipping 11 matching lines...) Expand all
3322 browser()->tab_strip_model()->GetActiveWebContents(); 3320 browser()->tab_strip_model()->GetActiveWebContents();
3323 bool display_test_result = false; 3321 bool display_test_result = false;
3324 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(web_contents, 3322 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(web_contents,
3325 "DidDisplayReallyPass()", 3323 "DidDisplayReallyPass()",
3326 &display_test_result)); 3324 &display_test_result));
3327 ASSERT_TRUE(display_test_result); 3325 ASSERT_TRUE(display_test_result);
3328 } 3326 }
3329 #endif // !defined(DISABLE_NACL) 3327 #endif // !defined(DISABLE_NACL)
3330 3328
3331 } // namespace prerender 3329 } // namespace prerender
OLDNEW
« no previous file with comments | « chrome/browser/extensions/activity_log/activity_log_browsertest.cc ('k') | chrome/browser/prerender/prerender_field_trial.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698