| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 interval, BeginFrameArgs::NORMAL)); | 94 interval, BeginFrameArgs::NORMAL)); |
| 95 } | 95 } |
| 96 | 96 |
| 97 protected: | 97 protected: |
| 98 base::SimpleTestTickClock& now_src() { return *now_src_; } | 98 base::SimpleTestTickClock& now_src() { return *now_src_; } |
| 99 FakeDisplaySchedulerClient& client() { return *client_; } | 99 FakeDisplaySchedulerClient& client() { return *client_; } |
| 100 DisplayScheduler& scheduler() { return *scheduler_; } | 100 DisplayScheduler& scheduler() { return *scheduler_; } |
| 101 | 101 |
| 102 FakeBeginFrameSource fake_begin_frame_source_; | 102 FakeBeginFrameSource fake_begin_frame_source_; |
| 103 | 103 |
| 104 scoped_ptr<base::SimpleTestTickClock> now_src_; | 104 std::unique_ptr<base::SimpleTestTickClock> now_src_; |
| 105 scoped_refptr<base::NullTaskRunner> task_runner_; | 105 scoped_refptr<base::NullTaskRunner> task_runner_; |
| 106 scoped_ptr<FakeDisplaySchedulerClient> client_; | 106 std::unique_ptr<FakeDisplaySchedulerClient> client_; |
| 107 scoped_ptr<TestDisplayScheduler> scheduler_; | 107 std::unique_ptr<TestDisplayScheduler> scheduler_; |
| 108 }; | 108 }; |
| 109 | 109 |
| 110 TEST_F(DisplaySchedulerTest, ResizeHasLateDeadlineUntilNewRootSurface) { | 110 TEST_F(DisplaySchedulerTest, ResizeHasLateDeadlineUntilNewRootSurface) { |
| 111 SurfaceId root_surface_id1(1); | 111 SurfaceId root_surface_id1(1); |
| 112 SurfaceId root_surface_id2(2); | 112 SurfaceId root_surface_id2(2); |
| 113 SurfaceId sid1(3); | 113 SurfaceId sid1(3); |
| 114 base::TimeTicks late_deadline; | 114 base::TimeTicks late_deadline; |
| 115 | 115 |
| 116 // Go trough an initial BeginFrame cycle with the root surface. | 116 // Go trough an initial BeginFrame cycle with the root surface. |
| 117 BeginFrameForTest(); | 117 BeginFrameForTest(); |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 | 437 |
| 438 scheduler_->SetRootSurfaceResourcesLocked(true); | 438 scheduler_->SetRootSurfaceResourcesLocked(true); |
| 439 EXPECT_EQ(count++, scheduler_->scheduler_begin_frame_deadline_count()); | 439 EXPECT_EQ(count++, scheduler_->scheduler_begin_frame_deadline_count()); |
| 440 | 440 |
| 441 scheduler_->OutputSurfaceLost(); | 441 scheduler_->OutputSurfaceLost(); |
| 442 EXPECT_EQ(count++, scheduler_->scheduler_begin_frame_deadline_count()); | 442 EXPECT_EQ(count++, scheduler_->scheduler_begin_frame_deadline_count()); |
| 443 } | 443 } |
| 444 | 444 |
| 445 } // namespace | 445 } // namespace |
| 446 } // namespace cc | 446 } // namespace cc |
| OLD | NEW |