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 "components/scheduler/child/worker_scheduler_impl.h" | 5 #include "components/scheduler/child/worker_scheduler_impl.h" |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 #include "base/test/simple_test_tick_clock.h" | |
9 #include "cc/test/ordered_simple_task_runner.h" | 10 #include "cc/test/ordered_simple_task_runner.h" |
10 #include "cc/test/test_now_source.h" | |
11 #include "components/scheduler/child/nestable_task_runner_for_test.h" | 11 #include "components/scheduler/child/nestable_task_runner_for_test.h" |
12 #include "components/scheduler/child/scheduler_message_loop_delegate.h" | 12 #include "components/scheduler/child/scheduler_message_loop_delegate.h" |
13 #include "components/scheduler/child/test_time_source.h" | 13 #include "components/scheduler/child/test_time_source.h" |
14 #include "testing/gmock/include/gmock/gmock.h" | 14 #include "testing/gmock/include/gmock/gmock.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
16 | 16 |
17 using testing::ElementsAreArray; | 17 using testing::ElementsAreArray; |
18 | 18 |
19 namespace scheduler { | 19 namespace scheduler { |
20 | 20 |
21 namespace { | 21 namespace { |
22 void NopTask() { | 22 void NopTask() { |
23 } | 23 } |
24 | 24 |
25 int TimeTicksToIntMs(const base::TimeTicks& time) { | 25 int TimeTicksToIntMs(const base::TimeTicks& time) { |
26 return static_cast<int>((time - base::TimeTicks()).InMilliseconds()); | 26 return static_cast<int>((time - base::TimeTicks()).InMilliseconds()); |
27 } | 27 } |
28 | 28 |
29 void WakeUpTask(std::vector<std::string>* timeline, cc::TestNowSource* clock) { | 29 void WakeUpTask(std::vector<std::string>* timeline, |
30 base::SimpleTestTickClock* clock) { | |
30 if (timeline) { | 31 if (timeline) { |
31 timeline->push_back(base::StringPrintf("run WakeUpTask @ %d", | 32 timeline->push_back(base::StringPrintf( |
32 TimeTicksToIntMs(clock->Now()))); | 33 "run WakeUpTask @ %d", TimeTicksToIntMs(clock->NowTicks()))); |
33 } | 34 } |
34 } | 35 } |
35 | 36 |
36 void RecordTimelineTask(std::vector<std::string>* timeline, | 37 void RecordTimelineTask(std::vector<std::string>* timeline, |
37 cc::TestNowSource* clock) { | 38 base::SimpleTestTickClock* clock) { |
38 timeline->push_back(base::StringPrintf("run RecordTimelineTask @ %d", | 39 timeline->push_back(base::StringPrintf("run RecordTimelineTask @ %d", |
39 TimeTicksToIntMs(clock->Now()))); | 40 TimeTicksToIntMs(clock->NowTicks()))); |
40 } | 41 } |
41 | 42 |
42 void AppendToVectorTestTask(std::vector<std::string>* vector, | 43 void AppendToVectorTestTask(std::vector<std::string>* vector, |
43 std::string value) { | 44 std::string value) { |
44 vector->push_back(value); | 45 vector->push_back(value); |
45 } | 46 } |
46 | 47 |
47 void AppendToVectorIdleTestTask(std::vector<std::string>* vector, | 48 void AppendToVectorIdleTestTask(std::vector<std::string>* vector, |
48 std::string value, | 49 std::string value, |
49 base::TimeTicks deadline) { | 50 base::TimeTicks deadline) { |
50 AppendToVectorTestTask(vector, value); | 51 AppendToVectorTestTask(vector, value); |
51 } | 52 } |
52 | 53 |
53 void TimelineIdleTestTask(std::vector<std::string>* timeline, | 54 void TimelineIdleTestTask(std::vector<std::string>* timeline, |
54 base::TimeTicks deadline) { | 55 base::TimeTicks deadline) { |
55 timeline->push_back(base::StringPrintf("run TimelineIdleTestTask deadline %d", | 56 timeline->push_back(base::StringPrintf("run TimelineIdleTestTask deadline %d", |
56 TimeTicksToIntMs(deadline))); | 57 TimeTicksToIntMs(deadline))); |
57 } | 58 } |
58 | 59 |
59 }; // namespace | 60 }; // namespace |
60 | 61 |
61 class WorkerSchedulerImplForTest : public WorkerSchedulerImpl { | 62 class WorkerSchedulerImplForTest : public WorkerSchedulerImpl { |
62 public: | 63 public: |
63 WorkerSchedulerImplForTest( | 64 WorkerSchedulerImplForTest( |
64 scoped_refptr<NestableSingleThreadTaskRunner> main_task_runner, | 65 scoped_refptr<NestableSingleThreadTaskRunner> main_task_runner, |
65 scoped_refptr<cc::TestNowSource> clock_) | 66 base::SimpleTestTickClock* clock_) |
66 : WorkerSchedulerImpl(main_task_runner), | 67 : WorkerSchedulerImpl(main_task_runner), |
67 clock_(clock_), | 68 clock_(clock_), |
68 timeline_(nullptr) {} | 69 timeline_(nullptr) {} |
69 | 70 |
70 void RecordTimelineEvents(std::vector<std::string>* timeline) { | 71 void RecordTimelineEvents(std::vector<std::string>* timeline) { |
71 timeline_ = timeline; | 72 timeline_ = timeline; |
72 } | 73 } |
73 | 74 |
74 private: | 75 private: |
75 bool CanEnterLongIdlePeriod( | 76 bool CanEnterLongIdlePeriod( |
76 base::TimeTicks now, | 77 base::TimeTicks now, |
77 base::TimeDelta* next_long_idle_period_delay_out) override { | 78 base::TimeDelta* next_long_idle_period_delay_out) override { |
78 if (timeline_) { | 79 if (timeline_) { |
79 timeline_->push_back(base::StringPrintf("CanEnterLongIdlePeriod @ %d", | 80 timeline_->push_back(base::StringPrintf("CanEnterLongIdlePeriod @ %d", |
80 TimeTicksToIntMs(now))); | 81 TimeTicksToIntMs(now))); |
81 } | 82 } |
82 return WorkerSchedulerImpl::CanEnterLongIdlePeriod( | 83 return WorkerSchedulerImpl::CanEnterLongIdlePeriod( |
83 now, next_long_idle_period_delay_out); | 84 now, next_long_idle_period_delay_out); |
84 } | 85 } |
85 | 86 |
86 void IsNotQuiescent() override { | 87 void IsNotQuiescent() override { |
87 if (timeline_) { | 88 if (timeline_) { |
88 timeline_->push_back(base::StringPrintf("IsNotQuiescent @ %d", | 89 timeline_->push_back(base::StringPrintf( |
89 TimeTicksToIntMs(clock_->Now()))); | 90 "IsNotQuiescent @ %d", TimeTicksToIntMs(clock_->NowTicks()))); |
90 } | 91 } |
91 WorkerSchedulerImpl::IsNotQuiescent(); | 92 WorkerSchedulerImpl::IsNotQuiescent(); |
92 } | 93 } |
93 | 94 |
94 scoped_refptr<cc::TestNowSource> clock_; | 95 base::SimpleTestTickClock* clock_; |
95 std::vector<std::string>* timeline_; // NOT OWNED | 96 std::vector<std::string>* timeline_; // NOT OWNED |
96 }; | 97 }; |
97 | 98 |
98 class WorkerSchedulerImplTest : public testing::Test { | 99 class WorkerSchedulerImplTest : public testing::Test { |
99 public: | 100 public: |
100 WorkerSchedulerImplTest() | 101 WorkerSchedulerImplTest() |
101 : clock_(cc::TestNowSource::Create(5000)), | 102 : clock_(new base::SimpleTestTickClock()), timeline_(nullptr) { |
102 mock_task_runner_(new cc::OrderedSimpleTaskRunner(clock_, true)), | 103 clock_->Advance(base::TimeDelta::FromInternalValue(5000)); |
Sami
2015/05/29 14:00:58
Ditto about the starting time value.
Ankur Verma
2015/06/03 14:56:10
Have'nt changed starting values yet as per mithro'
| |
103 nestable_task_runner_( | 104 mock_task_runner_ = new cc::OrderedSimpleTaskRunner(clock_, true); |
104 NestableTaskRunnerForTest::Create(mock_task_runner_)), | 105 nestable_task_runner_ = |
105 scheduler_( | 106 NestableTaskRunnerForTest::Create(mock_task_runner_); |
106 new WorkerSchedulerImplForTest(nestable_task_runner_, clock_)), | 107 scheduler_ = make_scoped_ptr( |
107 timeline_(nullptr) { | 108 new WorkerSchedulerImplForTest(nestable_task_runner_, clock_)); |
108 scheduler_->GetSchedulerHelperForTesting()->SetTimeSourceForTesting( | 109 scheduler_->GetSchedulerHelperForTesting()->SetTimeSourceForTesting( |
109 make_scoped_ptr(new TestTimeSource(clock_))); | 110 make_scoped_ptr(new TestTimeSource(clock_))); |
110 scheduler_->GetSchedulerHelperForTesting() | 111 scheduler_->GetSchedulerHelperForTesting() |
111 ->GetTaskQueueManagerForTesting() | 112 ->GetTaskQueueManagerForTesting() |
112 ->SetTimeSourceForTesting(make_scoped_ptr(new TestTimeSource(clock_))); | 113 ->SetTimeSourceForTesting(make_scoped_ptr(new TestTimeSource(clock_))); |
113 } | 114 } |
114 | 115 |
115 ~WorkerSchedulerImplTest() override {} | 116 ~WorkerSchedulerImplTest() override {} |
116 | 117 |
117 void TearDown() override { | 118 void TearDown() override { |
118 // Check that all tests stop posting tasks. | 119 // Check that all tests stop posting tasks. |
119 while (mock_task_runner_->RunUntilIdle()) { | 120 while (mock_task_runner_->RunUntilIdle()) { |
120 } | 121 } |
121 } | 122 } |
122 | 123 |
123 void Init() { | 124 void Init() { |
124 scheduler_->Init(); | 125 scheduler_->Init(); |
125 default_task_runner_ = scheduler_->DefaultTaskRunner(); | 126 default_task_runner_ = scheduler_->DefaultTaskRunner(); |
126 idle_task_runner_ = scheduler_->IdleTaskRunner(); | 127 idle_task_runner_ = scheduler_->IdleTaskRunner(); |
127 timeline_ = nullptr; | 128 timeline_ = nullptr; |
128 } | 129 } |
129 | 130 |
130 void RecordTimelineEvents(std::vector<std::string>* timeline) { | 131 void RecordTimelineEvents(std::vector<std::string>* timeline) { |
131 timeline_ = timeline; | 132 timeline_ = timeline; |
132 scheduler_->RecordTimelineEvents(timeline); | 133 scheduler_->RecordTimelineEvents(timeline); |
133 } | 134 } |
134 | 135 |
135 void RunUntilIdle() { | 136 void RunUntilIdle() { |
136 if (timeline_) { | 137 if (timeline_) { |
137 timeline_->push_back(base::StringPrintf("RunUntilIdle begin @ %d", | 138 timeline_->push_back(base::StringPrintf( |
138 TimeTicksToIntMs(clock_->Now()))); | 139 "RunUntilIdle begin @ %d", TimeTicksToIntMs(clock_->NowTicks()))); |
139 } | 140 } |
140 mock_task_runner_->RunUntilIdle(); | 141 mock_task_runner_->RunUntilIdle(); |
141 if (timeline_) { | 142 if (timeline_) { |
142 timeline_->push_back(base::StringPrintf("RunUntilIdle end @ %d", | 143 timeline_->push_back(base::StringPrintf( |
143 TimeTicksToIntMs(clock_->Now()))); | 144 "RunUntilIdle end @ %d", TimeTicksToIntMs(clock_->NowTicks()))); |
144 } | 145 } |
145 } | 146 } |
146 | 147 |
147 void InitAndPostDelayedWakeupTask() { | 148 void InitAndPostDelayedWakeupTask() { |
148 Init(); | 149 Init(); |
149 // WorkerSchedulerImpl::Init causes a delayed task to be posted on the | 150 // WorkerSchedulerImpl::Init causes a delayed task to be posted on the |
150 // after wakeup control runner. We need a task to wake the system up | 151 // after wakeup control runner. We need a task to wake the system up |
151 // AFTER the delay for this has expired. | 152 // AFTER the delay for this has expired. |
152 default_task_runner_->PostDelayedTask( | 153 default_task_runner_->PostDelayedTask( |
153 FROM_HERE, base::Bind(&WakeUpTask, base::Unretained(timeline_), | 154 FROM_HERE, base::Bind(&WakeUpTask, base::Unretained(timeline_), |
154 base::Unretained(clock_.get())), | 155 base::Unretained(clock_)), |
155 base::TimeDelta::FromMilliseconds(100)); | 156 base::TimeDelta::FromMilliseconds(100)); |
156 } | 157 } |
157 | 158 |
158 // Helper for posting several tasks of specific types. |task_descriptor| is a | 159 // Helper for posting several tasks of specific types. |task_descriptor| is a |
159 // string with space delimited task identifiers. The first letter of each | 160 // string with space delimited task identifiers. The first letter of each |
160 // task identifier specifies the task type: | 161 // task identifier specifies the task type: |
161 // - 'D': Default task | 162 // - 'D': Default task |
162 // - 'I': Idle task | 163 // - 'I': Idle task |
163 void PostTestTasks(std::vector<std::string>* run_order, | 164 void PostTestTasks(std::vector<std::string>* run_order, |
164 const std::string& task_descriptor) { | 165 const std::string& task_descriptor) { |
(...skipping 16 matching lines...) Expand all Loading... | |
181 } | 182 } |
182 } | 183 } |
183 } | 184 } |
184 | 185 |
185 static base::TimeDelta maximum_idle_period_duration() { | 186 static base::TimeDelta maximum_idle_period_duration() { |
186 return base::TimeDelta::FromMilliseconds( | 187 return base::TimeDelta::FromMilliseconds( |
187 IdleHelper::kMaximumIdlePeriodMillis); | 188 IdleHelper::kMaximumIdlePeriodMillis); |
188 } | 189 } |
189 | 190 |
190 protected: | 191 protected: |
191 scoped_refptr<cc::TestNowSource> clock_; | 192 base::SimpleTestTickClock* clock_; |
Sami
2015/05/29 14:00:58
Ditto about scoped_ptr.
Ankur Verma
2015/06/03 14:56:10
Done.
| |
192 // Only one of mock_task_runner_ or message_loop_ will be set. | 193 // Only one of mock_task_runner_ or message_loop_ will be set. |
193 scoped_refptr<cc::OrderedSimpleTaskRunner> mock_task_runner_; | 194 scoped_refptr<cc::OrderedSimpleTaskRunner> mock_task_runner_; |
194 | 195 |
195 scoped_refptr<NestableSingleThreadTaskRunner> nestable_task_runner_; | 196 scoped_refptr<NestableSingleThreadTaskRunner> nestable_task_runner_; |
196 scoped_ptr<WorkerSchedulerImplForTest> scheduler_; | 197 scoped_ptr<WorkerSchedulerImplForTest> scheduler_; |
197 scoped_refptr<base::SingleThreadTaskRunner> default_task_runner_; | 198 scoped_refptr<base::SingleThreadTaskRunner> default_task_runner_; |
198 scoped_refptr<SingleThreadIdleTaskRunner> idle_task_runner_; | 199 scoped_refptr<SingleThreadIdleTaskRunner> idle_task_runner_; |
199 std::vector<std::string>* timeline_; // NOT OWNED | 200 std::vector<std::string>* timeline_; // NOT OWNED |
200 | 201 |
201 DISALLOW_COPY_AND_ASSIGN(WorkerSchedulerImplTest); | 202 DISALLOW_COPY_AND_ASSIGN(WorkerSchedulerImplTest); |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
277 | 278 |
278 TEST_F(WorkerSchedulerImplTest, TestIdleDeadlineWithPendingDelayedTask) { | 279 TEST_F(WorkerSchedulerImplTest, TestIdleDeadlineWithPendingDelayedTask) { |
279 std::vector<std::string> timeline; | 280 std::vector<std::string> timeline; |
280 RecordTimelineEvents(&timeline); | 281 RecordTimelineEvents(&timeline); |
281 InitAndPostDelayedWakeupTask(); | 282 InitAndPostDelayedWakeupTask(); |
282 | 283 |
283 timeline.push_back("Post delayed and idle tasks"); | 284 timeline.push_back("Post delayed and idle tasks"); |
284 // Post a delayed task timed to occur mid way during the long idle period. | 285 // Post a delayed task timed to occur mid way during the long idle period. |
285 default_task_runner_->PostDelayedTask( | 286 default_task_runner_->PostDelayedTask( |
286 FROM_HERE, base::Bind(&RecordTimelineTask, base::Unretained(&timeline), | 287 FROM_HERE, base::Bind(&RecordTimelineTask, base::Unretained(&timeline), |
287 base::Unretained(clock_.get())), | 288 base::Unretained(clock_)), |
288 base::TimeDelta::FromMilliseconds(420)); | 289 base::TimeDelta::FromMilliseconds(420)); |
289 idle_task_runner_->PostIdleTask(FROM_HERE, | 290 idle_task_runner_->PostIdleTask(FROM_HERE, |
290 base::Bind(&TimelineIdleTestTask, &timeline)); | 291 base::Bind(&TimelineIdleTestTask, &timeline)); |
291 | 292 |
292 RunUntilIdle(); | 293 RunUntilIdle(); |
293 | 294 |
294 std::string expected_timeline[] = { | 295 std::string expected_timeline[] = { |
295 "CanEnterLongIdlePeriod @ 5", | 296 "CanEnterLongIdlePeriod @ 5", |
296 "Post delayed and idle tasks", | 297 "Post delayed and idle tasks", |
297 "IsNotQuiescent @ 105", | 298 "IsNotQuiescent @ 105", |
298 "CanEnterLongIdlePeriod @ 405", | 299 "CanEnterLongIdlePeriod @ 405", |
299 "run TimelineIdleTestTask deadline 425", // Note the short 20ms deadline. | 300 "run TimelineIdleTestTask deadline 425", // Note the short 20ms deadline. |
300 "CanEnterLongIdlePeriod @ 425", | 301 "CanEnterLongIdlePeriod @ 425", |
301 "run RecordTimelineTask @ 425"}; | 302 "run RecordTimelineTask @ 425"}; |
302 | 303 |
303 EXPECT_THAT(timeline, ElementsAreArray(expected_timeline)); | 304 EXPECT_THAT(timeline, ElementsAreArray(expected_timeline)); |
304 } | 305 } |
305 | 306 |
306 TEST_F(WorkerSchedulerImplTest, | 307 TEST_F(WorkerSchedulerImplTest, |
307 TestIdleDeadlineWithPendingDelayedTaskFarInTheFuture) { | 308 TestIdleDeadlineWithPendingDelayedTaskFarInTheFuture) { |
308 std::vector<std::string> timeline; | 309 std::vector<std::string> timeline; |
309 RecordTimelineEvents(&timeline); | 310 RecordTimelineEvents(&timeline); |
310 InitAndPostDelayedWakeupTask(); | 311 InitAndPostDelayedWakeupTask(); |
311 | 312 |
312 timeline.push_back("Post delayed and idle tasks"); | 313 timeline.push_back("Post delayed and idle tasks"); |
313 // Post a delayed task timed to occur well after the long idle period. | 314 // Post a delayed task timed to occur well after the long idle period. |
314 default_task_runner_->PostDelayedTask( | 315 default_task_runner_->PostDelayedTask( |
315 FROM_HERE, base::Bind(&RecordTimelineTask, base::Unretained(&timeline), | 316 FROM_HERE, base::Bind(&RecordTimelineTask, base::Unretained(&timeline), |
316 base::Unretained(clock_.get())), | 317 base::Unretained(clock_)), |
317 base::TimeDelta::FromMilliseconds(1000)); | 318 base::TimeDelta::FromMilliseconds(1000)); |
318 idle_task_runner_->PostIdleTask(FROM_HERE, | 319 idle_task_runner_->PostIdleTask(FROM_HERE, |
319 base::Bind(&TimelineIdleTestTask, &timeline)); | 320 base::Bind(&TimelineIdleTestTask, &timeline)); |
320 | 321 |
321 RunUntilIdle(); | 322 RunUntilIdle(); |
322 | 323 |
323 std::string expected_timeline[] = { | 324 std::string expected_timeline[] = { |
324 "CanEnterLongIdlePeriod @ 5", | 325 "CanEnterLongIdlePeriod @ 5", |
325 "Post delayed and idle tasks", | 326 "Post delayed and idle tasks", |
326 "IsNotQuiescent @ 105", | 327 "IsNotQuiescent @ 105", |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
375 | 376 |
376 std::vector<std::string> timeline; | 377 std::vector<std::string> timeline; |
377 RecordTimelineEvents(&timeline); | 378 RecordTimelineEvents(&timeline); |
378 | 379 |
379 // The scheduler should not run the initiate_next_long_idle_period task if | 380 // The scheduler should not run the initiate_next_long_idle_period task if |
380 // there are no idle tasks and no other task woke up the scheduler, thus | 381 // there are no idle tasks and no other task woke up the scheduler, thus |
381 // the idle period deadline shouldn't update at the end of the current long | 382 // the idle period deadline shouldn't update at the end of the current long |
382 // idle period. | 383 // idle period. |
383 base::TimeTicks idle_period_deadline = | 384 base::TimeTicks idle_period_deadline = |
384 scheduler_->CurrentIdleTaskDeadlineForTesting(); | 385 scheduler_->CurrentIdleTaskDeadlineForTesting(); |
385 clock_->AdvanceNow(maximum_idle_period_duration()); | 386 clock_->Advance(maximum_idle_period_duration()); |
386 RunUntilIdle(); | 387 RunUntilIdle(); |
387 | 388 |
388 base::TimeTicks new_idle_period_deadline = | 389 base::TimeTicks new_idle_period_deadline = |
389 scheduler_->CurrentIdleTaskDeadlineForTesting(); | 390 scheduler_->CurrentIdleTaskDeadlineForTesting(); |
390 EXPECT_EQ(idle_period_deadline, new_idle_period_deadline); | 391 EXPECT_EQ(idle_period_deadline, new_idle_period_deadline); |
391 | 392 |
392 // Posting a after-wakeup idle task also shouldn't wake the scheduler or | 393 // Posting a after-wakeup idle task also shouldn't wake the scheduler or |
393 // initiate the next long idle period. | 394 // initiate the next long idle period. |
394 timeline.push_back("PostIdleTaskAfterWakeup"); | 395 timeline.push_back("PostIdleTaskAfterWakeup"); |
395 idle_task_runner_->PostIdleTaskAfterWakeup( | 396 idle_task_runner_->PostIdleTaskAfterWakeup( |
396 FROM_HERE, base::Bind(&TimelineIdleTestTask, &timeline)); | 397 FROM_HERE, base::Bind(&TimelineIdleTestTask, &timeline)); |
397 RunUntilIdle(); | 398 RunUntilIdle(); |
398 new_idle_period_deadline = scheduler_->CurrentIdleTaskDeadlineForTesting(); | 399 new_idle_period_deadline = scheduler_->CurrentIdleTaskDeadlineForTesting(); |
399 | 400 |
400 // Running a normal task should initiate a new long idle period after waiting | 401 // Running a normal task should initiate a new long idle period after waiting |
401 // 300ms for quiescence. | 402 // 300ms for quiescence. |
402 timeline.push_back("Post RecordTimelineTask"); | 403 timeline.push_back("Post RecordTimelineTask"); |
403 default_task_runner_->PostTask( | 404 default_task_runner_->PostTask( |
404 FROM_HERE, base::Bind(&RecordTimelineTask, base::Unretained(&timeline), | 405 FROM_HERE, base::Bind(&RecordTimelineTask, base::Unretained(&timeline), |
405 base::Unretained(clock_.get()))); | 406 base::Unretained(clock_))); |
406 RunUntilIdle(); | 407 RunUntilIdle(); |
407 | 408 |
408 std::string expected_timeline[] = { | 409 std::string expected_timeline[] = { |
409 "RunUntilIdle begin @ 55", | 410 "RunUntilIdle begin @ 55", |
410 "RunUntilIdle end @ 55", | 411 "RunUntilIdle end @ 55", |
411 "PostIdleTaskAfterWakeup", | 412 "PostIdleTaskAfterWakeup", |
412 "RunUntilIdle begin @ 55", // NOTE idle task doesn't run till later. | 413 "RunUntilIdle begin @ 55", // NOTE idle task doesn't run till later. |
413 "RunUntilIdle end @ 55", | 414 "RunUntilIdle end @ 55", |
414 "Post RecordTimelineTask", | 415 "Post RecordTimelineTask", |
415 "RunUntilIdle begin @ 55", | 416 "RunUntilIdle begin @ 55", |
416 "run RecordTimelineTask @ 55", | 417 "run RecordTimelineTask @ 55", |
417 "IsNotQuiescent @ 55", // NOTE we have to wait for quiescence. | 418 "IsNotQuiescent @ 55", // NOTE we have to wait for quiescence. |
418 "CanEnterLongIdlePeriod @ 355", | 419 "CanEnterLongIdlePeriod @ 355", |
419 "run TimelineIdleTestTask deadline 405", | 420 "run TimelineIdleTestTask deadline 405", |
420 "CanEnterLongIdlePeriod @ 405", | 421 "CanEnterLongIdlePeriod @ 405", |
421 "RunUntilIdle end @ 455"}; | 422 "RunUntilIdle end @ 455"}; |
422 | 423 |
423 EXPECT_THAT(timeline, ElementsAreArray(expected_timeline)); | 424 EXPECT_THAT(timeline, ElementsAreArray(expected_timeline)); |
424 } | 425 } |
425 | 426 |
426 } // namespace scheduler | 427 } // namespace scheduler |
OLD | NEW |