Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(349)

Side by Side Diff: content/public/test/browser_test_base.cc

Issue 2876153002: Support Using ScopedFeatureList in BrowserTest (Closed)
Patch Set: ilya's comments addressed Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 223
224 if (use_software_gl && !use_software_compositing_) 224 if (use_software_gl && !use_software_compositing_)
225 command_line->AppendSwitch(switches::kOverrideUseSoftwareGLForTests); 225 command_line->AppendSwitch(switches::kOverrideUseSoftwareGLForTests);
226 226
227 test_host_resolver_ = base::MakeUnique<TestHostResolver>(); 227 test_host_resolver_ = base::MakeUnique<TestHostResolver>();
228 228
229 ContentBrowserSanityChecker scoped_enable_sanity_checks; 229 ContentBrowserSanityChecker scoped_enable_sanity_checks;
230 230
231 SetUpInProcessBrowserTestFixture(); 231 SetUpInProcessBrowserTestFixture();
232 232
233 DCHECK(!command_line->HasSwitch(switches::kEnableFeatures));
234 DCHECK(!command_line->HasSwitch(switches::kDisableFeatures));
235
233 // At this point, copy features to the command line, since BrowserMain will 236 // At this point, copy features to the command line, since BrowserMain will
234 // wipe out the current feature list. 237 // wipe out the current feature list.
235 std::string enabled_features; 238 std::string enabled_features;
236 std::string disabled_features; 239 std::string disabled_features;
237 if (base::FeatureList::GetInstance()) { 240 if (base::FeatureList::GetInstance()) {
238 base::FeatureList::GetInstance()->GetFeatureOverrides(&enabled_features, 241 base::FeatureList::GetInstance()->GetFeatureOverrides(&enabled_features,
239 &disabled_features); 242 &disabled_features);
240 } 243 }
241 if (!enabled_features.empty()) { 244 if (!enabled_features.empty()) {
242 command_line->AppendSwitchASCII(switches::kEnableFeatures, 245 command_line->AppendSwitchASCII(switches::kEnableFeatures,
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 return; 410 return;
408 411
409 mojom::NetworkServiceTestPtr network_service_test; 412 mojom::NetworkServiceTestPtr network_service_test;
410 ServiceManagerConnection::GetForProcess()->GetConnector()->BindInterface( 413 ServiceManagerConnection::GetForProcess()->GetConnector()->BindInterface(
411 mojom::kNetworkServiceName, &network_service_test); 414 mojom::kNetworkServiceName, &network_service_test);
412 mojo::SyncCallRestrictions::ScopedAllowSyncCall allow_sync_call; 415 mojo::SyncCallRestrictions::ScopedAllowSyncCall allow_sync_call;
413 network_service_test->AddRules(std::move(mojo_rules)); 416 network_service_test->AddRules(std::move(mojo_rules));
414 } 417 }
415 418
416 } // namespace content 419 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698