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

Unified Diff: base/debug/trace_event_unittest.cc

Issue 14244010: Correctly handle multiple convertable argument names. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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/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 82c8dc00e3bd60aed469bb67f189c528c2160ae0..297a3457813e8865cf7d387921d32b9c2ac03aaf 100644
--- a/base/debug/trace_event_unittest.cc
+++ b/base/debug/trace_event_unittest.cc
@@ -1636,8 +1636,14 @@ TEST_F(TraceEventTestFixture, ConvertableTypes) {
TraceLog::RECORD_UNTIL_FULL);
scoped_ptr<MyData> data(new MyData());
+ scoped_ptr<MyData> data1(new MyData());
+ scoped_ptr<MyData> data2(new MyData());
TRACE_EVENT1("foo", "bar", "data",
data.PassAs<base::debug::ConvertableToTraceFormat>());
+ TRACE_EVENT2("foo", "baz",
+ "data1", data1.PassAs<base::debug::ConvertableToTraceFormat>(),
+ "data2", data2.PassAs<base::debug::ConvertableToTraceFormat>());
+
EndTraceAndFlush();
DictionaryValue* dict = FindNamePhase("bar", "B");
@@ -1655,6 +1661,22 @@ TEST_F(TraceEventTestFixture, ConvertableTypes) {
int foo_val;
EXPECT_TRUE(convertable_dict->GetInteger("foo", &foo_val));
EXPECT_EQ(1, foo_val);
+
+ dict = FindNamePhase("baz", "B");
+ ASSERT_TRUE(dict);
+ args_dict = NULL;
+ dict->GetDictionary("args", &args_dict);
+ ASSERT_TRUE(args_dict);
+
+ value = NULL;
+ convertable_dict = NULL;
+ EXPECT_TRUE(args_dict->Get("data1", &value));
+ ASSERT_TRUE(value->GetAsDictionary(&convertable_dict));
+
+ value = NULL;
+ convertable_dict = NULL;
+ EXPECT_TRUE(args_dict->Get("data2", &value));
+ ASSERT_TRUE(value->GetAsDictionary(&convertable_dict));
}
« no previous file with comments | « base/debug/trace_event_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698