Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(199)

Side by Side Diff: mojo/tests/task_tracker_perftest.cc

Issue 1128733002: Update from https://crrev.com/328418 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « mojo/services/view_manager/public/cpp/tests/run_all_unittests.cc ('k') | sandbox/linux/bpf_dsl/codegen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698