| 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/renderer/webthread_impl_for_renderer_scheduler.h" | 5 #include "components/scheduler/renderer/webthread_impl_for_renderer_scheduler.h" |
| 6 | 6 |
| 7 #include "base/location.h" |
| 7 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "base/single_thread_task_runner.h" |
| 8 #include "components/scheduler/child/scheduler_message_loop_delegate.h" | 10 #include "components/scheduler/child/scheduler_message_loop_delegate.h" |
| 9 #include "components/scheduler/renderer/renderer_scheduler_impl.h" | 11 #include "components/scheduler/renderer/renderer_scheduler_impl.h" |
| 10 #include "testing/gmock/include/gmock/gmock.h" | 12 #include "testing/gmock/include/gmock/gmock.h" |
| 11 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 12 #include "third_party/WebKit/public/platform/WebTraceLocation.h" | 14 #include "third_party/WebKit/public/platform/WebTraceLocation.h" |
| 13 | 15 |
| 14 namespace scheduler { | 16 namespace scheduler { |
| 15 namespace { | 17 namespace { |
| 16 | 18 |
| 17 const int kWorkBatchSize = 2; | 19 const int kWorkBatchSize = 2; |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 // A pair for ExitRunLoopTask. | 190 // A pair for ExitRunLoopTask. |
| 189 EXPECT_CALL(observer, willProcessTask()); | 191 EXPECT_CALL(observer, willProcessTask()); |
| 190 EXPECT_CALL(observer, didProcessTask()); | 192 EXPECT_CALL(observer, didProcessTask()); |
| 191 | 193 |
| 192 // A final callback for EnterRunLoop. | 194 // A final callback for EnterRunLoop. |
| 193 EXPECT_CALL(observer, didProcessTask()); | 195 EXPECT_CALL(observer, didProcessTask()); |
| 194 | 196 |
| 195 EatDefaultTask(&observer); | 197 EatDefaultTask(&observer); |
| 196 } | 198 } |
| 197 | 199 |
| 198 message_loop_.PostTask( | 200 message_loop_.task_runner()->PostTask( |
| 199 FROM_HERE, base::Bind(&EnterRunLoop, base::Unretained(&message_loop_), | 201 FROM_HERE, base::Bind(&EnterRunLoop, base::Unretained(&message_loop_), |
| 200 base::Unretained(&thread_))); | 202 base::Unretained(&thread_))); |
| 201 message_loop_.RunUntilIdle(); | 203 message_loop_.RunUntilIdle(); |
| 202 thread_.removeTaskObserver(&observer); | 204 thread_.removeTaskObserver(&observer); |
| 203 } | 205 } |
| 204 | 206 |
| 205 } // namespace scheduler | 207 } // namespace scheduler |
| OLD | NEW |