OLD | NEW |
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/test/fake_web_task_runner.h" | 5 #include "platform/scheduler/test/fake_web_task_runner.h" |
6 | 6 |
7 #include <deque> | 7 #include <deque> |
8 | 8 |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 void FakeWebTaskRunner::runUntilIdle() { | 108 void FakeWebTaskRunner::runUntilIdle() { |
109 while (!data_->task_queue_.empty()) { | 109 while (!data_->task_queue_.empty()) { |
110 // Move the task to run into a local variable in case it touches the | 110 // Move the task to run into a local variable in case it touches the |
111 // task queue by posting a new task. | 111 // task queue by posting a new task. |
112 base::Closure task = std::move(data_->task_queue_.front()); | 112 base::Closure task = std::move(data_->task_queue_.front()); |
113 data_->task_queue_.pop_front(); | 113 data_->task_queue_.pop_front(); |
114 task.Run(); | 114 task.Run(); |
115 } | 115 } |
116 } | 116 } |
117 | 117 |
| 118 std::deque<base::Closure> FakeWebTaskRunner::takePendingTasksForTesting() { |
| 119 return std::move(data_->task_queue_); |
| 120 } |
| 121 |
118 } // namespace scheduler | 122 } // namespace scheduler |
119 } // namespace blink | 123 } // namespace blink |
OLD | NEW |