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 // Test of classes in the tracked_objects.h classes. | 5 // Test of classes in the tracked_objects.h classes. |
6 | 6 |
7 #include "base/tracked_objects.h" | 7 #include "base/tracked_objects.h" |
8 | 8 |
9 #include <stddef.h> | 9 #include <stddef.h> |
10 | 10 |
(...skipping 16 matching lines...) Expand all Loading... |
27 TrackedObjectsTest() { | 27 TrackedObjectsTest() { |
28 // On entry, leak any database structures in case they are still in use by | 28 // On entry, leak any database structures in case they are still in use by |
29 // prior threads. | 29 // prior threads. |
30 ThreadData::ShutdownSingleThreadedCleanup(true); | 30 ThreadData::ShutdownSingleThreadedCleanup(true); |
31 | 31 |
32 test_time_ = 0; | 32 test_time_ = 0; |
33 ThreadData::SetAlternateTimeSource(&TrackedObjectsTest::GetTestTime); | 33 ThreadData::SetAlternateTimeSource(&TrackedObjectsTest::GetTestTime); |
34 ThreadData::now_function_is_time_ = true; | 34 ThreadData::now_function_is_time_ = true; |
35 } | 35 } |
36 | 36 |
37 virtual ~TrackedObjectsTest() { | 37 ~TrackedObjectsTest() override { |
38 // We should not need to leak any structures we create, since we are | 38 // We should not need to leak any structures we create, since we are |
39 // single threaded, and carefully accounting for items. | 39 // single threaded, and carefully accounting for items. |
40 ThreadData::ShutdownSingleThreadedCleanup(false); | 40 ThreadData::ShutdownSingleThreadedCleanup(false); |
41 } | 41 } |
42 | 42 |
43 // Reset the profiler state. | 43 // Reset the profiler state. |
44 void Reset() { | 44 void Reset() { |
45 ThreadData::ShutdownSingleThreadedCleanup(false); | 45 ThreadData::ShutdownSingleThreadedCleanup(false); |
46 test_time_ = 0; | 46 test_time_ = 0; |
47 } | 47 } |
(...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
821 EXPECT_EQ(2, process_data.tasks[t1].death_data.run_duration_sample); | 821 EXPECT_EQ(2, process_data.tasks[t1].death_data.run_duration_sample); |
822 EXPECT_EQ(1, process_data.tasks[t1].death_data.queue_duration_sum); | 822 EXPECT_EQ(1, process_data.tasks[t1].death_data.queue_duration_sum); |
823 EXPECT_EQ(1, process_data.tasks[t1].death_data.queue_duration_max); | 823 EXPECT_EQ(1, process_data.tasks[t1].death_data.queue_duration_max); |
824 EXPECT_EQ(1, process_data.tasks[t1].death_data.queue_duration_sample); | 824 EXPECT_EQ(1, process_data.tasks[t1].death_data.queue_duration_sample); |
825 EXPECT_EQ(kMainThreadName, process_data.tasks[t1].death_thread_name); | 825 EXPECT_EQ(kMainThreadName, process_data.tasks[t1].death_thread_name); |
826 EXPECT_EQ(0u, process_data.descendants.size()); | 826 EXPECT_EQ(0u, process_data.descendants.size()); |
827 EXPECT_EQ(base::GetCurrentProcId(), process_data.process_id); | 827 EXPECT_EQ(base::GetCurrentProcId(), process_data.process_id); |
828 } | 828 } |
829 | 829 |
830 } // namespace tracked_objects | 830 } // namespace tracked_objects |
OLD | NEW |