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

Side by Side Diff: base/trace_event/trace_event_argument_unittest.cc

Issue 2476493003: Remove FundamentalValue
Patch Set: Fix Created 4 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 unified diff | Download patch
« no previous file with comments | « base/json/json_writer_unittest.cc ('k') | base/trace_event/trace_event_memory_overhead.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/trace_event/trace_event_argument.h" 5 #include "base/trace_event/trace_event_argument.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 value->EndArray(); 90 value->EndArray();
91 91
92 std::string json; 92 std::string json;
93 value->AppendAsTraceFormat(&json); 93 value->AppendAsTraceFormat(&json);
94 EXPECT_EQ("{\"a\":\"short\",\"b\":\"" + kLongString + "\",\"c\":[\"" + 94 EXPECT_EQ("{\"a\":\"short\",\"b\":\"" + kLongString + "\",\"c\":[\"" +
95 kLongString2 + "\",\"\",{\"a\":\"" + kLongString3 + "\"}]}", 95 kLongString2 + "\",\"\",{\"a\":\"" + kLongString3 + "\"}]}",
96 json); 96 json);
97 } 97 }
98 98
99 TEST(TraceEventArgumentTest, PassBaseValue) { 99 TEST(TraceEventArgumentTest, PassBaseValue) {
100 FundamentalValue int_value(42); 100 Value int_value(42);
101 FundamentalValue bool_value(true); 101 Value bool_value(true);
102 FundamentalValue double_value(42.0f); 102 Value double_value(42.0f);
103 103
104 auto dict_value = WrapUnique(new DictionaryValue); 104 auto dict_value = WrapUnique(new DictionaryValue);
105 dict_value->SetBoolean("bool", true); 105 dict_value->SetBoolean("bool", true);
106 dict_value->SetInteger("int", 42); 106 dict_value->SetInteger("int", 42);
107 dict_value->SetDouble("double", 42.0f); 107 dict_value->SetDouble("double", 42.0f);
108 dict_value->SetString("string", std::string("a") + "b"); 108 dict_value->SetString("string", std::string("a") + "b");
109 dict_value->SetString("string", std::string("a") + "b"); 109 dict_value->SetString("string", std::string("a") + "b");
110 110
111 auto list_value = WrapUnique(new ListValue); 111 auto list_value = WrapUnique(new ListValue);
112 list_value->AppendBoolean(false); 112 list_value->AppendBoolean(false);
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 nested_dict_value->SetInteger("f", 3); 156 nested_dict_value->SetInteger("f", 3);
157 nested_dict_value->BeginDictionary("g"); 157 nested_dict_value->BeginDictionary("g");
158 nested_dict_value->EndDictionary(); 158 nested_dict_value->EndDictionary();
159 json = ""; 159 json = "";
160 nested_dict_value->AppendAsTraceFormat(&json); 160 nested_dict_value->AppendAsTraceFormat(&json);
161 EXPECT_EQ("{\"b\":2,\"c\":[\"foo\"],\"f\":3,\"g\":{}}", json); 161 EXPECT_EQ("{\"b\":2,\"c\":[\"foo\"],\"f\":3,\"g\":{}}", json);
162 } 162 }
163 163
164 } // namespace trace_event 164 } // namespace trace_event
165 } // namespace base 165 } // namespace base
OLDNEW
« no previous file with comments | « base/json/json_writer_unittest.cc ('k') | base/trace_event/trace_event_memory_overhead.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698