| 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" | 10 #include "base/debug/trace_event.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 namespace { | 52 namespace { |
| 53 | 53 |
| 54 class FakeSchedulerClient; | 54 class FakeSchedulerClient; |
| 55 | 55 |
| 56 class FakeSchedulerClient : public SchedulerClient { | 56 class FakeSchedulerClient : public SchedulerClient { |
| 57 public: | 57 public: |
| 58 class FakeExternalBeginFrameSource : public BeginFrameSourceMixIn { | 58 class FakeExternalBeginFrameSource : public BeginFrameSourceMixIn { |
| 59 public: | 59 public: |
| 60 explicit FakeExternalBeginFrameSource(FakeSchedulerClient* client) | 60 explicit FakeExternalBeginFrameSource(FakeSchedulerClient* client) |
| 61 : client_(client) {} | 61 : client_(client) {} |
| 62 virtual ~FakeExternalBeginFrameSource() {} | 62 ~FakeExternalBeginFrameSource() override {} |
| 63 | 63 |
| 64 void OnNeedsBeginFramesChange(bool needs_begin_frames) override { | 64 void OnNeedsBeginFramesChange(bool needs_begin_frames) override { |
| 65 if (needs_begin_frames) { | 65 if (needs_begin_frames) { |
| 66 client_->PushAction("SetNeedsBeginFrames(true)"); | 66 client_->PushAction("SetNeedsBeginFrames(true)"); |
| 67 } else { | 67 } else { |
| 68 client_->PushAction("SetNeedsBeginFrames(false)"); | 68 client_->PushAction("SetNeedsBeginFrames(false)"); |
| 69 } | 69 } |
| 70 client_->states_.push_back(client_->scheduler_->AsValue()); | 70 client_->states_.push_back(client_->scheduler_->AsValue()); |
| 71 } | 71 } |
| 72 | 72 |
| (...skipping 2122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2195 | 2195 |
| 2196 // Deadline task is pending | 2196 // Deadline task is pending |
| 2197 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); | 2197 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); |
| 2198 client.task_runner().RunPendingTasks(); | 2198 client.task_runner().RunPendingTasks(); |
| 2199 // Deadline task runs immediately | 2199 // Deadline task runs immediately |
| 2200 EXPECT_FALSE(scheduler->BeginImplFrameDeadlinePending()); | 2200 EXPECT_FALSE(scheduler->BeginImplFrameDeadlinePending()); |
| 2201 } | 2201 } |
| 2202 | 2202 |
| 2203 } // namespace | 2203 } // namespace |
| 2204 } // namespace cc | 2204 } // namespace cc |
| OLD | NEW |