| 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 COMPONENTS_SUBRESOURCE_FILTER_CORE_BROWSER_SUBRESOURCE_FILTER_FEATURES_T
EST_SUPPORT_H_ | 5 #ifndef COMPONENTS_SUBRESOURCE_FILTER_CORE_BROWSER_SUBRESOURCE_FILTER_FEATURES_T
EST_SUPPORT_H_ |
| 6 #define COMPONENTS_SUBRESOURCE_FILTER_CORE_BROWSER_SUBRESOURCE_FILTER_FEATURES_T
EST_SUPPORT_H_ | 6 #define COMPONENTS_SUBRESOURCE_FILTER_CORE_BROWSER_SUBRESOURCE_FILTER_FEATURES_T
EST_SUPPORT_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/feature_list.h" | 10 #include "base/feature_list.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/test/scoped_feature_list.h" | 12 #include "base/test/scoped_feature_list.h" |
| 13 | 13 |
| 14 namespace subresource_filter { | 14 namespace subresource_filter { |
| 15 namespace testing { | 15 namespace testing { |
| 16 | 16 |
| 17 // Helper to override the state of the |kSafeBrowsingSubresourceFilter| feature | 17 // Helper to override the state of the |kSafeBrowsingSubresourceFilter| feature |
| 18 // and the maximum activation state during tests. Expects a pre-existing global | 18 // and the maximum activation state during tests. Expects a pre-existing global |
| 19 // base::FieldTrialList singleton. | 19 // base::FieldTrialList singleton. |
| 20 class ScopedSubresourceFilterFeatureToggle { | 20 class ScopedSubresourceFilterFeatureToggle { |
| 21 public: | 21 public: |
| 22 ScopedSubresourceFilterFeatureToggle( | 22 ScopedSubresourceFilterFeatureToggle( |
| 23 base::FeatureList::OverrideState feature_state, | 23 base::FeatureList::OverrideState feature_state, |
| 24 const std::string& maximum_activation_state, | 24 const std::string& maximum_activation_state, |
| 25 const std::string& activation_scope); | 25 const std::string& activation_scope); |
| 26 |
| 27 ScopedSubresourceFilterFeatureToggle( |
| 28 base::FeatureList::OverrideState feature_state, |
| 29 const std::string& maximum_activation_state, |
| 30 const std::string& activation_scope, |
| 31 const std::string& activation_lists); |
| 32 |
| 26 ~ScopedSubresourceFilterFeatureToggle(); | 33 ~ScopedSubresourceFilterFeatureToggle(); |
| 27 | 34 |
| 28 private: | 35 private: |
| 29 base::test::ScopedFeatureList scoped_feature_list_; | 36 base::test::ScopedFeatureList scoped_feature_list_; |
| 30 | 37 |
| 31 DISALLOW_COPY_AND_ASSIGN(ScopedSubresourceFilterFeatureToggle); | 38 DISALLOW_COPY_AND_ASSIGN(ScopedSubresourceFilterFeatureToggle); |
| 32 }; | 39 }; |
| 33 | 40 |
| 34 } // namespace testing | 41 } // namespace testing |
| 35 } // namespace subresource_filter | 42 } // namespace subresource_filter |
| 36 | 43 |
| 37 #endif // COMPONENTS_SUBRESOURCE_FILTER_CORE_BROWSER_SUBRESOURCE_FILTER_FEATURE
S_TEST_SUPPORT_H_ | 44 #endif // COMPONENTS_SUBRESOURCE_FILTER_CORE_BROWSER_SUBRESOURCE_FILTER_FEATURE
S_TEST_SUPPORT_H_ |
| OLD | NEW |