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

Side by Side 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: Trying to fix diff base 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "content/renderer/scheduler/renderer_scheduler_impl.h" 5 #include "content/renderer/scheduler/renderer_scheduler_impl.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "cc/output/begin_frame_args.h" 8 #include "cc/output/begin_frame_args.h"
9 #include "cc/test/ordered_simple_task_runner.h" 9 #include "cc/test/ordered_simple_task_runner.h"
10 #include "testing/gmock/include/gmock/gmock.h" 10 #include "testing/gmock/include/gmock/gmock.h"
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 EnableIdleTasks(); 232 EnableIdleTasks();
233 RunUntilIdle(); 233 RunUntilIdle();
234 EXPECT_THAT(order, 234 EXPECT_THAT(order,
235 testing::ElementsAre(std::string("D1"), 235 testing::ElementsAre(std::string("D1"),
236 std::string("C1"), 236 std::string("C1"),
237 std::string("D2"), 237 std::string("D2"),
238 std::string("C2"), 238 std::string("C2"),
239 std::string("I1"))); 239 std::string("I1")));
240 } 240 }
241 241
242 TEST_F(RendererSchedulerImplTest, TestCompositorPolicy) { 242 TEST_F(RendererSchedulerImplTest, TestCompositorPolicy_DidAnimate) {
rmcilroy 2014/11/06 00:53:16 I don't think we need to add _DidAnimate here.
alex clarke (OOO till 29th) 2014/11/06 19:21:45 It kind of is, I didn't intend to delete the origi
243 std::vector<std::string> order; 243 std::vector<std::string> order;
244 244
245 idle_task_runner_->PostIdleTask( 245 idle_task_runner_->PostIdleTask(
246 FROM_HERE, 246 FROM_HERE,
247 base::Bind(&AppendToVectorIdleTestTask, &order, std::string("I1"))); 247 base::Bind(&AppendToVectorIdleTestTask, &order, std::string("I1")));
248 default_task_runner_->PostTask( 248 default_task_runner_->PostTask(
249 FROM_HERE, 249 FROM_HERE,
250 base::Bind(&AppendToVectorTestTask, &order, std::string("D1"))); 250 base::Bind(&AppendToVectorTestTask, &order, std::string("D1")));
251 compositor_task_runner_->PostTask( 251 compositor_task_runner_->PostTask(
252 FROM_HERE, 252 FROM_HERE,
253 base::Bind(&AppendToVectorTestTask, &order, std::string("C1"))); 253 base::Bind(&AppendToVectorTestTask, &order, std::string("C1")));
254 default_task_runner_->PostTask( 254 default_task_runner_->PostTask(
255 FROM_HERE, 255 FROM_HERE,
256 base::Bind(&AppendToVectorTestTask, &order, std::string("D2"))); 256 base::Bind(&AppendToVectorTestTask, &order, std::string("D2")));
257 compositor_task_runner_->PostTask( 257 compositor_task_runner_->PostTask(
258 FROM_HERE, 258 FROM_HERE,
259 base::Bind(&AppendToVectorTestTask, &order, std::string("C2"))); 259 base::Bind(&AppendToVectorTestTask, &order, std::string("C2")));
260 260
261 scheduler_->DidReceiveInputEvent(); 261 scheduler_->DidAnimate();
rmcilroy 2014/11/06 00:53:17 Please keep the DidReceiveInputEvent() compositor
alex clarke (OOO till 29th) 2014/11/06 19:21:45 Done.
262 EnableIdleTasks(); 262 EnableIdleTasks();
263 RunUntilIdle(); 263 RunUntilIdle();
264 EXPECT_THAT(order, 264 EXPECT_THAT(order,
265 testing::ElementsAre(std::string("C1"), 265 testing::ElementsAre(std::string("C1"),
266 std::string("C2"), 266 std::string("C2"),
267 std::string("D1"), 267 std::string("D1"),
268 std::string("D2"), 268 std::string("D2"),
269 std::string("I1"))); 269 std::string("I1")));
270 } 270 }
271 271
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 // Compositor policy mode should have ended now that the clock has advanced. 338 // Compositor policy mode should have ended now that the clock has advanced.
339 RunUntilIdle(); 339 RunUntilIdle();
340 EXPECT_THAT(order, 340 EXPECT_THAT(order,
341 testing::ElementsAre(std::string("D1"), 341 testing::ElementsAre(std::string("D1"),
342 std::string("C1"), 342 std::string("C1"),
343 std::string("D2"), 343 std::string("D2"),
344 std::string("C2"))); 344 std::string("C2")));
345 } 345 }
346 346
347 } // namespace content 347 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698