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

Side by Side Diff: cc/scheduler/scheduler_unittest.cc

Issue 1127313003: Revert of cc: Adding BeginFrameTracker object and removing Now() from LTHI. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months 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/scheduler/scheduler.cc ('k') | cc/test/fake_layer_tree_host_impl.h » ('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 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 2600 matching lines...) Expand 10 before | Expand all | Expand 10 after
2611 EXPECT_NO_ACTION(client_); 2611 EXPECT_NO_ACTION(client_);
2612 2612
2613 // Allow new commit even though previous commit hasn't been drawn. 2613 // Allow new commit even though previous commit hasn't been drawn.
2614 scheduler_->NotifyReadyToCommit(); 2614 scheduler_->NotifyReadyToCommit();
2615 EXPECT_SINGLE_ACTION("ScheduledActionCommit", client_); 2615 EXPECT_SINGLE_ACTION("ScheduledActionCommit", client_);
2616 client_->Reset(); 2616 client_->Reset();
2617 } 2617 }
2618 2618
2619 TEST_F(SchedulerTest, AuthoritativeVSyncInterval) { 2619 TEST_F(SchedulerTest, AuthoritativeVSyncInterval) {
2620 SetUpScheduler(true); 2620 SetUpScheduler(true);
2621 base::TimeDelta initial_interval = scheduler_->BeginImplFrameInterval(); 2621
2622 base::TimeDelta initial_interval =
2623 scheduler_->begin_impl_frame_args().interval;
2622 base::TimeDelta authoritative_interval = 2624 base::TimeDelta authoritative_interval =
2623 base::TimeDelta::FromMilliseconds(33); 2625 base::TimeDelta::FromMilliseconds(33);
2624 2626
2625 scheduler_->SetNeedsCommit(); 2627 scheduler_->SetNeedsCommit();
2626 EXPECT_SCOPED(AdvanceFrame()); 2628 EXPECT_SCOPED(AdvanceFrame());
2627 2629
2628 EXPECT_EQ(initial_interval, scheduler_->BeginImplFrameInterval()); 2630 EXPECT_EQ(initial_interval, scheduler_->begin_impl_frame_args().interval);
2629 2631
2630 scheduler_->NotifyBeginMainFrameStarted(); 2632 scheduler_->NotifyBeginMainFrameStarted();
2631 scheduler_->NotifyReadyToCommit(); 2633 scheduler_->NotifyReadyToCommit();
2632 task_runner().RunTasksWhile(client_->ImplFrameDeadlinePending(true)); 2634 task_runner().RunTasksWhile(client_->ImplFrameDeadlinePending(true));
2633 2635
2634 scheduler_->SetAuthoritativeVSyncInterval(authoritative_interval); 2636 scheduler_->SetAuthoritativeVSyncInterval(authoritative_interval);
2635 2637
2636 EXPECT_SCOPED(AdvanceFrame()); 2638 EXPECT_SCOPED(AdvanceFrame());
2637 2639
2638 // At the next BeginFrame, authoritative interval is used instead of previous 2640 // At the next BeginFrame, authoritative interval is used instead of previous
2639 // interval. 2641 // interval.
2640 EXPECT_NE(initial_interval, scheduler_->BeginImplFrameInterval()); 2642 EXPECT_NE(initial_interval, scheduler_->begin_impl_frame_args().interval);
2641 EXPECT_EQ(authoritative_interval, scheduler_->BeginImplFrameInterval()); 2643 EXPECT_EQ(authoritative_interval,
2644 scheduler_->begin_impl_frame_args().interval);
2642 } 2645 }
2643 2646
2644 } // namespace 2647 } // namespace
2645 } // namespace cc 2648 } // namespace cc
OLDNEW
« no previous file with comments | « cc/scheduler/scheduler.cc ('k') | cc/test/fake_layer_tree_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698