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

Unified Diff: base/trace_event/trace_event_unittest.cc

Issue 1870563002: Escape name and category of trace events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove escaping of trace event category Created 4 years, 8 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 | « base/trace_event/trace_event_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/trace_event/trace_event_unittest.cc
diff --git a/base/trace_event/trace_event_unittest.cc b/base/trace_event/trace_event_unittest.cc
index 91155ea1fe3456ef925b98dd98b32a22e36737d7..6a1d8a4991d28952f25e900e7378c48cd6ef80f9 100644
--- a/base/trace_event/trace_event_unittest.cc
+++ b/base/trace_event/trace_event_unittest.cc
@@ -2330,6 +2330,16 @@ TEST_F(TraceEventTestFixture, PrimitiveArgs) {
EXPECT_EQ(1, int_value);
}
+TEST_F(TraceEventTestFixture, NameIsEscaped) {
+ TraceLog::GetInstance()->SetEnabled(TraceConfig(kRecordAllCategoryFilter, ""),
+ TraceLog::RECORDING_MODE);
+ TRACE_EVENT0("category", "name\\with\\backspaces");
+ EndTraceAndFlush();
+
+ EXPECT_TRUE(FindMatchingValue("cat", "category"));
+ EXPECT_TRUE(FindMatchingValue("name", "name\\with\\backspaces"));
+}
+
namespace {
bool IsArgNameWhitelisted(const char* arg_name) {
« no previous file with comments | « base/trace_event/trace_event_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698