| 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 "cc/surfaces/display_scheduler.h" | 5 #include "cc/surfaces/display_scheduler.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/test/null_task_runner.h" | 8 #include "base/test/null_task_runner.h" |
| 9 #include "base/test/simple_test_tick_clock.h" | 9 #include "base/test/simple_test_tick_clock.h" |
| 10 #include "base/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 } | 63 } |
| 64 | 64 |
| 65 protected: | 65 protected: |
| 66 int scheduler_begin_frame_deadline_count_; | 66 int scheduler_begin_frame_deadline_count_; |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 class DisplaySchedulerTest : public testing::Test { | 69 class DisplaySchedulerTest : public testing::Test { |
| 70 public: | 70 public: |
| 71 DisplaySchedulerTest() : now_src_(new base::SimpleTestTickClock()) { | 71 DisplaySchedulerTest() : now_src_(new base::SimpleTestTickClock()) { |
| 72 const int max_pending_swaps = 1; | 72 const int max_pending_swaps = 1; |
| 73 now_src_->Advance(base::TimeDelta::FromMicroseconds(10000)); | |
| 74 null_task_runner_ = make_scoped_refptr(new base::NullTaskRunner); | 73 null_task_runner_ = make_scoped_refptr(new base::NullTaskRunner); |
| 75 client_ = make_scoped_ptr(new FakeDisplaySchedulerClient); | 74 client_ = make_scoped_ptr(new FakeDisplaySchedulerClient); |
| 76 scheduler_ = make_scoped_ptr( | 75 scheduler_ = make_scoped_ptr( |
| 77 new TestDisplayScheduler(client_.get(), &fake_begin_frame_source_, | 76 new TestDisplayScheduler(client_.get(), &fake_begin_frame_source_, |
| 78 null_task_runner_, max_pending_swaps)); | 77 null_task_runner_, max_pending_swaps)); |
| 79 } | 78 } |
| 80 | 79 |
| 81 ~DisplaySchedulerTest() override {} | 80 ~DisplaySchedulerTest() override {} |
| 82 | 81 |
| 83 void SetUp() override { scheduler_->SetRootSurfaceResourcesLocked(false); } | 82 void SetUp() override { scheduler_->SetRootSurfaceResourcesLocked(false); } |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 | 334 |
| 336 scheduler_->SetRootSurfaceResourcesLocked(true); | 335 scheduler_->SetRootSurfaceResourcesLocked(true); |
| 337 EXPECT_EQ(count++, scheduler_->scheduler_begin_frame_deadline_count()); | 336 EXPECT_EQ(count++, scheduler_->scheduler_begin_frame_deadline_count()); |
| 338 | 337 |
| 339 scheduler_->OutputSurfaceLost(); | 338 scheduler_->OutputSurfaceLost(); |
| 340 EXPECT_EQ(count++, scheduler_->scheduler_begin_frame_deadline_count()); | 339 EXPECT_EQ(count++, scheduler_->scheduler_begin_frame_deadline_count()); |
| 341 } | 340 } |
| 342 | 341 |
| 343 } // namespace | 342 } // namespace |
| 344 } // namespace cc | 343 } // namespace cc |
| OLD | NEW |