| 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/logging.h" | 10 #include "base/logging.h" |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 } | 182 } |
| 183 | 183 |
| 184 bool draw_will_happen_; | 184 bool draw_will_happen_; |
| 185 bool swap_will_happen_if_draw_happens_; | 185 bool swap_will_happen_if_draw_happens_; |
| 186 bool automatic_swap_ack_; | 186 bool automatic_swap_ack_; |
| 187 int num_draws_; | 187 int num_draws_; |
| 188 bool log_anticipated_draw_time_change_; | 188 bool log_anticipated_draw_time_change_; |
| 189 bool begin_frame_is_sent_to_children_; | 189 bool begin_frame_is_sent_to_children_; |
| 190 base::TimeTicks posted_begin_impl_frame_deadline_; | 190 base::TimeTicks posted_begin_impl_frame_deadline_; |
| 191 std::vector<const char*> actions_; | 191 std::vector<const char*> actions_; |
| 192 std::vector<scoped_refptr<base::debug::ConvertableToTraceFormat>> states_; | 192 std::vector<scoped_refptr<base::trace_event::ConvertableToTraceFormat>> |
| 193 states_; |
| 193 TestScheduler* scheduler_; | 194 TestScheduler* scheduler_; |
| 194 }; | 195 }; |
| 195 | 196 |
| 196 class FakePowerMonitorSource : public base::PowerMonitorSource { | 197 class FakePowerMonitorSource : public base::PowerMonitorSource { |
| 197 public: | 198 public: |
| 198 FakePowerMonitorSource() {} | 199 FakePowerMonitorSource() {} |
| 199 ~FakePowerMonitorSource() override {} | 200 ~FakePowerMonitorSource() override {} |
| 200 void GeneratePowerStateEvent(bool on_battery_power) { | 201 void GeneratePowerStateEvent(bool on_battery_power) { |
| 201 on_battery_power_impl_ = on_battery_power; | 202 on_battery_power_impl_ = on_battery_power; |
| 202 ProcessPowerEvent(POWER_STATE_EVENT); | 203 ProcessPowerEvent(POWER_STATE_EVENT); |
| (...skipping 2138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2341 EXPECT_ACTION("ScheduledActionAnimate", client_, 1, 2); | 2342 EXPECT_ACTION("ScheduledActionAnimate", client_, 1, 2); |
| 2342 EXPECT_TRUE(scheduler_->BeginImplFrameDeadlinePending()); | 2343 EXPECT_TRUE(scheduler_->BeginImplFrameDeadlinePending()); |
| 2343 EXPECT_TRUE(client_->needs_begin_frames()); | 2344 EXPECT_TRUE(client_->needs_begin_frames()); |
| 2344 client_->Reset(); | 2345 client_->Reset(); |
| 2345 task_runner().RunPendingTasks(); // Run posted deadline. | 2346 task_runner().RunPendingTasks(); // Run posted deadline. |
| 2346 EXPECT_ACTION("ScheduledActionDrawAndSwapIfPossible", client_, 0, 1); | 2347 EXPECT_ACTION("ScheduledActionDrawAndSwapIfPossible", client_, 0, 1); |
| 2347 } | 2348 } |
| 2348 | 2349 |
| 2349 } // namespace | 2350 } // namespace |
| 2350 } // namespace cc | 2351 } // namespace cc |
| OLD | NEW |