OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "components/metrics/profiler/profiler_metrics_provider.h" | 5 #include "components/metrics/profiler/profiler_metrics_provider.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/metrics/metrics_hashes.h" |
10 #include "base/tracked_objects.h" | 11 #include "base/tracked_objects.h" |
11 #include "components/metrics/metrics_hashes.h" | |
12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
13 | 13 |
14 using tracked_objects::ProcessDataPhaseSnapshot; | 14 using tracked_objects::ProcessDataPhaseSnapshot; |
15 using tracked_objects::TaskSnapshot; | 15 using tracked_objects::TaskSnapshot; |
16 | 16 |
17 namespace metrics { | 17 namespace metrics { |
18 | 18 |
19 TEST(ProfilerMetricsProviderTest, RecordData) { | 19 TEST(ProfilerMetricsProviderTest, RecordData) { |
20 // WARNING: If you broke the below check, you've modified how | 20 // WARNING: If you broke the below check, you've modified how |
21 // HashMetricName works. Please also modify all server-side code that | 21 // HashMetricName works. Please also modify all server-side code that |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 EXPECT_EQ(100, tracked_object->queue_time_total()); | 262 EXPECT_EQ(100, tracked_object->queue_time_total()); |
263 EXPECT_EQ(100, tracked_object->queue_time_sampled()); | 263 EXPECT_EQ(100, tracked_object->queue_time_sampled()); |
264 EXPECT_EQ(HashMetricName("death_thread_ten"), | 264 EXPECT_EQ(HashMetricName("death_thread_ten"), |
265 tracked_object->exec_thread_name_hash()); | 265 tracked_object->exec_thread_name_hash()); |
266 EXPECT_EQ(177U, tracked_object->process_id()); | 266 EXPECT_EQ(177U, tracked_object->process_id()); |
267 EXPECT_EQ(ProfilerEventProto::TrackedObject::BROWSER, | 267 EXPECT_EQ(ProfilerEventProto::TrackedObject::BROWSER, |
268 tracked_object->process_type()); | 268 tracked_object->process_type()); |
269 } | 269 } |
270 | 270 |
271 } // namespace metrics | 271 } // namespace metrics |
OLD | NEW |