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/debug/trace_event_unittest.h" | 5 #include "base/debug/trace_event_unittest.h" |
6 | 6 |
7 #include <cstdlib> | 7 #include <cstdlib> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 if (!root.get()) { | 142 if (!root.get()) { |
143 LOG(ERROR) << json_output_.json_output; | 143 LOG(ERROR) << json_output_.json_output; |
144 } | 144 } |
145 | 145 |
146 ListValue* root_list = NULL; | 146 ListValue* root_list = NULL; |
147 ASSERT_TRUE(root.get()); | 147 ASSERT_TRUE(root.get()); |
148 ASSERT_TRUE(root->GetAsList(&root_list)); | 148 ASSERT_TRUE(root->GetAsList(&root_list)); |
149 | 149 |
150 // Move items into our aggregate collection | 150 // Move items into our aggregate collection |
151 while (root_list->GetSize()) { | 151 while (root_list->GetSize()) { |
152 Value* item = NULL; | 152 scoped_ptr<Value> item; |
153 root_list->Remove(0, &item); | 153 root_list->Remove(0, &item); |
154 trace_parsed_.Append(item); | 154 trace_parsed_.Append(item.release()); |
155 } | 155 } |
156 } | 156 } |
157 | 157 |
158 static bool CompareJsonValues(const std::string& lhs, | 158 static bool CompareJsonValues(const std::string& lhs, |
159 const std::string& rhs, | 159 const std::string& rhs, |
160 CompareOp op) { | 160 CompareOp op) { |
161 switch (op) { | 161 switch (op) { |
162 case IS_EQUAL: | 162 case IS_EQUAL: |
163 return lhs == rhs; | 163 return lhs == rhs; |
164 case IS_NOT_EQUAL: | 164 case IS_NOT_EQUAL: |
(...skipping 1850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2015 EXPECT_TRUE(CategoryFilter::IsEmptyOrContainsLeadingOrTrailingWhitespace( | 2015 EXPECT_TRUE(CategoryFilter::IsEmptyOrContainsLeadingOrTrailingWhitespace( |
2016 " bad_category ")); | 2016 " bad_category ")); |
2017 EXPECT_TRUE(CategoryFilter::IsEmptyOrContainsLeadingOrTrailingWhitespace( | 2017 EXPECT_TRUE(CategoryFilter::IsEmptyOrContainsLeadingOrTrailingWhitespace( |
2018 "")); | 2018 "")); |
2019 EXPECT_FALSE(CategoryFilter::IsEmptyOrContainsLeadingOrTrailingWhitespace( | 2019 EXPECT_FALSE(CategoryFilter::IsEmptyOrContainsLeadingOrTrailingWhitespace( |
2020 "good_category")); | 2020 "good_category")); |
2021 } | 2021 } |
2022 | 2022 |
2023 } // namespace debug | 2023 } // namespace debug |
2024 } // namespace base | 2024 } // namespace base |
OLD | NEW |