| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/test/trace_event_analyzer.h" | 5 #include "base/test/trace_event_analyzer.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 ASSERT_FALSE(event.HasArg("notfound")); | 116 ASSERT_FALSE(event.HasArg("notfound")); |
| 117 | 117 |
| 118 EXPECT_FALSE(event.GetKnownArgAsBool("false")); | 118 EXPECT_FALSE(event.GetKnownArgAsBool("false")); |
| 119 EXPECT_TRUE(event.GetKnownArgAsBool("true")); | 119 EXPECT_TRUE(event.GetKnownArgAsBool("true")); |
| 120 EXPECT_EQ(int_num, event.GetKnownArgAsInt("int")); | 120 EXPECT_EQ(int_num, event.GetKnownArgAsInt("int")); |
| 121 EXPECT_EQ(double_num, event.GetKnownArgAsDouble("double")); | 121 EXPECT_EQ(double_num, event.GetKnownArgAsDouble("double")); |
| 122 EXPECT_STREQ(str, event.GetKnownArgAsString("string").c_str()); | 122 EXPECT_STREQ(str, event.GetKnownArgAsString("string").c_str()); |
| 123 | 123 |
| 124 std::unique_ptr<base::Value> arg; | 124 std::unique_ptr<base::Value> arg; |
| 125 EXPECT_TRUE(event.GetArgAsValue("dict", &arg)); | 125 EXPECT_TRUE(event.GetArgAsValue("dict", &arg)); |
| 126 EXPECT_EQ(base::Value::TYPE_DICTIONARY, arg->GetType()); | 126 EXPECT_EQ(base::Value::Type::DICTIONARY, arg->GetType()); |
| 127 } | 127 } |
| 128 | 128 |
| 129 TEST_F(TraceEventAnalyzerTest, QueryEventMember) { | 129 TEST_F(TraceEventAnalyzerTest, QueryEventMember) { |
| 130 ManualSetUp(); | 130 ManualSetUp(); |
| 131 | 131 |
| 132 TraceEvent event; | 132 TraceEvent event; |
| 133 event.thread.process_id = 3; | 133 event.thread.process_id = 3; |
| 134 event.thread.thread_id = 4; | 134 event.thread.thread_id = 4; |
| 135 event.timestamp = 1.5; | 135 event.timestamp = 1.5; |
| 136 event.phase = TRACE_EVENT_PHASE_BEGIN; | 136 event.phase = TRACE_EVENT_PHASE_BEGIN; |
| (...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 946 std::unique_ptr<base::Value> arg; | 946 std::unique_ptr<base::Value> arg; |
| 947 events[0]->GetArgAsValue("arg", &arg); | 947 events[0]->GetArgAsValue("arg", &arg); |
| 948 base::DictionaryValue* arg_dict; | 948 base::DictionaryValue* arg_dict; |
| 949 EXPECT_TRUE(arg->GetAsDictionary(&arg_dict)); | 949 EXPECT_TRUE(arg->GetAsDictionary(&arg_dict)); |
| 950 std::string property; | 950 std::string property; |
| 951 EXPECT_TRUE(arg_dict->GetString("property", &property)); | 951 EXPECT_TRUE(arg_dict->GetString("property", &property)); |
| 952 EXPECT_EQ("value", property); | 952 EXPECT_EQ("value", property); |
| 953 } | 953 } |
| 954 | 954 |
| 955 } // namespace trace_analyzer | 955 } // namespace trace_analyzer |
| OLD | NEW |