OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 "cc/scheduler/scheduler.h" | 5 #include "cc/scheduler/scheduler.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/debug/trace_event.h" | |
11 #include "base/logging.h" | 10 #include "base/logging.h" |
12 #include "base/memory/scoped_vector.h" | 11 #include "base/memory/scoped_vector.h" |
13 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
14 #include "base/power_monitor/power_monitor.h" | 13 #include "base/power_monitor/power_monitor.h" |
15 #include "base/power_monitor/power_monitor_source.h" | 14 #include "base/power_monitor/power_monitor_source.h" |
16 #include "base/run_loop.h" | 15 #include "base/run_loop.h" |
17 #include "base/time/time.h" | 16 #include "base/time/time.h" |
| 17 #include "base/trace_event/trace_event.h" |
18 #include "cc/test/begin_frame_args_test.h" | 18 #include "cc/test/begin_frame_args_test.h" |
19 #include "cc/test/ordered_simple_task_runner.h" | 19 #include "cc/test/ordered_simple_task_runner.h" |
20 #include "cc/test/scheduler_test_common.h" | 20 #include "cc/test/scheduler_test_common.h" |
21 #include "testing/gmock/include/gmock/gmock.h" | 21 #include "testing/gmock/include/gmock/gmock.h" |
22 #include "testing/gtest/include/gtest/gtest.h" | 22 #include "testing/gtest/include/gtest/gtest.h" |
23 | 23 |
24 #define EXPECT_ACTION(action, client, action_index, expected_num_actions) \ | 24 #define EXPECT_ACTION(action, client, action_index, expected_num_actions) \ |
25 do { \ | 25 do { \ |
26 EXPECT_EQ(expected_num_actions, client.num_actions_()); \ | 26 EXPECT_EQ(expected_num_actions, client.num_actions_()); \ |
27 if (action_index >= 0) { \ | 27 if (action_index >= 0) { \ |
(...skipping 2285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2313 EXPECT_ACTION("ScheduledActionAnimate", client, 1, 2); | 2313 EXPECT_ACTION("ScheduledActionAnimate", client, 1, 2); |
2314 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); | 2314 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); |
2315 EXPECT_TRUE(client.needs_begin_frames()); | 2315 EXPECT_TRUE(client.needs_begin_frames()); |
2316 client.Reset(); | 2316 client.Reset(); |
2317 client.task_runner().RunPendingTasks(); // Run posted deadline. | 2317 client.task_runner().RunPendingTasks(); // Run posted deadline. |
2318 EXPECT_ACTION("ScheduledActionDrawAndSwapIfPossible", client, 0, 1); | 2318 EXPECT_ACTION("ScheduledActionDrawAndSwapIfPossible", client, 0, 1); |
2319 } | 2319 } |
2320 | 2320 |
2321 } // namespace | 2321 } // namespace |
2322 } // namespace cc | 2322 } // namespace cc |
OLD | NEW |