| 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 <utility> | 5 #include <utility> |
| 6 | 6 |
| 7 #include "base/base64.h" | 7 #include "base/base64.h" |
| 8 #include "base/base_switches.h" | 8 #include "base/base_switches.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 2546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2557 | 2557 |
| 2558 class SSLUIWorkerFetchTest | 2558 class SSLUIWorkerFetchTest |
| 2559 : public testing::WithParamInterface< | 2559 : public testing::WithParamInterface< |
| 2560 std::pair<OffMainThreadFetchMode, SSLUIWorkerFetchTestType>>, | 2560 std::pair<OffMainThreadFetchMode, SSLUIWorkerFetchTestType>>, |
| 2561 public SSLUITest { | 2561 public SSLUITest { |
| 2562 public: | 2562 public: |
| 2563 ~SSLUIWorkerFetchTest() override {} | 2563 ~SSLUIWorkerFetchTest() override {} |
| 2564 void SetUpCommandLine(base::CommandLine* command_line) override { | 2564 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 2565 SSLUITest::SetUpCommandLine(command_line); | 2565 SSLUITest::SetUpCommandLine(command_line); |
| 2566 if (GetParam().first == OffMainThreadFetchMode::kEnabled) { | 2566 if (GetParam().first == OffMainThreadFetchMode::kEnabled) { |
| 2567 command_line->AppendSwitchASCII(switches::kEnableFeatures, | 2567 scoped_feature_list_.InitAndEnableFeature(features::kOffMainThreadFetch); |
| 2568 features::kOffMainThreadFetch.name); | |
| 2569 } else { | 2568 } else { |
| 2570 command_line->AppendSwitchASCII(switches::kDisableFeatures, | 2569 scoped_feature_list_.InitAndDisableFeature(features::kOffMainThreadFetch); |
| 2571 features::kOffMainThreadFetch.name); | |
| 2572 } | 2570 } |
| 2573 } | 2571 } |
| 2574 | 2572 |
| 2575 protected: | 2573 protected: |
| 2576 void GetTestWorkerPagePath(const net::EmbeddedTestServer& https_server, | 2574 void GetTestWorkerPagePath(const net::EmbeddedTestServer& https_server, |
| 2577 std::string* test_worker_page_path) { | 2575 std::string* test_worker_page_path) { |
| 2578 switch (GetParam().second) { | 2576 switch (GetParam().second) { |
| 2579 case SSLUIWorkerFetchTestType::kUseFetch: | 2577 case SSLUIWorkerFetchTestType::kUseFetch: |
| 2580 GetPageWithUnsafeFetchingWorkerPath(https_server, | 2578 GetPageWithUnsafeFetchingWorkerPath(https_server, |
| 2581 test_worker_page_path); | 2579 test_worker_page_path); |
| 2582 break; | 2580 break; |
| 2583 case SSLUIWorkerFetchTestType::kUseImportScripts: | 2581 case SSLUIWorkerFetchTestType::kUseImportScripts: |
| 2584 GetPageWithUnsafeImportingWorkerPath(https_server, | 2582 GetPageWithUnsafeImportingWorkerPath(https_server, |
| 2585 test_worker_page_path); | 2583 test_worker_page_path); |
| 2586 break; | 2584 break; |
| 2587 } | 2585 } |
| 2588 } | 2586 } |
| 2587 |
| 2588 private: |
| 2589 base::test::ScopedFeatureList scoped_feature_list_; |
| 2589 }; | 2590 }; |
| 2590 | 2591 |
| 2591 IN_PROC_BROWSER_TEST_P(SSLUIWorkerFetchTest, | 2592 IN_PROC_BROWSER_TEST_P(SSLUIWorkerFetchTest, |
| 2592 TestUnsafeContentsInWorkerFiltered) { | 2593 TestUnsafeContentsInWorkerFiltered) { |
| 2593 ASSERT_TRUE(https_server_.Start()); | 2594 ASSERT_TRUE(https_server_.Start()); |
| 2594 ASSERT_TRUE(https_server_expired_.Start()); | 2595 ASSERT_TRUE(https_server_expired_.Start()); |
| 2595 | 2596 |
| 2596 // This page will spawn a Worker which will try to load content from | 2597 // This page will spawn a Worker which will try to load content from |
| 2597 // BadCertServer. | 2598 // BadCertServer. |
| 2598 std::string test_worker_page_path; | 2599 std::string test_worker_page_path; |
| (...skipping 2156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4755 | 4756 |
| 4756 // Visit a page over https that contains a frame with a redirect. | 4757 // Visit a page over https that contains a frame with a redirect. |
| 4757 | 4758 |
| 4758 // XMLHttpRequest insecure content in synchronous mode. | 4759 // XMLHttpRequest insecure content in synchronous mode. |
| 4759 | 4760 |
| 4760 // XMLHttpRequest insecure content in asynchronous mode. | 4761 // XMLHttpRequest insecure content in asynchronous mode. |
| 4761 | 4762 |
| 4762 // XMLHttpRequest over bad ssl in synchronous mode. | 4763 // XMLHttpRequest over bad ssl in synchronous mode. |
| 4763 | 4764 |
| 4764 // XMLHttpRequest over OK ssl in synchronous mode. | 4765 // XMLHttpRequest over OK ssl in synchronous mode. |
| OLD | NEW |