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

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

Issue 869043008: Reland of Move tracing namespace from base::debug to base::trace_event. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkcr
Patch Set: Fix suppressions Created 5 years, 10 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 unified diff | Download patch
« no previous file with comments | « base/trace_event/trace_event_argument.cc ('k') | base/trace_event/trace_event_impl.h » ('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 #include "testing/gtest/include/gtest/gtest.h" 6 #include "testing/gtest/include/gtest/gtest.h"
7 7
8 namespace base { 8 namespace base {
9 namespace debug { 9 namespace trace_event {
10 10
11 TEST(TraceEventArgumentTest, FlatDictionary) { 11 TEST(TraceEventArgumentTest, FlatDictionary) {
12 scoped_refptr<TracedValue> value = new TracedValue(); 12 scoped_refptr<TracedValue> value = new TracedValue();
13 value->SetInteger("int", 2014); 13 value->SetInteger("int", 2014);
14 value->SetDouble("double", 0.0); 14 value->SetDouble("double", 0.0);
15 value->SetBoolean("bool", true); 15 value->SetBoolean("bool", true);
16 value->SetString("string", "string"); 16 value->SetString("string", "string");
17 std::string json; 17 std::string json;
18 value->AppendAsTraceFormat(&json); 18 value->AppendAsTraceFormat(&json);
19 EXPECT_EQ("{\"bool\":true,\"double\":0.0,\"int\":2014,\"string\":\"string\"}", 19 EXPECT_EQ("{\"bool\":true,\"double\":0.0,\"int\":2014,\"string\":\"string\"}",
(...skipping 22 matching lines...) Expand all
42 value->SetString("s0", "foo"); 42 value->SetString("s0", "foo");
43 std::string json; 43 std::string json;
44 value->AppendAsTraceFormat(&json); 44 value->AppendAsTraceFormat(&json);
45 EXPECT_EQ( 45 EXPECT_EQ(
46 "{\"a1\":[1,true,{\"i2\":3}],\"b0\":true,\"d0\":0.0,\"dict1\":{\"dict2\":" 46 "{\"a1\":[1,true,{\"i2\":3}],\"b0\":true,\"d0\":0.0,\"dict1\":{\"dict2\":"
47 "{\"b2\":false},\"i1\":2014,\"s1\":\"foo\"},\"i0\":2014,\"s0\":" 47 "{\"b2\":false},\"i1\":2014,\"s1\":\"foo\"},\"i0\":2014,\"s0\":"
48 "\"foo\"}", 48 "\"foo\"}",
49 json); 49 json);
50 } 50 }
51 51
52 } // namespace debug 52 } // namespace trace_event
53 } // namespace base 53 } // namespace base
OLDNEW
« no previous file with comments | « base/trace_event/trace_event_argument.cc ('k') | base/trace_event/trace_event_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698