Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "content/public/test/browser_test_base.h" | 5 #include "content/public/test/browser_test_base.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 233 SetUpInProcessBrowserTestFixture(); | 233 SetUpInProcessBrowserTestFixture(); |
| 234 | 234 |
| 235 // At this point, copy features to the command line, since BrowserMain will | 235 // At this point, copy features to the command line, since BrowserMain will |
| 236 // wipe out the current feature list. | 236 // wipe out the current feature list. |
| 237 std::string enabled_features; | 237 std::string enabled_features; |
| 238 std::string disabled_features; | 238 std::string disabled_features; |
| 239 if (base::FeatureList::GetInstance()) | 239 if (base::FeatureList::GetInstance()) |
| 240 base::FeatureList::GetInstance()->GetFeatureOverrides(&enabled_features, | 240 base::FeatureList::GetInstance()->GetFeatureOverrides(&enabled_features, |
| 241 &disabled_features); | 241 &disabled_features); |
| 242 if (!enabled_features.empty()) | 242 if (!enabled_features.empty()) |
| 243 command_line->AppendSwitchASCII(switches::kEnableFeatures, | 243 command_line->ReplaceSwitchASCIIForTest(switches::kEnableFeatures, |
| 244 enabled_features); | 244 enabled_features); |
|
Ilya Sherman
2017/05/16 06:43:32
Hmm, shouldn't we extend the switch, rather than r
| |
| 245 if (!disabled_features.empty()) | 245 if (!disabled_features.empty()) |
| 246 command_line->AppendSwitchASCII(switches::kDisableFeatures, | 246 command_line->ReplaceSwitchASCIIForTest(switches::kDisableFeatures, |
| 247 disabled_features); | 247 disabled_features); |
| 248 | 248 |
| 249 // Need to wipe feature list clean, since BrowserMain calls | 249 // Need to wipe feature list clean, since BrowserMain calls |
| 250 // FeatureList::SetInstance, which expects no instance to exist. | 250 // FeatureList::SetInstance, which expects no instance to exist. |
| 251 base::FeatureList::ClearInstanceForTesting(); | 251 base::FeatureList::ClearInstanceForTesting(); |
| 252 | 252 |
| 253 base::Closure* ui_task = | 253 base::Closure* ui_task = |
| 254 new base::Closure( | 254 new base::Closure( |
| 255 base::Bind(&BrowserTestBase::ProxyRunTestOnMainThreadLoop, | 255 base::Bind(&BrowserTestBase::ProxyRunTestOnMainThreadLoop, |
| 256 base::Unretained(this))); | 256 base::Unretained(this))); |
| 257 | 257 |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 407 if (mojo_rules.empty()) | 407 if (mojo_rules.empty()) |
| 408 return; | 408 return; |
| 409 | 409 |
| 410 mojom::NetworkServiceTestPtr network_service_test; | 410 mojom::NetworkServiceTestPtr network_service_test; |
| 411 ServiceManagerConnection::GetForProcess()->GetConnector()->BindInterface( | 411 ServiceManagerConnection::GetForProcess()->GetConnector()->BindInterface( |
| 412 mojom::kNetworkServiceName, &network_service_test); | 412 mojom::kNetworkServiceName, &network_service_test); |
| 413 network_service_test->AddRules(std::move(mojo_rules)); | 413 network_service_test->AddRules(std::move(mojo_rules)); |
| 414 } | 414 } |
| 415 | 415 |
| 416 } // namespace content | 416 } // namespace content |
| OLD | NEW |