OLD | NEW |
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> |
| 8 |
7 #include <utility> | 9 #include <utility> |
8 | 10 |
9 #include "base/values.h" | 11 #include "base/values.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
11 | 13 |
12 namespace base { | 14 namespace base { |
13 namespace trace_event { | 15 namespace trace_event { |
14 | 16 |
15 TEST(TraceEventArgumentTest, FlatDictionary) { | 17 TEST(TraceEventArgumentTest, FlatDictionary) { |
16 scoped_refptr<TracedValue> value = new TracedValue(); | 18 scoped_refptr<TracedValue> value = new TracedValue(); |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 nested_dict_value->SetInteger("f", 3); | 155 nested_dict_value->SetInteger("f", 3); |
154 nested_dict_value->BeginDictionary("g"); | 156 nested_dict_value->BeginDictionary("g"); |
155 nested_dict_value->EndDictionary(); | 157 nested_dict_value->EndDictionary(); |
156 json = ""; | 158 json = ""; |
157 nested_dict_value->AppendAsTraceFormat(&json); | 159 nested_dict_value->AppendAsTraceFormat(&json); |
158 EXPECT_EQ("{\"b\":2,\"c\":[\"foo\"],\"f\":3,\"g\":{}}", json); | 160 EXPECT_EQ("{\"b\":2,\"c\":[\"foo\"],\"f\":3,\"g\":{}}", json); |
159 } | 161 } |
160 | 162 |
161 } // namespace trace_event | 163 } // namespace trace_event |
162 } // namespace base | 164 } // namespace base |
OLD | NEW |