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

Unified Diff: components/subresource_filter/core/browser/subresource_filter_features_test_support.h

Issue 2022783002: Skeleton of the Safe Browsing Subresource Filter. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Implement RenderFrameObserver::OnDestruct introduced by rebase. Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: components/subresource_filter/core/browser/subresource_filter_features_test_support.h
diff --git a/components/subresource_filter/core/browser/subresource_filter_features_test_support.h b/components/subresource_filter/core/browser/subresource_filter_features_test_support.h
new file mode 100644
index 0000000000000000000000000000000000000000..0c301b9d4094686fc1f88747524e6673e21ca13d
--- /dev/null
+++ b/components/subresource_filter/core/browser/subresource_filter_features_test_support.h
@@ -0,0 +1,33 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_SUBRESOURCE_FILTER_CORE_BROWSER_SUBRESOURCE_FILTER_FEATURES_TEST_SUPPORT_H_
+#define COMPONENTS_SUBRESOURCE_FILTER_CORE_BROWSER_SUBRESOURCE_FILTER_FEATURES_TEST_SUPPORT_H_
+
+#include <string>
+
+#include "base/feature_list.h"
+#include "base/macros.h"
+
+namespace subresource_filter {
+namespace testing {
+
+// Helper to override the state of the |kSafeBrowsingSubresourceFilter| feature
+// and the maximum activation state during tests. Expects a pre-existing global
+// base::FieldTrialList singleton.
+class ScopedSubresourceFilterFeatureToggle {
+ public:
+ ScopedSubresourceFilterFeatureToggle(
+ base::FeatureList::OverrideState feature_state,
+ const std::string& maximum_activation_state);
+ ~ScopedSubresourceFilterFeatureToggle();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ScopedSubresourceFilterFeatureToggle);
+};
+
+} // namespace testing
+} // namespace subresource_filter
+
+#endif // COMPONENTS_SUBRESOURCE_FILTER_CORE_BROWSER_SUBRESOURCE_FILTER_FEATURES_TEST_SUPPORT_H_

Powered by Google App Engine
This is Rietveld 408576698