Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef BASE_TEST_SCOPED_FEATURE_LIST_H_ | 5 #ifndef BASE_TEST_SCOPED_FEATURE_LIST_H_ |
| 6 #define BASE_TEST_SCOPED_FEATURE_LIST_H_ | 6 #define BASE_TEST_SCOPED_FEATURE_LIST_H_ |
| 7 | 7 |
| 8 #include <initializer_list> | 8 #include <initializer_list> |
| 9 | 9 |
| 10 #include "base/feature_list.h" | 10 #include "base/feature_list.h" |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 21 public: | 21 public: |
| 22 ScopedFeatureList(); | 22 ScopedFeatureList(); |
| 23 ~ScopedFeatureList(); | 23 ~ScopedFeatureList(); |
| 24 | 24 |
| 25 // Initializes and registers a FeatureList instance with no overrides. | 25 // Initializes and registers a FeatureList instance with no overrides. |
| 26 void Init(); | 26 void Init(); |
| 27 | 27 |
| 28 // Initializes and registers the given FeatureList instance. | 28 // Initializes and registers the given FeatureList instance. |
| 29 void InitWithFeatureList(std::unique_ptr<FeatureList> feature_list); | 29 void InitWithFeatureList(std::unique_ptr<FeatureList> feature_list); |
| 30 | 30 |
| 31 // Initializes and registers a FeatureList instance with the given enabled | 31 // Initializes and registers a FeatureList instance with only the given |
| 32 // and disabled features. | 32 // enabled and disabled features (comma-separated names). |
|
Ilya Sherman
2017/04/21 22:43:34
For this function and the two above it, please add
| |
| 33 void InitFromCommandLine(const std::string& enable_features, | |
| 34 const std::string& disable_features); | |
| 35 | |
| 36 // Initializes and registers a FeatureList instance overrided with the given | |
|
Ilya Sherman
2017/04/21 22:43:34
nit: s/overrided/overridden (applies throughout)
| |
| 37 // enabled and disabled features. | |
|
Ilya Sherman
2017/04/21 22:43:34
nit: To add a bit of clarity here, please add a bi
| |
| 33 void InitWithFeatures( | 38 void InitWithFeatures( |
| 34 const std::initializer_list<base::Feature>& enabled_features, | 39 const std::initializer_list<base::Feature>& enabled_features, |
| 35 const std::initializer_list<base::Feature>& disabled_features); | 40 const std::initializer_list<base::Feature>& disabled_features); |
| 36 | 41 |
| 37 // Initializes and registers a FeatureList instance with the given | 42 // Initializes and registers a FeatureList instance overrided with single |
| 38 // enabled and disabled features (comma-separated names). | 43 // enabled feature. |
| 39 void InitFromCommandLine(const std::string& enable_features, | |
| 40 const std::string& disable_features); | |
| 41 | |
| 42 // Initializes and registers a FeatureList instance enabling a single | |
| 43 // feature. | |
| 44 void InitAndEnableFeature(const base::Feature& feature); | 44 void InitAndEnableFeature(const base::Feature& feature); |
| 45 | 45 |
| 46 // Initializes and registers a FeatureList instance disabling a single | 46 // Initializes and registers a FeatureList instance overrided with single |
| 47 // feature. | 47 // disabled feature. |
| 48 void InitAndDisableFeature(const base::Feature& feature); | 48 void InitAndDisableFeature(const base::Feature& feature); |
| 49 | 49 |
| 50 private: | 50 private: |
| 51 std::unique_ptr<FeatureList> original_feature_list_; | 51 std::unique_ptr<FeatureList> original_feature_list_; |
| 52 | 52 |
| 53 DISALLOW_COPY_AND_ASSIGN(ScopedFeatureList); | 53 DISALLOW_COPY_AND_ASSIGN(ScopedFeatureList); |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 } // namespace test | 56 } // namespace test |
| 57 } // namespace base | 57 } // namespace base |
| 58 | 58 |
| 59 #endif // BASE_TEST_SCOPED_FEATURE_LIST_H_ | 59 #endif // BASE_TEST_SCOPED_FEATURE_LIST_H_ |
| OLD | NEW |