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

Unified Diff: cc/scheduler/scheduler_unittest.cc

Issue 1052103002: Revert of cc: Make scheduling be driven by vsync for android webview. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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/surfaces/display.h » ('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 3daf16a150dcef75b7d6e325fb4d5f9f51d94687..935a80a14064995a5cc7e0f1bcf69fa9da43d928 100644
--- a/cc/scheduler/scheduler_unittest.cc
+++ b/cc/scheduler/scheduler_unittest.cc
@@ -140,10 +140,6 @@
}
void ScheduledActionPrepareTiles() override {
PushAction("ScheduledActionPrepareTiles");
- }
- void ScheduledActionInvalidateOutputSurface() override {
- actions_.push_back("ScheduledActionInvalidateOutputSurface");
- states_.push_back(scheduler_->AsValue());
}
void DidAnticipatedDrawTimeChange(base::TimeTicks) override {
if (log_anticipated_draw_time_change_)
@@ -310,18 +306,12 @@
scheduler_->NotifyBeginMainFrameStarted();
scheduler_->NotifyReadyToCommitThenActivateIfNeeded();
+ // Run the posted deadline task.
+ EXPECT_TRUE(scheduler_->BeginImplFrameDeadlinePending());
+ task_runner_->RunTasksWhile(client_->ImplFrameDeadlinePending(true));
+ EXPECT_FALSE(scheduler_->BeginImplFrameDeadlinePending());
+
EXPECT_FALSE(scheduler_->CommitPending());
-
- if (scheduler_settings_.using_synchronous_renderer_compositor) {
- scheduler_->SetNeedsRedraw();
- scheduler_->OnDrawForOutputSurface();
- } else {
- // Run the posted deadline task.
- EXPECT_TRUE(scheduler_->BeginImplFrameDeadlinePending());
- task_runner_->RunTasksWhile(client_->ImplFrameDeadlinePending(true));
- }
-
- EXPECT_FALSE(scheduler_->BeginImplFrameDeadlinePending());
}
client_->Reset();
@@ -331,12 +321,9 @@
"Run second frame so Scheduler calls SetNeedsBeginFrame(false).");
AdvanceFrame();
- if (!scheduler_settings_.using_synchronous_renderer_compositor) {
- // Run the posted deadline task.
- EXPECT_TRUE(scheduler_->BeginImplFrameDeadlinePending());
- task_runner_->RunTasksWhile(client_->ImplFrameDeadlinePending(true));
- }
-
+ // Run the posted deadline task.
+ EXPECT_TRUE(scheduler_->BeginImplFrameDeadlinePending());
+ task_runner_->RunTasksWhile(client_->ImplFrameDeadlinePending(true));
EXPECT_FALSE(scheduler_->BeginImplFrameDeadlinePending());
}
@@ -361,14 +348,13 @@
if (scheduler_->settings().use_external_begin_frame_source &&
scheduler_->FrameProductionThrottled()) {
SendNextBeginFrame();
- }
-
- if (!scheduler_->settings().using_synchronous_renderer_compositor) {
- // Then run tasks until new deadline is scheduled.
- EXPECT_TRUE(task_runner_->RunTasksWhile(
- client_->ImplFrameDeadlinePending(false)));
EXPECT_TRUE(scheduler_->BeginImplFrameDeadlinePending());
}
+
+ // Then run tasks until new deadline is scheduled.
+ EXPECT_TRUE(
+ task_runner_->RunTasksWhile(client_->ImplFrameDeadlinePending(false)));
+ EXPECT_TRUE(scheduler_->BeginImplFrameDeadlinePending());
}
void SendNextBeginFrame() {
@@ -2283,132 +2269,6 @@
client_->Reset();
}
-TEST_F(SchedulerTest, UsingSynchronousCompositor) {
- scheduler_settings_.using_synchronous_renderer_compositor = true;
- scheduler_settings_.use_external_begin_frame_source = true;
- scheduler_settings_.impl_side_painting = true;
- SetUpScheduler(true);
-
- // Compositor thread initiated input/animation.
- // --------------------------------------------
- scheduler_->SetNeedsAnimate();
- EXPECT_SINGLE_ACTION("SetNeedsBeginFrames(true)", client_);
- client_->Reset();
-
- // Next vsync.
- AdvanceFrame();
- EXPECT_ACTION("WillBeginImplFrame", client_, 0, 3);
- EXPECT_ACTION("ScheduledActionAnimate", client_, 1, 3);
- EXPECT_ACTION("ScheduledActionInvalidateOutputSurface", client_, 2, 3);
- EXPECT_FALSE(scheduler_->BeginImplFrameDeadlinePending());
- client_->Reset();
-
- // Continue with animation.
- scheduler_->SetNeedsAnimate();
- EXPECT_NO_ACTION(client_);
-
- // Android onDraw.
- scheduler_->SetNeedsRedraw();
- scheduler_->OnDrawForOutputSurface();
- EXPECT_SINGLE_ACTION("ScheduledActionDrawAndSwapIfPossible", client_);
- EXPECT_FALSE(scheduler_->BeginImplFrameDeadlinePending());
- client_->Reset();
-
- // Next vsync.
- AdvanceFrame();
- EXPECT_ACTION("WillBeginImplFrame", client_, 0, 3);
- EXPECT_ACTION("ScheduledActionAnimate", client_, 1, 3);
- EXPECT_ACTION("ScheduledActionInvalidateOutputSurface", client_, 2, 3);
- EXPECT_FALSE(scheduler_->BeginImplFrameDeadlinePending());
- client_->Reset();
-
- // Android onDraw.
- scheduler_->SetNeedsRedraw();
- scheduler_->OnDrawForOutputSurface();
- EXPECT_SINGLE_ACTION("ScheduledActionDrawAndSwapIfPossible", client_);
- EXPECT_FALSE(scheduler_->BeginImplFrameDeadlinePending());
- client_->Reset();
-
- // Idle on next vsync.
- AdvanceFrame();
- EXPECT_ACTION("WillBeginImplFrame", client_, 0, 3);
- EXPECT_ACTION("SetNeedsBeginFrames(false)", client_, 1, 3);
- EXPECT_ACTION("SendBeginMainFrameNotExpectedSoon", client_, 2, 3);
- EXPECT_FALSE(scheduler_->BeginImplFrameDeadlinePending());
- client_->Reset();
-
- // Android onDraw after idle.
- // --------------------------
- scheduler_->SetNeedsRedraw();
- scheduler_->OnDrawForOutputSurface();
- EXPECT_ACTION("SetNeedsBeginFrames(true)", client_, 0, 3);
- EXPECT_ACTION("ScheduledActionAnimate", client_, 1, 3);
- EXPECT_ACTION("ScheduledActionDrawAndSwapIfPossible", client_, 2, 3);
- EXPECT_FALSE(scheduler_->BeginImplFrameDeadlinePending());
- client_->Reset();
-
- // Idle on next vsync.
- AdvanceFrame();
- EXPECT_ACTION("WillBeginImplFrame", client_, 0, 3);
- EXPECT_ACTION("SetNeedsBeginFrames(false)", client_, 1, 3);
- EXPECT_ACTION("SendBeginMainFrameNotExpectedSoon", client_, 2, 3);
- EXPECT_FALSE(scheduler_->BeginImplFrameDeadlinePending());
- client_->Reset();
-
- // Main thread initiated activity.
- // -------------------------------
- scheduler_->SetNeedsCommit();
- EXPECT_SINGLE_ACTION("SetNeedsBeginFrames(true)", client_);
- client_->Reset();
-
- // Next vsync.
- AdvanceFrame();
- EXPECT_ACTION("WillBeginImplFrame", client_, 0, 2);
- EXPECT_ACTION("ScheduledActionSendBeginMainFrame", client_, 1, 2);
- EXPECT_FALSE(scheduler_->BeginImplFrameDeadlinePending());
- client_->Reset();
-
- scheduler_->NotifyBeginMainFrameStarted();
- EXPECT_NO_ACTION(client_);
-
- // Next vsync.
- AdvanceFrame();
- EXPECT_SINGLE_ACTION("WillBeginImplFrame", client_);
- EXPECT_FALSE(scheduler_->BeginImplFrameDeadlinePending());
- client_->Reset();
-
- scheduler_->NotifyReadyToCommit();
- EXPECT_SINGLE_ACTION("ScheduledActionCommit", client_);
- client_->Reset();
-
- scheduler_->NotifyReadyToActivate();
- EXPECT_SINGLE_ACTION("ScheduledActionActivateSyncTree", client_);
- client_->Reset();
-
- // Next vsync.
- AdvanceFrame();
- EXPECT_ACTION("WillBeginImplFrame", client_, 0, 3);
- EXPECT_ACTION("ScheduledActionAnimate", client_, 1, 3);
- EXPECT_ACTION("ScheduledActionInvalidateOutputSurface", client_, 2, 3);
- EXPECT_FALSE(scheduler_->BeginImplFrameDeadlinePending());
- client_->Reset();
-
- // Android onDraw.
- scheduler_->SetNeedsRedraw();
- scheduler_->OnDrawForOutputSurface();
- EXPECT_SINGLE_ACTION("ScheduledActionDrawAndSwapIfPossible", client_);
- EXPECT_FALSE(scheduler_->BeginImplFrameDeadlinePending());
- client_->Reset();
-
- // Idle on next vsync.
- AdvanceFrame();
- EXPECT_ACTION("WillBeginImplFrame", client_, 0, 3);
- EXPECT_ACTION("SetNeedsBeginFrames(false)", client_, 1, 3);
- EXPECT_ACTION("SendBeginMainFrameNotExpectedSoon", client_, 2, 3);
- EXPECT_FALSE(scheduler_->BeginImplFrameDeadlinePending());
- client_->Reset();
-}
-
TEST_F(SchedulerTest, AuthoritativeVSyncInterval) {
SetUpScheduler(true);
« no previous file with comments | « cc/scheduler/scheduler_state_machine.cc ('k') | cc/surfaces/display.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698