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

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

Issue 2875033004: [subresource_filter] Add debugging trace events around activation (Closed)
Patch Set: quick fix Created 3 years, 7 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
« no previous file with comments | « components/subresource_filter/core/browser/subresource_filter_features_test_support.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/subresource_filter/core/browser/subresource_filter_features_test_support.cc
diff --git a/components/subresource_filter/core/browser/subresource_filter_features_test_support.cc b/components/subresource_filter/core/browser/subresource_filter_features_test_support.cc
index df18a7386246c667b6fb29c82310aa4f34c1bfbf..dcd7c3150544f0ea6f087a78863d1fa75471d928 100644
--- a/components/subresource_filter/core/browser/subresource_filter_features_test_support.cc
+++ b/components/subresource_filter/core/browser/subresource_filter_features_test_support.cc
@@ -4,11 +4,15 @@
#include "components/subresource_filter/core/browser/subresource_filter_features_test_support.h"
+#include <ostream>
#include <utility>
+#include "base/json/json_writer.h"
#include "base/memory/ptr_util.h"
#include "base/memory/ref_counted.h"
#include "base/strings/string_util.h"
+#include "base/trace_event/trace_event_argument.h"
+#include "base/values.h"
namespace subresource_filter {
namespace testing {
@@ -83,5 +87,15 @@ void ScopedSubresourceFilterFeatureToggle::ResetSubresourceFilterState(
ScopedSubresourceFilterFeatureToggle::~ScopedSubresourceFilterFeatureToggle() {}
+std::ostream& operator<<(std::ostream& os, const Configuration& config) {
+ std::unique_ptr<base::Value> value = config.ToTracedValue()->ToBaseValue();
+ base::DictionaryValue* dict;
+ value->GetAsDictionary(&dict);
+ std::string json;
+ base::JSONWriter::WriteWithOptions(
+ *dict, base::JSONWriter::OPTIONS_PRETTY_PRINT, &json);
+ return os << json;
+}
+
} // namespace testing
} // namespace subresource_filter
« no previous file with comments | « components/subresource_filter/core/browser/subresource_filter_features_test_support.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698