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

Side by Side Diff: base/feature_list_unittest.cc

Issue 1812883003: Enable features API for content shell and webview (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updated comment in BrowserMainLoop Created 4 years, 8 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
« no previous file with comments | « base/feature_list.cc ('k') | content/browser/browser_main_loop.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/feature_list.h" 5 #include "base/feature_list.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <utility> 10 #include <utility>
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 417
418 EXPECT_FALSE(FieldTrialList::IsTrialActive("T1")); 418 EXPECT_FALSE(FieldTrialList::IsTrialActive("T1"));
419 EXPECT_FALSE(FeatureList::IsEnabled(kFeatureOffByDefault)); 419 EXPECT_FALSE(FeatureList::IsEnabled(kFeatureOffByDefault));
420 EXPECT_TRUE(FieldTrialList::IsTrialActive("T1")); 420 EXPECT_TRUE(FieldTrialList::IsTrialActive("T1"));
421 421
422 EXPECT_FALSE(FieldTrialList::IsTrialActive("T2")); 422 EXPECT_FALSE(FieldTrialList::IsTrialActive("T2"));
423 EXPECT_TRUE(FeatureList::IsEnabled(kFeatureOnByDefault)); 423 EXPECT_TRUE(FeatureList::IsEnabled(kFeatureOnByDefault));
424 EXPECT_TRUE(FieldTrialList::IsTrialActive("T2")); 424 EXPECT_TRUE(FieldTrialList::IsTrialActive("T2"));
425 } 425 }
426 426
427 TEST_F(FeatureListTest, InitializeInstance) {
428 ClearFeatureListInstance();
429
430 scoped_ptr<base::FeatureList> feature_list(new base::FeatureList);
431 FeatureList::SetInstance(std::move(feature_list));
432 EXPECT_TRUE(FeatureList::IsEnabled(kFeatureOnByDefault));
433 EXPECT_FALSE(FeatureList::IsEnabled(kFeatureOffByDefault));
434
435 // Initialize from command line if we haven't yet.
436 FeatureList::InitializeInstance("", kFeatureOnByDefaultName);
437 EXPECT_FALSE(FeatureList::IsEnabled(kFeatureOnByDefault));
438 EXPECT_FALSE(FeatureList::IsEnabled(kFeatureOffByDefault));
439
440 // Do not initialize from commandline if we have already.
441 FeatureList::InitializeInstance(kFeatureOffByDefaultName, "");
442 EXPECT_FALSE(FeatureList::IsEnabled(kFeatureOnByDefault));
443 EXPECT_FALSE(FeatureList::IsEnabled(kFeatureOffByDefault));
444 }
445
427 } // namespace base 446 } // namespace base
OLDNEW
« no previous file with comments | « base/feature_list.cc ('k') | content/browser/browser_main_loop.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698