| 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 <deque> | 5 #include <deque> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 1051 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1062 SafeBrowsingService::RegisterFactory(safe_browsing_factory_.get()); | 1062 SafeBrowsingService::RegisterFactory(safe_browsing_factory_.get()); |
| 1063 #endif | 1063 #endif |
| 1064 } | 1064 } |
| 1065 | 1065 |
| 1066 void TearDownInProcessBrowserTestFixture() override { | 1066 void TearDownInProcessBrowserTestFixture() override { |
| 1067 #if defined(FULL_SAFE_BROWSING) | 1067 #if defined(FULL_SAFE_BROWSING) |
| 1068 SafeBrowsingService::RegisterFactory(NULL); | 1068 SafeBrowsingService::RegisterFactory(NULL); |
| 1069 #endif | 1069 #endif |
| 1070 } | 1070 } |
| 1071 | 1071 |
| 1072 void SetUpCommandLine(CommandLine* command_line) override { | 1072 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 1073 command_line->AppendSwitchASCII(switches::kPrerenderMode, | 1073 command_line->AppendSwitchASCII(switches::kPrerenderMode, |
| 1074 switches::kPrerenderModeSwitchValueEnabled); | 1074 switches::kPrerenderModeSwitchValueEnabled); |
| 1075 #if defined(OS_MACOSX) | 1075 #if defined(OS_MACOSX) |
| 1076 // The plugins directory isn't read by default on the Mac, so it needs to be | 1076 // The plugins directory isn't read by default on the Mac, so it needs to be |
| 1077 // explicitly registered. | 1077 // explicitly registered. |
| 1078 base::FilePath app_dir; | 1078 base::FilePath app_dir; |
| 1079 PathService::Get(chrome::DIR_APP, &app_dir); | 1079 PathService::Get(chrome::DIR_APP, &app_dir); |
| 1080 command_line->AppendSwitchPath( | 1080 command_line->AppendSwitchPath( |
| 1081 switches::kExtraPluginDir, | 1081 switches::kExtraPluginDir, |
| 1082 app_dir.Append(FILE_PATH_LITERAL("plugins"))); | 1082 app_dir.Append(FILE_PATH_LITERAL("plugins"))); |
| (...skipping 2423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3506 0); | 3506 0); |
| 3507 histogram_tester().ExpectTotalCount( | 3507 histogram_tester().ExpectTotalCount( |
| 3508 "Prerender.websame_PerceivedPLTMatchedComplete", 1); | 3508 "Prerender.websame_PerceivedPLTMatchedComplete", 1); |
| 3509 } | 3509 } |
| 3510 | 3510 |
| 3511 class PrerenderBrowserTestWithNaCl : public PrerenderBrowserTest { | 3511 class PrerenderBrowserTestWithNaCl : public PrerenderBrowserTest { |
| 3512 public: | 3512 public: |
| 3513 PrerenderBrowserTestWithNaCl() {} | 3513 PrerenderBrowserTestWithNaCl() {} |
| 3514 ~PrerenderBrowserTestWithNaCl() override {} | 3514 ~PrerenderBrowserTestWithNaCl() override {} |
| 3515 | 3515 |
| 3516 void SetUpCommandLine(CommandLine* command_line) override { | 3516 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 3517 PrerenderBrowserTest::SetUpCommandLine(command_line); | 3517 PrerenderBrowserTest::SetUpCommandLine(command_line); |
| 3518 command_line->AppendSwitch(switches::kEnableNaCl); | 3518 command_line->AppendSwitch(switches::kEnableNaCl); |
| 3519 } | 3519 } |
| 3520 }; | 3520 }; |
| 3521 | 3521 |
| 3522 // Check that NaCl plugins work when enabled, with prerendering. | 3522 // Check that NaCl plugins work when enabled, with prerendering. |
| 3523 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTestWithNaCl, | 3523 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTestWithNaCl, |
| 3524 PrerenderNaClPluginEnabled) { | 3524 PrerenderNaClPluginEnabled) { |
| 3525 #if defined(OS_WIN) && defined(USE_ASH) | 3525 #if defined(OS_WIN) && defined(USE_ASH) |
| 3526 // Disable this test in Metro+Ash for now (http://crbug.com/262796). | 3526 // Disable this test in Metro+Ash for now (http://crbug.com/262796). |
| 3527 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) | 3527 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 3528 switches::kAshBrowserTests)) |
| 3528 return; | 3529 return; |
| 3529 #endif | 3530 #endif |
| 3530 | 3531 |
| 3531 PrerenderTestURL("files/prerender/prerender_plugin_nacl_enabled.html", | 3532 PrerenderTestURL("files/prerender/prerender_plugin_nacl_enabled.html", |
| 3532 FINAL_STATUS_USED, | 3533 FINAL_STATUS_USED, |
| 3533 1); | 3534 1); |
| 3534 NavigateToDestURL(); | 3535 NavigateToDestURL(); |
| 3535 | 3536 |
| 3536 // To avoid any chance of a race, we have to let the script send its response | 3537 // To avoid any chance of a race, we have to let the script send its response |
| 3537 // asynchronously. | 3538 // asynchronously. |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3594 public ExtensionApiTest { | 3595 public ExtensionApiTest { |
| 3595 public: | 3596 public: |
| 3596 PrerenderBrowserTestWithExtensions() { | 3597 PrerenderBrowserTestWithExtensions() { |
| 3597 // The individual tests start the test server through ExtensionApiTest, so | 3598 // The individual tests start the test server through ExtensionApiTest, so |
| 3598 // the port number can be passed through to the extension. | 3599 // the port number can be passed through to the extension. |
| 3599 autostart_test_server_ = false; | 3600 autostart_test_server_ = false; |
| 3600 } | 3601 } |
| 3601 | 3602 |
| 3602 void SetUp() override { PrerenderBrowserTest::SetUp(); } | 3603 void SetUp() override { PrerenderBrowserTest::SetUp(); } |
| 3603 | 3604 |
| 3604 void SetUpCommandLine(CommandLine* command_line) override { | 3605 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 3605 PrerenderBrowserTest::SetUpCommandLine(command_line); | 3606 PrerenderBrowserTest::SetUpCommandLine(command_line); |
| 3606 ExtensionApiTest::SetUpCommandLine(command_line); | 3607 ExtensionApiTest::SetUpCommandLine(command_line); |
| 3607 } | 3608 } |
| 3608 | 3609 |
| 3609 void SetUpInProcessBrowserTestFixture() override { | 3610 void SetUpInProcessBrowserTestFixture() override { |
| 3610 PrerenderBrowserTest::SetUpInProcessBrowserTestFixture(); | 3611 PrerenderBrowserTest::SetUpInProcessBrowserTestFixture(); |
| 3611 ExtensionApiTest::SetUpInProcessBrowserTestFixture(); | 3612 ExtensionApiTest::SetUpInProcessBrowserTestFixture(); |
| 3612 } | 3613 } |
| 3613 | 3614 |
| 3614 void TearDownInProcessBrowserTestFixture() override { | 3615 void TearDownInProcessBrowserTestFixture() override { |
| (...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4580 TestShouldDisableLocalPredictorPreferenceNetworkMatrix( | 4581 TestShouldDisableLocalPredictorPreferenceNetworkMatrix( |
| 4581 true /*preference_wifi_network_wifi*/, | 4582 true /*preference_wifi_network_wifi*/, |
| 4582 true /*preference_wifi_network_4g*/, | 4583 true /*preference_wifi_network_4g*/, |
| 4583 true /*preference_always_network_wifi*/, | 4584 true /*preference_always_network_wifi*/, |
| 4584 false /*preference_always_network_4g*/, | 4585 false /*preference_always_network_4g*/, |
| 4585 true /*preference_never_network_wifi*/, | 4586 true /*preference_never_network_wifi*/, |
| 4586 true /*preference_never_network_4g*/); | 4587 true /*preference_never_network_4g*/); |
| 4587 } | 4588 } |
| 4588 | 4589 |
| 4589 } // namespace prerender | 4590 } // namespace prerender |
| OLD | NEW |