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

Unified Diff: content/renderer/scheduler/renderer_scheduler_impl_unittest.cc

Issue 692483002: Hook up DidReceiveInputEvent to the blink scheduler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unintended clang format change. Updated a comment Created 6 years, 1 month 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
Index: content/renderer/scheduler/renderer_scheduler_impl_unittest.cc
diff --git a/content/renderer/scheduler/renderer_scheduler_impl_unittest.cc b/content/renderer/scheduler/renderer_scheduler_impl_unittest.cc
index 701a222c71ed724c974382bfff62e9509a68bfe9..687f62a6754167d3968a4abfd0fca63bdfef0c49 100644
--- a/content/renderer/scheduler/renderer_scheduler_impl_unittest.cc
+++ b/content/renderer/scheduler/renderer_scheduler_impl_unittest.cc
@@ -306,6 +306,33 @@ TEST_F(RendererSchedulerImplTest, TestCompositorPolicy) {
std::string("I1")));
}
+TEST_F(RendererSchedulerImplTest, TestCompositorPolicy_DidAnimateForInput) {
+ std::vector<std::string> order;
+
+ idle_task_runner_->PostIdleTask(
+ FROM_HERE,
+ base::Bind(&AppendToVectorIdleTestTask, &order, std::string("I1")));
+ default_task_runner_->PostTask(
+ FROM_HERE,
+ base::Bind(&AppendToVectorTestTask, &order, std::string("D1")));
+ compositor_task_runner_->PostTask(
+ FROM_HERE,
+ base::Bind(&AppendToVectorTestTask, &order, std::string("C1")));
+ default_task_runner_->PostTask(
+ FROM_HERE,
+ base::Bind(&AppendToVectorTestTask, &order, std::string("D2")));
+ compositor_task_runner_->PostTask(
+ FROM_HERE,
+ base::Bind(&AppendToVectorTestTask, &order, std::string("C2")));
+
+ scheduler_->DidAnimateForInputOnCompositorThread();
+ EnableIdleTasks();
+ RunUntilIdle();
+ EXPECT_THAT(order, testing::ElementsAre(std::string("C1"), std::string("C2"),
+ std::string("D1"), std::string("D2"),
+ std::string("I1")));
+}
+
TEST_F(RendererSchedulerImplTest,
TestCompositorPolicyDoesNotStarveDefaultTasks) {
std::vector<std::string> order;

Powered by Google App Engine
This is Rietveld 408576698