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

Side by Side Diff: third_party/WebKit/Source/platform/scheduler/base/queueing_time_estimator_unittest.cc

Issue 2818533003: Make nesting/running states a RunLoop rather than a MessageLoop concept. (Closed)
Patch Set: still need to check MessageLoop::current() in Mojo's RunLoopNestingObserver::GetForThread() Created 3 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "platform/scheduler/base/queueing_time_estimator.h" 5 #include "platform/scheduler/base/queueing_time_estimator.h"
6 #include "platform/scheduler/base/test_time_source.h" 6 #include "platform/scheduler/base/test_time_source.h"
7 #include "testing/gmock/include/gmock/gmock.h" 7 #include "testing/gmock/include/gmock/gmock.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 namespace blink { 10 namespace blink {
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 base::TimeDelta::FromSeconds(5)); 153 base::TimeDelta::FromSeconds(5));
154 base::TimeTicks time; 154 base::TimeTicks time;
155 time += base::TimeDelta::FromMilliseconds(5000); 155 time += base::TimeDelta::FromMilliseconds(5000);
156 estimator.OnTopLevelTaskStarted(time); 156 estimator.OnTopLevelTaskStarted(time);
157 estimator.OnTopLevelTaskCompleted(time); 157 estimator.OnTopLevelTaskCompleted(time);
158 158
159 time += base::TimeDelta::FromMilliseconds(3000); 159 time += base::TimeDelta::FromMilliseconds(3000);
160 160
161 estimator.OnTopLevelTaskStarted(time); 161 estimator.OnTopLevelTaskStarted(time);
162 time += base::TimeDelta::FromMilliseconds(20000); 162 time += base::TimeDelta::FromMilliseconds(20000);
163 estimator.OnBeginNestedMessageLoop(); 163 estimator.OnBeginNestedRunLoop();
164 estimator.OnTopLevelTaskCompleted(time); 164 estimator.OnTopLevelTaskCompleted(time);
165 165
166 // Perform an additional task after the nested message loop. A 1 second task 166 // Perform an additional task after the nested message loop. A 1 second task
167 // in a 5 second window results in a 100ms expected queueing time. 167 // in a 5 second window results in a 100ms expected queueing time.
168 estimator.OnTopLevelTaskStarted(time); 168 estimator.OnTopLevelTaskStarted(time);
169 time += base::TimeDelta::FromMilliseconds(1000); 169 time += base::TimeDelta::FromMilliseconds(1000);
170 estimator.OnTopLevelTaskCompleted(time); 170 estimator.OnTopLevelTaskCompleted(time);
171 171
172 // Flush the data by adding a task in the next window. 172 // Flush the data by adding a task in the next window.
173 time += base::TimeDelta::FromMilliseconds(5000); 173 time += base::TimeDelta::FromMilliseconds(5000);
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 base::TimeDelta::FromMilliseconds(0), 218 base::TimeDelta::FromMilliseconds(0),
219 base::TimeDelta::FromMilliseconds(0), 219 base::TimeDelta::FromMilliseconds(0),
220 base::TimeDelta::FromMilliseconds(0), 220 base::TimeDelta::FromMilliseconds(0),
221 base::TimeDelta::FromMilliseconds(0), 221 base::TimeDelta::FromMilliseconds(0),
222 base::TimeDelta::FromMilliseconds(0), 222 base::TimeDelta::FromMilliseconds(0),
223 base::TimeDelta::FromMilliseconds(100))); 223 base::TimeDelta::FromMilliseconds(100)));
224 } 224 }
225 225
226 } // namespace scheduler 226 } // namespace scheduler
227 } // namespace blink 227 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698