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 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 { | |
578 PrerenderInProcessBrowserTest::SetUpCommandLine(command_line); | |
579 command_line->AppendSwitchASCII(switches::kPrerenderMode, | |
580 switches::kPrerenderModeSwitchValueEnabled); | |
581 } | |
582 | |
583 void SetUpInProcessBrowserTestFixture() override { | 577 void SetUpInProcessBrowserTestFixture() override { |
584 test_utils::PrerenderInProcessBrowserTest:: | 578 test_utils::PrerenderInProcessBrowserTest:: |
585 SetUpInProcessBrowserTestFixture(); | 579 SetUpInProcessBrowserTestFixture(); |
586 | 580 |
587 // Although PreferHtmlOverPlugins is redundant with the Field Trial testing | 581 // Although PreferHtmlOverPlugins is redundant with the Field Trial testing |
588 // configuration, the official builders don't use those, so enable it here. | 582 // configuration, the official builders don't use those, so enable it here. |
589 feature_list_.InitAndEnableFeature(features::kPreferHtmlOverPlugins); | 583 feature_list_.InitAndEnableFeature(features::kPreferHtmlOverPlugins); |
590 } | 584 } |
591 | 585 |
592 void NavigateToDestURL() const { | 586 void NavigateToDestURL() const { |
(...skipping 2025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2618 public: | 2612 public: |
2619 PrerenderBrowserTestWithExtensions() { | 2613 PrerenderBrowserTestWithExtensions() { |
2620 // The individual tests start the test server through ExtensionApiTest, so | 2614 // The individual tests start the test server through ExtensionApiTest, so |
2621 // the port number can be passed through to the extension. | 2615 // the port number can be passed through to the extension. |
2622 set_autostart_test_server(false); | 2616 set_autostart_test_server(false); |
2623 } | 2617 } |
2624 | 2618 |
2625 void SetUp() override { PrerenderBrowserTest::SetUp(); } | 2619 void SetUp() override { PrerenderBrowserTest::SetUp(); } |
2626 | 2620 |
2627 void SetUpCommandLine(base::CommandLine* command_line) override { | 2621 void SetUpCommandLine(base::CommandLine* command_line) override { |
2628 PrerenderBrowserTest::SetUpCommandLine(command_line); | |
2629 ExtensionApiTest::SetUpCommandLine(command_line); | 2622 ExtensionApiTest::SetUpCommandLine(command_line); |
2630 } | 2623 } |
2631 | 2624 |
2632 void SetUpInProcessBrowserTestFixture() override { | 2625 void SetUpInProcessBrowserTestFixture() override { |
2633 PrerenderBrowserTest::SetUpInProcessBrowserTestFixture(); | 2626 PrerenderBrowserTest::SetUpInProcessBrowserTestFixture(); |
2634 ExtensionApiTest::SetUpInProcessBrowserTestFixture(); | 2627 ExtensionApiTest::SetUpInProcessBrowserTestFixture(); |
2635 } | 2628 } |
2636 | 2629 |
2637 void TearDownInProcessBrowserTestFixture() override { | 2630 void TearDownInProcessBrowserTestFixture() override { |
2638 PrerenderBrowserTest::TearDownInProcessBrowserTestFixture(); | 2631 PrerenderBrowserTest::TearDownInProcessBrowserTestFixture(); |
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3290 } | 3283 } |
3291 | 3284 |
3292 // Can't run tests with NaCl plugins if built with DISABLE_NACL. | 3285 // Can't run tests with NaCl plugins if built with DISABLE_NACL. |
3293 #if !defined(DISABLE_NACL) | 3286 #if !defined(DISABLE_NACL) |
3294 class PrerenderBrowserTestWithNaCl : public PrerenderBrowserTest { | 3287 class PrerenderBrowserTestWithNaCl : public PrerenderBrowserTest { |
3295 public: | 3288 public: |
3296 PrerenderBrowserTestWithNaCl() {} | 3289 PrerenderBrowserTestWithNaCl() {} |
3297 ~PrerenderBrowserTestWithNaCl() override {} | 3290 ~PrerenderBrowserTestWithNaCl() override {} |
3298 | 3291 |
3299 void SetUpCommandLine(base::CommandLine* command_line) override { | 3292 void SetUpCommandLine(base::CommandLine* command_line) override { |
3300 PrerenderBrowserTest::SetUpCommandLine(command_line); | |
3301 command_line->AppendSwitch(switches::kEnableNaCl); | 3293 command_line->AppendSwitch(switches::kEnableNaCl); |
3302 } | 3294 } |
3303 }; | 3295 }; |
3304 | 3296 |
3305 // PrerenderNaClPluginEnabled crashes on ARM: http://crbug.com/585251 | 3297 // PrerenderNaClPluginEnabled crashes on ARM: http://crbug.com/585251 |
3306 #if defined(ARCH_CPU_ARM_FAMILY) | 3298 #if defined(ARCH_CPU_ARM_FAMILY) |
3307 #define MAYBE_PrerenderNaClPluginEnabled DISABLED_PrerenderNaClPluginEnabled | 3299 #define MAYBE_PrerenderNaClPluginEnabled DISABLED_PrerenderNaClPluginEnabled |
3308 #else | 3300 #else |
3309 #define MAYBE_PrerenderNaClPluginEnabled PrerenderNaClPluginEnabled | 3301 #define MAYBE_PrerenderNaClPluginEnabled PrerenderNaClPluginEnabled |
3310 #endif | 3302 #endif |
(...skipping 11 matching lines...) Expand all Loading... |
3322 browser()->tab_strip_model()->GetActiveWebContents(); | 3314 browser()->tab_strip_model()->GetActiveWebContents(); |
3323 bool display_test_result = false; | 3315 bool display_test_result = false; |
3324 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(web_contents, | 3316 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(web_contents, |
3325 "DidDisplayReallyPass()", | 3317 "DidDisplayReallyPass()", |
3326 &display_test_result)); | 3318 &display_test_result)); |
3327 ASSERT_TRUE(display_test_result); | 3319 ASSERT_TRUE(display_test_result); |
3328 } | 3320 } |
3329 #endif // !defined(DISABLE_NACL) | 3321 #endif // !defined(DISABLE_NACL) |
3330 | 3322 |
3331 } // namespace prerender | 3323 } // namespace prerender |
OLD | NEW |