Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(663)

Side by Side Diff: cc/surfaces/display_scheduler_unittest.cc

Issue 2565783002: Moves ownership of the cc::Display's BeginFrameSource out of Display. (Closed)
Patch Set: rebase. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/surfaces/display_scheduler.cc ('k') | cc/surfaces/display_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 27 matching lines...) Expand all
38 38
39 protected: 39 protected:
40 int draw_and_swap_count_; 40 int draw_and_swap_count_;
41 }; 41 };
42 42
43 class TestDisplayScheduler : public DisplayScheduler { 43 class TestDisplayScheduler : public DisplayScheduler {
44 public: 44 public:
45 TestDisplayScheduler(BeginFrameSource* begin_frame_source, 45 TestDisplayScheduler(BeginFrameSource* begin_frame_source,
46 base::SingleThreadTaskRunner* task_runner, 46 base::SingleThreadTaskRunner* task_runner,
47 int max_pending_swaps) 47 int max_pending_swaps)
48 : DisplayScheduler(begin_frame_source, task_runner, max_pending_swaps), 48 : DisplayScheduler(task_runner, max_pending_swaps),
49 scheduler_begin_frame_deadline_count_(0) {} 49 scheduler_begin_frame_deadline_count_(0) {
50 SetBeginFrameSource(begin_frame_source);
51 }
50 52
51 base::TimeTicks DesiredBeginFrameDeadlineTimeForTest() { 53 base::TimeTicks DesiredBeginFrameDeadlineTimeForTest() {
52 return DesiredBeginFrameDeadlineTime(); 54 return DesiredBeginFrameDeadlineTime();
53 } 55 }
54 56
55 void BeginFrameDeadlineForTest() { OnBeginFrameDeadline(); } 57 void BeginFrameDeadlineForTest() { OnBeginFrameDeadline(); }
56 58
57 void ScheduleBeginFrameDeadline() override { 59 void ScheduleBeginFrameDeadline() override {
58 scheduler_begin_frame_deadline_count_++; 60 scheduler_begin_frame_deadline_count_++;
59 DisplayScheduler::ScheduleBeginFrameDeadline(); 61 DisplayScheduler::ScheduleBeginFrameDeadline();
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after
568 570
569 scheduler_.SetRootSurfaceResourcesLocked(true); 571 scheduler_.SetRootSurfaceResourcesLocked(true);
570 EXPECT_EQ(++count, scheduler_.scheduler_begin_frame_deadline_count()); 572 EXPECT_EQ(++count, scheduler_.scheduler_begin_frame_deadline_count());
571 573
572 scheduler_.OutputSurfaceLost(); 574 scheduler_.OutputSurfaceLost();
573 EXPECT_EQ(++count, scheduler_.scheduler_begin_frame_deadline_count()); 575 EXPECT_EQ(++count, scheduler_.scheduler_begin_frame_deadline_count());
574 } 576 }
575 577
576 } // namespace 578 } // namespace
577 } // namespace cc 579 } // namespace cc
OLDNEW
« no previous file with comments | « cc/surfaces/display_scheduler.cc ('k') | cc/surfaces/display_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698