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

Unified Diff: base/trace_event/trace_event_argument_unittest.cc

Issue 2975033002: [tracing] Optimize TracedValue::AppendAsTraceFormat(). (Closed)
Patch Set: Fix GraphicsMemoryDumpProviderTest Created 3 years, 5 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_argument.cc ('k') | cc/base/filter_operations_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/trace_event/trace_event_argument_unittest.cc
diff --git a/base/trace_event/trace_event_argument_unittest.cc b/base/trace_event/trace_event_argument_unittest.cc
index aef8441c8e224bd1b1d77b4c03d04a68cd66d3c1..e91bede2d9cf73233110f66bd328fb928d1b0058 100644
--- a/base/trace_event/trace_event_argument_unittest.cc
+++ b/base/trace_event/trace_event_argument_unittest.cc
@@ -17,9 +17,9 @@ namespace trace_event {
TEST(TraceEventArgumentTest, FlatDictionary) {
std::unique_ptr<TracedValue> value(new TracedValue());
- value->SetInteger("int", 2014);
- value->SetDouble("double", 0.0);
value->SetBoolean("bool", true);
+ value->SetDouble("double", 0.0);
+ value->SetInteger("int", 2014);
value->SetString("string", "string");
std::string json = "PREFIX";
value->AppendAsTraceFormat(&json);
@@ -30,9 +30,9 @@ TEST(TraceEventArgumentTest, FlatDictionary) {
TEST(TraceEventArgumentTest, NoDotPathExpansion) {
std::unique_ptr<TracedValue> value(new TracedValue());
- value->SetInteger("in.t", 2014);
- value->SetDouble("doub.le", 0.0);
value->SetBoolean("bo.ol", true);
+ value->SetDouble("doub.le", 0.0);
+ value->SetInteger("in.t", 2014);
value->SetString("str.ing", "str.ing");
std::string json;
value->AppendAsTraceFormat(&json);
@@ -43,16 +43,6 @@ TEST(TraceEventArgumentTest, NoDotPathExpansion) {
TEST(TraceEventArgumentTest, Hierarchy) {
std::unique_ptr<TracedValue> value(new TracedValue());
- value->SetInteger("i0", 2014);
- value->BeginDictionary("dict1");
- value->SetInteger("i1", 2014);
- value->BeginDictionary("dict2");
- value->SetBoolean("b2", false);
- value->EndDictionary();
- value->SetString("s1", "foo");
- value->EndDictionary();
- value->SetDouble("d0", 0.0);
- value->SetBoolean("b0", true);
value->BeginArray("a1");
value->AppendInteger(1);
value->AppendBoolean(true);
@@ -60,6 +50,16 @@ TEST(TraceEventArgumentTest, Hierarchy) {
value->SetInteger("i2", 3);
value->EndDictionary();
value->EndArray();
+ value->SetBoolean("b0", true);
+ value->SetDouble("d0", 0.0);
+ value->BeginDictionary("dict1");
+ value->BeginDictionary("dict2");
+ value->SetBoolean("b2", false);
+ value->EndDictionary();
+ value->SetInteger("i1", 2014);
+ value->SetString("s1", "foo");
+ value->EndDictionary();
+ value->SetInteger("i0", 2014);
value->SetString("s0", "foo");
std::string json;
value->AppendAsTraceFormat(&json);
« no previous file with comments | « base/trace_event/trace_event_argument.cc ('k') | cc/base/filter_operations_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698