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

Unified Diff: base/test/test_suite.cc

Issue 1848523002: Changes to support using base/feature_list.h from gin/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: gin/isolate_holder.cc changes (sample feature) reverted. Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/feature_list.cc ('k') | content/ppapi_plugin/ppapi_plugin_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/test/test_suite.cc
diff --git a/base/test/test_suite.cc b/base/test/test_suite.cc
index 74bd9ddf7bd5bd238fb4997630c7dc5bdf51370b..486320ebad4416399b5c2faae086b84e10b91e9e 100644
--- a/base/test/test_suite.cc
+++ b/base/test/test_suite.cc
@@ -212,6 +212,12 @@ int TestSuite::Run() {
mac::ScopedNSAutoreleasePool scoped_pool;
#endif
+ // Set up a FeatureList instance, so that code using that API will not hit a
Paweł Hajdan Jr. 2016/04/04 16:45:17 While you're here: could you move this code to Ini
Alexei Svitkine (slow) 2016/04/04 20:01:55 Seems to work. Done.
+ // an error that it's not set. If a FeatureList was created in this way (i.e.
+ // one didn't exist previously), it will be ClearInstanceForTesting() below.
+ const bool created_feature_list =
+ FeatureList::InitializeInstance(std::string(), std::string());
+
Initialize();
std::string client_func =
CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
@@ -224,14 +230,11 @@ int TestSuite::Run() {
test_listener_ios::RegisterTestEndListener();
#endif
- // Set up a FeatureList instance, so that code using that API will not hit a
- // an error that it's not set. Cleared by ClearInstanceForTesting() below.
- base::FeatureList::SetInstance(make_scoped_ptr(new base::FeatureList));
-
int result = RUN_ALL_TESTS();
// Clear the FeatureList that was registered above.
- FeatureList::ClearInstanceForTesting();
+ if (created_feature_list)
+ FeatureList::ClearInstanceForTesting();
#if defined(OS_MACOSX)
// This MUST happen before Shutdown() since Shutdown() tears down
« no previous file with comments | « base/feature_list.cc ('k') | content/ppapi_plugin/ppapi_plugin_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698