summaryrefslogtreecommitdiff
path: root/chromium/base/test/with_feature_override.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/base/test/with_feature_override.h')
-rw-r--r--chromium/base/test/with_feature_override.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/chromium/base/test/with_feature_override.h b/chromium/base/test/with_feature_override.h
index 9a88253c30c..deafd1823f9 100644
--- a/chromium/base/test/with_feature_override.h
+++ b/chromium/base/test/with_feature_override.h
@@ -16,15 +16,18 @@ namespace test {
#define INSTANTIATE_FEATURE_OVERRIDE_TEST_SUITE(test_name) \
INSTANTIATE_TEST_SUITE_P(All, test_name, testing::Values(false, true))
-// Base class for a test fixture that must run with a feature enabled and
-// disabled. Must be the first base class of the test fixture to take effect
-// during the construction of the test fixture itself.
+// Base class for a test fixture that enables running tests twice, once with a
+// feature enabled and once with it disabled. Must be the first base class of
+// the test fixture to take effect during its construction. If
+// WithFeatureOverride is added as a parent to an existing test fixture
+// all of its existing tests need to be migrated to TEST_P.
//
// Example usage:
//
-// class MyTest : public base::WithFeatureOverride, public testing::Test {
+// class MyTest : public base::test::WithFeatureOverride, public testing::Test
+// {
// public:
-// MyTest() : WithFeatureOverride(kMyFeature){}
+// MyTest() : base::test::WithFeatureOverride(kMyFeature){}
// };
//
// TEST_P(MyTest, FooBar) {
@@ -41,8 +44,8 @@ class WithFeatureOverride : public testing::WithParamInterface<bool> {
WithFeatureOverride(const WithFeatureOverride&) = delete;
WithFeatureOverride& operator=(const WithFeatureOverride&) = delete;
- // Use to know if the configured feature provided in the ctor is enabled or
- // not.
+ // Use to know if the configured feature provided in the constructor is
+ // enabled or not.
bool IsParamFeatureEnabled();
private: