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

Unified Diff: cc/scheduler/scheduler_unittest.cc

Issue 1247033007: cc: Abort frame when becoming invisible and waiting for ready to draw. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove race from test Created 5 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/scheduler/scheduler_state_machine.cc ('k') | cc/trees/layer_tree_host_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/scheduler/scheduler_unittest.cc
diff --git a/cc/scheduler/scheduler_unittest.cc b/cc/scheduler/scheduler_unittest.cc
index a3a6c55da360f7c9953ec3776c91933c71f70d07..9a19ce8e05aa008854865ee6480cb89cdacb3974 100644
--- a/cc/scheduler/scheduler_unittest.cc
+++ b/cc/scheduler/scheduler_unittest.cc
@@ -312,6 +312,7 @@ class SchedulerTest : public testing::Test {
scheduler_->NotifyBeginMainFrameStarted();
scheduler_->NotifyReadyToCommit();
scheduler_->NotifyReadyToActivate();
+ scheduler_->NotifyReadyToDraw();
EXPECT_FALSE(scheduler_->CommitPending());
@@ -1247,6 +1248,7 @@ TEST_F(SchedulerTest, WaitForReadyToDrawDoNotPostDeadline) {
SchedulerClientNeedsPrepareTilesInDraw* client =
new SchedulerClientNeedsPrepareTilesInDraw;
scheduler_settings_.use_external_begin_frame_source = true;
+ scheduler_settings_.commit_to_active_tree = true;
SetUpScheduler(make_scoped_ptr(client).Pass(), true);
// SetNeedsCommit should begin the frame on the next BeginImplFrame.
@@ -1268,9 +1270,7 @@ TEST_F(SchedulerTest, WaitForReadyToDrawDoNotPostDeadline) {
scheduler_->NotifyReadyToActivate();
EXPECT_SINGLE_ACTION("ScheduledActionActivateSyncTree", client_);
- // Set scheduler to wait for ready to draw. Schedule won't post deadline in
- // the mode.
- scheduler_->SetWaitForReadyToDraw();
+ // Scheduler won't post deadline in the mode.
client_->Reset();
task_runner().RunPendingTasks(); // Try to run posted deadline.
// There is no posted deadline.
@@ -1288,6 +1288,7 @@ TEST_F(SchedulerTest, WaitForReadyToDrawCancelledWhenLostOutputSurface) {
SchedulerClientNeedsPrepareTilesInDraw* client =
new SchedulerClientNeedsPrepareTilesInDraw;
scheduler_settings_.use_external_begin_frame_source = true;
+ scheduler_settings_.commit_to_active_tree = true;
SetUpScheduler(make_scoped_ptr(client).Pass(), true);
// SetNeedsCommit should begin the frame on the next BeginImplFrame.
@@ -1309,9 +1310,7 @@ TEST_F(SchedulerTest, WaitForReadyToDrawCancelledWhenLostOutputSurface) {
scheduler_->NotifyReadyToActivate();
EXPECT_SINGLE_ACTION("ScheduledActionActivateSyncTree", client_);
- // Set scheduler to wait for ready to draw. Schedule won't post deadline in
- // the mode.
- scheduler_->SetWaitForReadyToDraw();
+ // Scheduler won't post deadline in the mode.
client_->Reset();
task_runner().RunPendingTasks(); // Try to run posted deadline.
// There is no posted deadline.
« no previous file with comments | « cc/scheduler/scheduler_state_machine.cc ('k') | cc/trees/layer_tree_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698