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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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() override {} |
115 void SetUpCommandLine(base::CommandLine* command_line) override { | 116 void SetUpCommandLine(base::CommandLine* command_line) override { |
116 if (GetParam()) { | 117 if (GetParam()) { |
117 command_line->AppendSwitchASCII(switches::kEnableFeatures, | 118 scoped_feature_list_.InitAndEnableFeature(features::kOffMainThreadFetch); |
118 features::kOffMainThreadFetch.name); | |
119 } else { | 119 } else { |
120 command_line->AppendSwitchASCII(switches::kDisableFeatures, | 120 scoped_feature_list_.InitAndDisableFeature(features::kOffMainThreadFetch); |
121 features::kOffMainThreadFetch.name); | |
122 } | 121 } |
123 } | 122 } |
| 123 |
| 124 private: |
| 125 base::test::ScopedFeatureList scoped_feature_list_; |
124 }; | 126 }; |
125 | 127 |
126 IN_PROC_BROWSER_TEST_F(WorkerTest, SingleWorker) { | 128 IN_PROC_BROWSER_TEST_F(WorkerTest, SingleWorker) { |
127 RunTest("single_worker.html", std::string()); | 129 RunTest("single_worker.html", std::string()); |
128 } | 130 } |
129 | 131 |
130 IN_PROC_BROWSER_TEST_F(WorkerTest, MultipleWorkers) { | 132 IN_PROC_BROWSER_TEST_F(WorkerTest, MultipleWorkers) { |
131 RunTest("multi_worker.html", std::string()); | 133 RunTest("multi_worker.html", std::string()); |
132 } | 134 } |
133 | 135 |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 return; | 281 return; |
280 | 282 |
281 RunTest("pass_messageport_to_sharedworker_dont_wait_for_connect.html", ""); | 283 RunTest("pass_messageport_to_sharedworker_dont_wait_for_connect.html", ""); |
282 } | 284 } |
283 | 285 |
284 INSTANTIATE_TEST_CASE_P(/* no prefix */, | 286 INSTANTIATE_TEST_CASE_P(/* no prefix */, |
285 WorkerFetchTest, | 287 WorkerFetchTest, |
286 ::testing::Values(true, false)); | 288 ::testing::Values(true, false)); |
287 | 289 |
288 } // namespace content | 290 } // namespace content |
OLD | NEW |