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

Side by Side Diff: components/subresource_filter/core/browser/subresource_filter_features_test_support.h

Issue 2272323002: Allow Safe Browsing Saresource Filter to distinguish between different lists. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix safe_browsing_service_browsertest Created 4 years, 3 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
OLDNEW
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698