OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <numeric> | 5 #include <numeric> |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/timer/elapsed_timer.h" | 9 #include "base/timer/elapsed_timer.h" |
10 #include "base/tracked_objects.h" | 10 #include "base/tracked_objects.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 RequestResponsePerfTest() | 59 RequestResponsePerfTest() |
60 : loop_(make_scoped_ptr(new common::MessagePumpMojo())) {} | 60 : loop_(make_scoped_ptr(new common::MessagePumpMojo())) {} |
61 | 61 |
62 ~RequestResponsePerfTest() override { loop_.RunUntilIdle(); } | 62 ~RequestResponsePerfTest() override { loop_.RunUntilIdle(); } |
63 | 63 |
64 void Iterate(size_t count); | 64 void Iterate(size_t count); |
65 void Measure(const char* case_nam); | 65 void Measure(const char* case_nam); |
66 | 66 |
67 void SetUp() override { | 67 void SetUp() override { |
68 tracked_objects::ThreadData::InitializeAndSetTrackingStatus( | 68 tracked_objects::ThreadData::InitializeAndSetTrackingStatus( |
69 tracked_objects::ThreadData::PROFILING_CHILDREN_ACTIVE); | 69 tracked_objects::ThreadData::PROFILING_ACTIVE); |
70 } | 70 } |
71 | 71 |
72 void TearDown() override { | 72 void TearDown() override { |
73 tracked_objects::ThreadData::InitializeAndSetTrackingStatus( | 73 tracked_objects::ThreadData::InitializeAndSetTrackingStatus( |
74 tracked_objects::ThreadData::DEACTIVATED); | 74 tracked_objects::ThreadData::DEACTIVATED); |
75 } | 75 } |
76 | 76 |
77 void PumpMessages() { loop_.RunUntilIdle(); } | 77 void PumpMessages() { loop_.RunUntilIdle(); } |
78 | 78 |
79 private: | 79 private: |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 Environment::GetDefaultTaskTracker()->SetEnabled(false); | 125 Environment::GetDefaultTaskTracker()->SetEnabled(false); |
126 } | 126 } |
127 | 127 |
128 TEST_F(RequestResponsePerfTest, TrackingDisabled) { | 128 TEST_F(RequestResponsePerfTest, TrackingDisabled) { |
129 Measure(__FUNCTION__); | 129 Measure(__FUNCTION__); |
130 } | 130 } |
131 | 131 |
132 } // namespace | 132 } // namespace |
133 } // namespace test | 133 } // namespace test |
134 } // namespace mojo | 134 } // namespace mojo |
OLD | NEW |