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

Unified Diff: cc/scheduler/scheduler_unittest.cc

Issue 2832503005: Revert "cc: Make scheduler run incoming frame after previous deadline." (Closed)
Patch Set: Created 3 years, 8 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.cc ('k') | no next file » | 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 82446ad72204d04d6600419978869d0f8d37434f..72e31f537359a3315308a014740cababa0e09afd 100644
--- a/cc/scheduler/scheduler_unittest.cc
+++ b/cc/scheduler/scheduler_unittest.cc
@@ -397,13 +397,9 @@ class SchedulerTest : public testing::Test {
// it will be already in the task queue.
if (scheduler_->begin_frame_source() ==
fake_external_begin_frame_source_.get()) {
- // Run pending task for previous deadline first.
- task_runner_->RunPendingTasks();
EXPECT_TRUE(scheduler_->begin_frames_expected());
SendNextBeginFrame();
} else {
- // Begin frame might be queued up and posted after the previous deadline
- // runs so run tasks until we get to the next frame.
task_runner_->RunTasksWhile(client_->FrameHasNotAdvancedCallback());
}
}
@@ -3514,11 +3510,10 @@ TEST_F(SchedulerTest, BeginFrameAckForBeginFrameBeforeLastDeadline) {
client_->Reset();
// Send the next BeginFrame before the previous one's deadline was executed.
- // This will wait for the previous deadline after which no further BeginFrames
- // will be needed, and the new BeginFrame should be dropped.
+ // This should trigger the previous BeginFrame's deadline synchronously,
+ // during which tiles will be prepared. As a result of that, no further
+ // BeginFrames will be needed, and the new BeginFrame should be dropped.
BeginFrameArgs args = SendNextBeginFrame();
-
- task_runner().RunPendingTasks(); // Run posted deadline.
EXPECT_ACTION("ScheduledActionPrepareTiles", client_, 0, 3);
EXPECT_ACTION("RemoveObserver(this)", client_, 1, 3);
EXPECT_ACTION("SendBeginMainFrameNotExpectedSoon", client_, 2, 3);
@@ -3685,60 +3680,5 @@ TEST_F(SchedulerTest,
fake_external_begin_frame_source_->LastAckForObserver(scheduler_.get()));
}
-TEST_F(SchedulerTest, BeginFrameWhilePreviousDeadlinePending) {
- SetUpScheduler(EXTERNAL_BFS);
-
- scheduler_->SetNeedsRedraw();
-
- client_->Reset();
- EXPECT_SCOPED(AdvanceFrame());
- EXPECT_SINGLE_ACTION("WillBeginImplFrame", client_);
-
- // Do not run pending deadline but send a new begin frame. The begin frame is
- // saved and run when the previous frame is over.
- client_->Reset();
- SendNextBeginFrame();
- EXPECT_NO_ACTION(client_);
-
- task_runner_->RunPendingTasks();
- EXPECT_SINGLE_ACTION("ScheduledActionDrawIfPossible", client_);
-
- // The saved begin frame is posted as a task.
- client_->Reset();
- task_runner_->RunPendingTasks();
- EXPECT_SINGLE_ACTION("WillBeginImplFrame", client_);
-}
-
-TEST_F(SchedulerTest, IncomingBeginFrameReplacesSavedBeginFrame) {
- SetUpScheduler(EXTERNAL_BFS);
-
- scheduler_->SetNeedsRedraw();
-
- client_->Reset();
- EXPECT_SCOPED(AdvanceFrame());
- EXPECT_SINGLE_ACTION("WillBeginImplFrame", client_);
-
- // Send two BeginFrames while deadline is pending.
- client_->Reset();
- SendNextBeginFrame();
- EXPECT_NO_ACTION(client_);
-
- SendNextBeginFrame();
- EXPECT_NO_ACTION(client_);
-
- task_runner_->RunPendingTasks();
- EXPECT_SINGLE_ACTION("ScheduledActionDrawIfPossible", client_);
-
- // Only the last BeginFrame runs.
- client_->Reset();
- task_runner_->RunPendingTasks();
- EXPECT_SINGLE_ACTION("WillBeginImplFrame", client_);
-
- client_->Reset();
- task_runner_->RunPendingTasks();
- EXPECT_ACTION("RemoveObserver(this)", client_, 0, 2);
- EXPECT_ACTION("SendBeginMainFrameNotExpectedSoon", client_, 1, 2);
-}
-
} // namespace
} // namespace cc
« no previous file with comments | « cc/scheduler/scheduler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698