OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
12 #include "base/sys_info.h" | 12 #include "base/sys_info.h" |
| 13 #include "base/test/scoped_feature_list.h" |
13 #include "base/test/test_timeouts.h" | 14 #include "base/test/test_timeouts.h" |
14 #include "build/build_config.h" | 15 #include "build/build_config.h" |
15 #include "content/public/browser/browser_thread.h" | 16 #include "content/public/browser/browser_thread.h" |
16 #include "content/public/browser/client_certificate_delegate.h" | 17 #include "content/public/browser/client_certificate_delegate.h" |
17 #include "content/public/common/content_features.h" | 18 #include "content/public/common/content_features.h" |
18 #include "content/public/common/content_paths.h" | 19 #include "content/public/common/content_paths.h" |
19 #include "content/public/common/content_switches.h" | 20 #include "content/public/common/content_switches.h" |
20 #include "content/public/test/browser_test_utils.h" | 21 #include "content/public/test/browser_test_utils.h" |
21 #include "content/public/test/content_browser_test.h" | 22 #include "content/public/test/content_browser_test.h" |
22 #include "content/public/test/content_browser_test_utils.h" | 23 #include "content/public/test/content_browser_test_utils.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 | 105 |
105 private: | 106 private: |
106 void OnSelectClientCertificate() { select_certificate_count_++; } | 107 void OnSelectClientCertificate() { select_certificate_count_++; } |
107 | 108 |
108 int select_certificate_count_; | 109 int select_certificate_count_; |
109 }; | 110 }; |
110 | 111 |
111 class WorkerFetchTest : public testing::WithParamInterface<bool>, | 112 class WorkerFetchTest : public testing::WithParamInterface<bool>, |
112 public WorkerTest { | 113 public WorkerTest { |
113 public: | 114 public: |
114 ~WorkerFetchTest() override {} | 115 WorkerFetchTest() { |
115 void SetUpCommandLine(base::CommandLine* command_line) override { | |
116 if (GetParam()) { | 116 if (GetParam()) { |
117 command_line->AppendSwitchASCII(switches::kEnableFeatures, | 117 scoped_feature_list_.InitAndEnableFeature(features::kOffMainThreadFetch); |
118 features::kOffMainThreadFetch.name); | |
119 } else { | 118 } else { |
120 command_line->AppendSwitchASCII(switches::kDisableFeatures, | 119 scoped_feature_list_.InitAndDisableFeature(features::kOffMainThreadFetch); |
121 features::kOffMainThreadFetch.name); | |
122 } | 120 } |
123 } | 121 } |
| 122 |
| 123 ~WorkerFetchTest() override {} |
| 124 |
| 125 private: |
| 126 base::test::ScopedFeatureList scoped_feature_list_; |
124 }; | 127 }; |
125 | 128 |
126 IN_PROC_BROWSER_TEST_F(WorkerTest, SingleWorker) { | 129 IN_PROC_BROWSER_TEST_F(WorkerTest, SingleWorker) { |
127 RunTest("single_worker.html", std::string()); | 130 RunTest("single_worker.html", std::string()); |
128 } | 131 } |
129 | 132 |
130 IN_PROC_BROWSER_TEST_F(WorkerTest, MultipleWorkers) { | 133 IN_PROC_BROWSER_TEST_F(WorkerTest, MultipleWorkers) { |
131 RunTest("multi_worker.html", std::string()); | 134 RunTest("multi_worker.html", std::string()); |
132 } | 135 } |
133 | 136 |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 return; | 282 return; |
280 | 283 |
281 RunTest("pass_messageport_to_sharedworker_dont_wait_for_connect.html", ""); | 284 RunTest("pass_messageport_to_sharedworker_dont_wait_for_connect.html", ""); |
282 } | 285 } |
283 | 286 |
284 INSTANTIATE_TEST_CASE_P(/* no prefix */, | 287 INSTANTIATE_TEST_CASE_P(/* no prefix */, |
285 WorkerFetchTest, | 288 WorkerFetchTest, |
286 ::testing::Values(true, false)); | 289 ::testing::Values(true, false)); |
287 | 290 |
288 } // namespace content | 291 } // namespace content |
OLD | NEW |