| 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/throttling_helper.h" | 5 #include "components/scheduler/renderer/throttling_helper.h" |
| 6 | 6 |
| 7 #include <stddef.h> |
| 8 |
| 7 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/macros.h" |
| 8 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/test/simple_test_tick_clock.h" | 12 #include "base/test/simple_test_tick_clock.h" |
| 10 #include "cc/test/ordered_simple_task_runner.h" | 13 #include "cc/test/ordered_simple_task_runner.h" |
| 11 #include "components/scheduler/base/test_time_source.h" | 14 #include "components/scheduler/base/test_time_source.h" |
| 12 #include "components/scheduler/child/scheduler_tqm_delegate_for_test.h" | 15 #include "components/scheduler/child/scheduler_tqm_delegate_for_test.h" |
| 13 #include "components/scheduler/renderer/renderer_scheduler_impl.h" | 16 #include "components/scheduler/renderer/renderer_scheduler_impl.h" |
| 14 #include "components/scheduler/renderer/web_frame_scheduler_impl.h" | 17 #include "components/scheduler/renderer/web_frame_scheduler_impl.h" |
| 15 #include "components/scheduler/renderer/web_view_scheduler_impl.h" | 18 #include "components/scheduler/renderer/web_view_scheduler_impl.h" |
| 16 #include "testing/gmock/include/gmock/gmock.h" | 19 #include "testing/gmock/include/gmock/gmock.h" |
| 17 #include "testing/gtest/include/gtest/gtest.h" | 20 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 size_t task_count = 0; | 223 size_t task_count = 0; |
| 221 mock_task_runner_->RunTasksWhile( | 224 mock_task_runner_->RunTasksWhile( |
| 222 base::Bind(&MessageLoopTaskCounter, &task_count)); | 225 base::Bind(&MessageLoopTaskCounter, &task_count)); |
| 223 | 226 |
| 224 // NOTE PumpThrottledTasks will always run at least twice because we can only | 227 // NOTE PumpThrottledTasks will always run at least twice because we can only |
| 225 // detect if the queues have become empty before pumping. | 228 // detect if the queues have become empty before pumping. |
| 226 EXPECT_EQ(2u, task_count); | 229 EXPECT_EQ(2u, task_count); |
| 227 } | 230 } |
| 228 | 231 |
| 229 } // namespace scheduler | 232 } // namespace scheduler |
| OLD | NEW |