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

Unified Diff: base/debug/trace_event_unittest.cc

Issue 11366109: Adding raw tracing to trace framework. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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
« base/debug/trace_event.h ('K') | « base/debug/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/debug/trace_event_unittest.cc
diff --git a/base/debug/trace_event_unittest.cc b/base/debug/trace_event_unittest.cc
index 75a6ce4e5dce8d8bcf92df7ae83e93ece2038508..eff567cf88194759a066946ff98c30c0ca2e2c46 100644
--- a/base/debug/trace_event_unittest.cc
+++ b/base/debug/trace_event_unittest.cc
@@ -379,6 +379,12 @@ void TraceWithAllMacroVariants(WaitableEvent* task_complete_event) {
TRACE_COUNTER_ID1("all", "TRACE_COUNTER_ID1 call", 0x319009, 31415);
TRACE_COUNTER_ID2("all", "TRACE_COUNTER_ID2 call", 0x319009,
"a", 30000, "b", 1415);
+
+ TRACE_EVENT_COPY_BEGIN_EXPLICIT0("all",
+ "TRACE_EVENT_COPY_BEGIN_EXPLICIT0 call",
+ 1, 12345);
+ TRACE_EVENT_COPY_END_EXPLICIT0("all", "TRACE_EVENT_COPY_END_EXPLICIT0 call",
+ 1, 23456);
} // Scope close causes TRACE_EVENT0 etc to send their END events.
if (task_complete_event)
@@ -598,6 +604,26 @@ void ValidateAllTraceMacrosCreatedData(const ListValue& trace_parsed) {
EXPECT_TRUE((item && item->GetInteger("args.b", &value)));
EXPECT_EQ(1415, value);
}
+
+ EXPECT_FIND_("TRACE_EVENT_COPY_BEGIN_EXPLICIT0 call");
+ {
+ int val;
+ EXPECT_TRUE((item && item->GetInteger("ts", &val)));
+ EXPECT_EQ(12345, val);
+ std::string id;
+ EXPECT_TRUE((item && item->GetString("id", &id)));
+ EXPECT_EQ("1", id);
+ }
+
+ EXPECT_FIND_("TRACE_EVENT_COPY_END_EXPLICIT0 call");
+ {
+ int val;
+ EXPECT_TRUE((item && item->GetInteger("ts", &val)));
+ EXPECT_EQ(23456, val);
+ std::string id;
+ EXPECT_TRUE((item && item->GetString("id", &id)));
+ EXPECT_EQ("1", id);
+ }
}
void TraceManyInstantEvents(int thread_id, int num_events,
« base/debug/trace_event.h ('K') | « base/debug/trace_event_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698