| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 #include "cc/scheduler/scheduler.h" | 4 #include "cc/scheduler/scheduler.h" |
| 5 | 5 |
| 6 #include <string> | 6 #include <string> |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 void InitializeOutputSurfaceAndFirstCommit(Scheduler* scheduler) { | 34 void InitializeOutputSurfaceAndFirstCommit(Scheduler* scheduler) { |
| 35 scheduler->DidCreateAndInitializeOutputSurface(); | 35 scheduler->DidCreateAndInitializeOutputSurface(); |
| 36 scheduler->SetNeedsCommit(); | 36 scheduler->SetNeedsCommit(); |
| 37 scheduler->NotifyBeginMainFrameStarted(); | 37 scheduler->NotifyBeginMainFrameStarted(); |
| 38 scheduler->NotifyReadyToCommit(); | 38 scheduler->NotifyReadyToCommit(); |
| 39 // Go through the motions to draw the commit. | 39 // Go through the motions to draw the commit. |
| 40 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting()); | 40 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting()); |
| 41 scheduler->OnBeginImplFrameDeadline(); | 41 scheduler->OnBeginImplFrameDeadline(); |
| 42 // We need another BeginImplFrame so Scheduler calls | 42 // We need another BeginImplFrame so Scheduler calls |
| 43 // SetNeedsBeginImplFrame(false). | 43 // SetNeedsBeginFrame(false). |
| 44 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting()); | 44 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting()); |
| 45 scheduler->OnBeginImplFrameDeadline(); | 45 scheduler->OnBeginImplFrameDeadline(); |
| 46 } | 46 } |
| 47 | 47 |
| 48 class FakeSchedulerClient : public SchedulerClient { | 48 class FakeSchedulerClient : public SchedulerClient { |
| 49 public: | 49 public: |
| 50 FakeSchedulerClient() | 50 FakeSchedulerClient() |
| 51 : needs_begin_impl_frame_(false) { | 51 : needs_begin_impl_frame_(false) { |
| 52 Reset(); | 52 Reset(); |
| 53 } | 53 } |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 } | 93 } |
| 94 | 94 |
| 95 void SetDrawWillHappen(bool draw_will_happen) { | 95 void SetDrawWillHappen(bool draw_will_happen) { |
| 96 draw_will_happen_ = draw_will_happen; | 96 draw_will_happen_ = draw_will_happen; |
| 97 } | 97 } |
| 98 void SetSwapWillHappenIfDrawHappens(bool swap_will_happen_if_draw_happens) { | 98 void SetSwapWillHappenIfDrawHappens(bool swap_will_happen_if_draw_happens) { |
| 99 swap_will_happen_if_draw_happens_ = swap_will_happen_if_draw_happens; | 99 swap_will_happen_if_draw_happens_ = swap_will_happen_if_draw_happens; |
| 100 } | 100 } |
| 101 | 101 |
| 102 // SchedulerClient implementation. | 102 // SchedulerClient implementation. |
| 103 virtual void SetNeedsBeginImplFrame(bool enable) OVERRIDE { | 103 virtual void SetNeedsBeginFrame(bool enable) OVERRIDE { |
| 104 actions_.push_back("SetNeedsBeginImplFrame"); | 104 actions_.push_back("SetNeedsBeginFrame"); |
| 105 states_.push_back(scheduler_->StateAsValue().release()); | 105 states_.push_back(scheduler_->StateAsValue().release()); |
| 106 needs_begin_impl_frame_ = enable; | 106 needs_begin_impl_frame_ = enable; |
| 107 } | 107 } |
| 108 virtual void WillBeginImplFrame(const BeginFrameArgs& args) OVERRIDE { |
| 109 actions_.push_back("WillBeginImplFrame"); |
| 110 states_.push_back(scheduler_->StateAsValue().release()); |
| 111 } |
| 108 virtual void ScheduledActionSendBeginMainFrame() OVERRIDE { | 112 virtual void ScheduledActionSendBeginMainFrame() OVERRIDE { |
| 109 actions_.push_back("ScheduledActionSendBeginMainFrame"); | 113 actions_.push_back("ScheduledActionSendBeginMainFrame"); |
| 110 states_.push_back(scheduler_->StateAsValue().release()); | 114 states_.push_back(scheduler_->StateAsValue().release()); |
| 111 } | 115 } |
| 112 virtual DrawSwapReadbackResult ScheduledActionDrawAndSwapIfPossible() | 116 virtual DrawSwapReadbackResult ScheduledActionDrawAndSwapIfPossible() |
| 113 OVERRIDE { | 117 OVERRIDE { |
| 114 actions_.push_back("ScheduledActionDrawAndSwapIfPossible"); | 118 actions_.push_back("ScheduledActionDrawAndSwapIfPossible"); |
| 115 states_.push_back(scheduler_->StateAsValue().release()); | 119 states_.push_back(scheduler_->StateAsValue().release()); |
| 116 num_draws_++; | 120 num_draws_++; |
| 117 bool did_readback = false; | 121 bool did_readback = false; |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 scheduler->SetVisible(true); | 218 scheduler->SetVisible(true); |
| 215 scheduler->SetCanDraw(true); | 219 scheduler->SetCanDraw(true); |
| 216 | 220 |
| 217 EXPECT_SINGLE_ACTION("ScheduledActionBeginOutputSurfaceCreation", client); | 221 EXPECT_SINGLE_ACTION("ScheduledActionBeginOutputSurfaceCreation", client); |
| 218 InitializeOutputSurfaceAndFirstCommit(scheduler); | 222 InitializeOutputSurfaceAndFirstCommit(scheduler); |
| 219 | 223 |
| 220 // SetNeedsCommit should begin the frame on the next BeginImplFrame. | 224 // SetNeedsCommit should begin the frame on the next BeginImplFrame. |
| 221 client.Reset(); | 225 client.Reset(); |
| 222 scheduler->SetNeedsCommit(); | 226 scheduler->SetNeedsCommit(); |
| 223 EXPECT_TRUE(client.needs_begin_impl_frame()); | 227 EXPECT_TRUE(client.needs_begin_impl_frame()); |
| 224 EXPECT_SINGLE_ACTION("SetNeedsBeginImplFrame", client); | 228 EXPECT_SINGLE_ACTION("SetNeedsBeginFrame", client); |
| 225 client.Reset(); | 229 client.Reset(); |
| 226 | 230 |
| 227 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting()); | 231 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting()); |
| 228 EXPECT_SINGLE_ACTION("ScheduledActionSendBeginMainFrame", client); | 232 EXPECT_ACTION("WillBeginImplFrame", client, 0, 2); |
| 233 EXPECT_ACTION("ScheduledActionSendBeginMainFrame", client, 1, 2); |
| 229 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); | 234 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); |
| 230 EXPECT_TRUE(client.needs_begin_impl_frame()); | 235 EXPECT_TRUE(client.needs_begin_impl_frame()); |
| 231 client.Reset(); | 236 client.Reset(); |
| 232 | 237 |
| 233 // If we don't swap on the deadline, we need to request another | 238 // If we don't swap on the deadline, we need to request another |
| 234 // BeginImplFrame. | 239 // BeginImplFrame. |
| 235 scheduler->OnBeginImplFrameDeadline(); | 240 scheduler->OnBeginImplFrameDeadline(); |
| 236 EXPECT_SINGLE_ACTION("SetNeedsBeginImplFrame", client); | 241 EXPECT_EQ(client.num_actions_(), 0); |
| 237 EXPECT_FALSE(scheduler->BeginImplFrameDeadlinePending()); | 242 EXPECT_FALSE(scheduler->BeginImplFrameDeadlinePending()); |
| 238 EXPECT_TRUE(client.needs_begin_impl_frame()); | 243 EXPECT_TRUE(client.needs_begin_impl_frame()); |
| 239 client.Reset(); | 244 client.Reset(); |
| 240 | 245 |
| 241 // NotifyReadyToCommit should trigger the commit. | 246 // NotifyReadyToCommit should trigger the commit. |
| 242 scheduler->NotifyBeginMainFrameStarted(); | 247 scheduler->NotifyBeginMainFrameStarted(); |
| 243 scheduler->NotifyReadyToCommit(); | 248 scheduler->NotifyReadyToCommit(); |
| 244 EXPECT_SINGLE_ACTION("ScheduledActionCommit", client); | 249 EXPECT_SINGLE_ACTION("ScheduledActionCommit", client); |
| 245 EXPECT_TRUE(client.needs_begin_impl_frame()); | 250 EXPECT_TRUE(client.needs_begin_impl_frame()); |
| 246 client.Reset(); | 251 client.Reset(); |
| 247 | 252 |
| 248 // BeginImplFrame should prepare the draw. | 253 // BeginImplFrame should prepare the draw. |
| 249 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting()); | 254 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting()); |
| 250 EXPECT_EQ(client.num_actions_(), 0); | 255 EXPECT_SINGLE_ACTION("WillBeginImplFrame", client); |
| 251 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); | 256 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); |
| 252 EXPECT_TRUE(client.needs_begin_impl_frame()); | 257 EXPECT_TRUE(client.needs_begin_impl_frame()); |
| 253 client.Reset(); | 258 client.Reset(); |
| 254 | 259 |
| 255 // BeginImplFrame deadline should draw. | 260 // BeginImplFrame deadline should draw. |
| 256 scheduler->OnBeginImplFrameDeadline(); | 261 scheduler->OnBeginImplFrameDeadline(); |
| 257 EXPECT_ACTION("ScheduledActionDrawAndSwapIfPossible", client, 0, 2); | 262 EXPECT_SINGLE_ACTION("ScheduledActionDrawAndSwapIfPossible", client); |
| 258 EXPECT_ACTION("SetNeedsBeginImplFrame", client, 1, 2); | |
| 259 EXPECT_FALSE(scheduler->BeginImplFrameDeadlinePending()); | 263 EXPECT_FALSE(scheduler->BeginImplFrameDeadlinePending()); |
| 260 EXPECT_TRUE(client.needs_begin_impl_frame()); | 264 EXPECT_TRUE(client.needs_begin_impl_frame()); |
| 261 client.Reset(); | 265 client.Reset(); |
| 262 | 266 |
| 263 // The following BeginImplFrame deadline should SetNeedsBeginImplFrame(false) | 267 // The following BeginImplFrame deadline should SetNeedsBeginFrame(false) |
| 264 // to avoid excessive toggles. | 268 // to avoid excessive toggles. |
| 265 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting()); | 269 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting()); |
| 266 EXPECT_EQ(client.num_actions_(), 0); | 270 EXPECT_SINGLE_ACTION("WillBeginImplFrame", client); |
| 267 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); | 271 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); |
| 268 client.Reset(); | 272 client.Reset(); |
| 269 | 273 |
| 270 scheduler->OnBeginImplFrameDeadline(); | 274 scheduler->OnBeginImplFrameDeadline(); |
| 271 EXPECT_SINGLE_ACTION("SetNeedsBeginImplFrame", client); | 275 EXPECT_SINGLE_ACTION("SetNeedsBeginFrame", client); |
| 272 EXPECT_FALSE(client.needs_begin_impl_frame()); | 276 EXPECT_FALSE(client.needs_begin_impl_frame()); |
| 273 client.Reset(); | 277 client.Reset(); |
| 274 } | 278 } |
| 275 | 279 |
| 276 TEST(SchedulerTest, RequestCommitAfterBeginMainFrameSent) { | 280 TEST(SchedulerTest, RequestCommitAfterBeginMainFrameSent) { |
| 277 FakeSchedulerClient client; | 281 FakeSchedulerClient client; |
| 278 SchedulerSettings scheduler_settings; | 282 SchedulerSettings scheduler_settings; |
| 279 Scheduler* scheduler = client.CreateScheduler(scheduler_settings); | 283 Scheduler* scheduler = client.CreateScheduler(scheduler_settings); |
| 280 scheduler->SetCanStart(); | 284 scheduler->SetCanStart(); |
| 281 scheduler->SetVisible(true); | 285 scheduler->SetVisible(true); |
| 282 scheduler->SetCanDraw(true); | 286 scheduler->SetCanDraw(true); |
| 283 | 287 |
| 284 EXPECT_SINGLE_ACTION("ScheduledActionBeginOutputSurfaceCreation", client); | 288 EXPECT_SINGLE_ACTION("ScheduledActionBeginOutputSurfaceCreation", client); |
| 285 InitializeOutputSurfaceAndFirstCommit(scheduler); | 289 InitializeOutputSurfaceAndFirstCommit(scheduler); |
| 286 client.Reset(); | 290 client.Reset(); |
| 287 | 291 |
| 288 // SetNeedsCommit should begin the frame. | 292 // SetNeedsCommit should begin the frame. |
| 289 scheduler->SetNeedsCommit(); | 293 scheduler->SetNeedsCommit(); |
| 290 EXPECT_SINGLE_ACTION("SetNeedsBeginImplFrame", client); | 294 EXPECT_SINGLE_ACTION("SetNeedsBeginFrame", client); |
| 291 | 295 |
| 292 client.Reset(); | 296 client.Reset(); |
| 293 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting()); | 297 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting()); |
| 294 EXPECT_SINGLE_ACTION("ScheduledActionSendBeginMainFrame", client); | 298 EXPECT_ACTION("WillBeginImplFrame", client, 0, 2); |
| 299 EXPECT_ACTION("ScheduledActionSendBeginMainFrame", client, 1, 2); |
| 295 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); | 300 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); |
| 296 | 301 |
| 297 EXPECT_TRUE(client.needs_begin_impl_frame()); | 302 EXPECT_TRUE(client.needs_begin_impl_frame()); |
| 298 client.Reset(); | 303 client.Reset(); |
| 299 | 304 |
| 300 // Now SetNeedsCommit again. Calling here means we need a second commit. | 305 // Now SetNeedsCommit again. Calling here means we need a second commit. |
| 301 scheduler->SetNeedsCommit(); | 306 scheduler->SetNeedsCommit(); |
| 302 EXPECT_EQ(client.num_actions_(), 0); | 307 EXPECT_EQ(client.num_actions_(), 0); |
| 303 client.Reset(); | 308 client.Reset(); |
| 304 | 309 |
| 305 // Finish the first commit. | 310 // Finish the first commit. |
| 306 scheduler->NotifyBeginMainFrameStarted(); | 311 scheduler->NotifyBeginMainFrameStarted(); |
| 307 scheduler->NotifyReadyToCommit(); | 312 scheduler->NotifyReadyToCommit(); |
| 308 EXPECT_SINGLE_ACTION("ScheduledActionCommit", client); | 313 EXPECT_SINGLE_ACTION("ScheduledActionCommit", client); |
| 309 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); | 314 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); |
| 310 client.Reset(); | 315 client.Reset(); |
| 311 scheduler->OnBeginImplFrameDeadline(); | 316 scheduler->OnBeginImplFrameDeadline(); |
| 312 EXPECT_ACTION("ScheduledActionDrawAndSwapIfPossible", client, 0, 2); | 317 EXPECT_SINGLE_ACTION("ScheduledActionDrawAndSwapIfPossible", client); |
| 313 EXPECT_ACTION("SetNeedsBeginImplFrame", client, 1, 2); | |
| 314 EXPECT_FALSE(scheduler->BeginImplFrameDeadlinePending()); | 318 EXPECT_FALSE(scheduler->BeginImplFrameDeadlinePending()); |
| 315 | 319 |
| 316 // Because we just swapped, the Scheduler should also request the next | 320 // Because we just swapped, the Scheduler should also request the next |
| 317 // BeginImplFrame from the OutputSurface. | 321 // BeginImplFrame from the OutputSurface. |
| 318 EXPECT_TRUE(client.needs_begin_impl_frame()); | 322 EXPECT_TRUE(client.needs_begin_impl_frame()); |
| 319 client.Reset(); | 323 client.Reset(); |
| 320 | 324 |
| 321 // Since another commit is needed, the next BeginImplFrame should initiate | 325 // Since another commit is needed, the next BeginImplFrame should initiate |
| 322 // the second commit. | 326 // the second commit. |
| 323 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting()); | 327 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting()); |
| 324 EXPECT_SINGLE_ACTION("ScheduledActionSendBeginMainFrame", client); | 328 EXPECT_ACTION("WillBeginImplFrame", client, 0, 2); |
| 329 EXPECT_ACTION("ScheduledActionSendBeginMainFrame", client, 1, 2); |
| 325 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); | 330 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); |
| 326 client.Reset(); | 331 client.Reset(); |
| 327 | 332 |
| 328 // Finishing the commit before the deadline should post a new deadline task | 333 // Finishing the commit before the deadline should post a new deadline task |
| 329 // to trigger the deadline early. | 334 // to trigger the deadline early. |
| 330 scheduler->NotifyBeginMainFrameStarted(); | 335 scheduler->NotifyBeginMainFrameStarted(); |
| 331 scheduler->NotifyReadyToCommit(); | 336 scheduler->NotifyReadyToCommit(); |
| 332 EXPECT_SINGLE_ACTION("ScheduledActionCommit", client); | 337 EXPECT_SINGLE_ACTION("ScheduledActionCommit", client); |
| 333 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); | 338 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); |
| 334 client.Reset(); | 339 client.Reset(); |
| 335 scheduler->OnBeginImplFrameDeadline(); | 340 scheduler->OnBeginImplFrameDeadline(); |
| 336 EXPECT_ACTION("ScheduledActionDrawAndSwapIfPossible", client, 0, 2); | 341 EXPECT_SINGLE_ACTION("ScheduledActionDrawAndSwapIfPossible", client); |
| 337 EXPECT_ACTION("SetNeedsBeginImplFrame", client, 1, 2); | |
| 338 EXPECT_FALSE(scheduler->BeginImplFrameDeadlinePending()); | 342 EXPECT_FALSE(scheduler->BeginImplFrameDeadlinePending()); |
| 339 EXPECT_TRUE(client.needs_begin_impl_frame()); | 343 EXPECT_TRUE(client.needs_begin_impl_frame()); |
| 340 client.Reset(); | 344 client.Reset(); |
| 341 | 345 |
| 342 // On the next BeginImplFrame, verify we go back to a quiescent state and | 346 // On the next BeginImplFrame, verify we go back to a quiescent state and |
| 343 // no longer request BeginImplFrames. | 347 // no longer request BeginImplFrames. |
| 344 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting()); | 348 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting()); |
| 345 scheduler->OnBeginImplFrameDeadline(); | 349 scheduler->OnBeginImplFrameDeadline(); |
| 346 EXPECT_FALSE(client.needs_begin_impl_frame()); | 350 EXPECT_FALSE(client.needs_begin_impl_frame()); |
| 347 client.Reset(); | 351 client.Reset(); |
| 348 } | 352 } |
| 349 | 353 |
| 350 TEST(SchedulerTest, TextureAcquisitionCausesCommitInsteadOfDraw) { | 354 TEST(SchedulerTest, TextureAcquisitionCausesCommitInsteadOfDraw) { |
| 351 FakeSchedulerClient client; | 355 FakeSchedulerClient client; |
| 352 SchedulerSettings scheduler_settings; | 356 SchedulerSettings scheduler_settings; |
| 353 Scheduler* scheduler = client.CreateScheduler(scheduler_settings); | 357 Scheduler* scheduler = client.CreateScheduler(scheduler_settings); |
| 354 scheduler->SetCanStart(); | 358 scheduler->SetCanStart(); |
| 355 scheduler->SetVisible(true); | 359 scheduler->SetVisible(true); |
| 356 scheduler->SetCanDraw(true); | 360 scheduler->SetCanDraw(true); |
| 357 EXPECT_SINGLE_ACTION("ScheduledActionBeginOutputSurfaceCreation", client); | 361 EXPECT_SINGLE_ACTION("ScheduledActionBeginOutputSurfaceCreation", client); |
| 358 | 362 |
| 359 InitializeOutputSurfaceAndFirstCommit(scheduler); | 363 InitializeOutputSurfaceAndFirstCommit(scheduler); |
| 360 client.Reset(); | 364 client.Reset(); |
| 361 scheduler->SetNeedsRedraw(); | 365 scheduler->SetNeedsRedraw(); |
| 362 EXPECT_TRUE(scheduler->RedrawPending()); | 366 EXPECT_TRUE(scheduler->RedrawPending()); |
| 363 EXPECT_SINGLE_ACTION("SetNeedsBeginImplFrame", client); | 367 EXPECT_SINGLE_ACTION("SetNeedsBeginFrame", client); |
| 364 EXPECT_TRUE(client.needs_begin_impl_frame()); | 368 EXPECT_TRUE(client.needs_begin_impl_frame()); |
| 365 | 369 |
| 366 client.Reset(); | 370 client.Reset(); |
| 367 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting()); | 371 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting()); |
| 368 EXPECT_EQ(client.num_actions_(), 0); | 372 EXPECT_SINGLE_ACTION("WillBeginImplFrame", client); |
| 369 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); | 373 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); |
| 370 client.Reset(); | 374 client.Reset(); |
| 371 scheduler->OnBeginImplFrameDeadline(); | 375 scheduler->OnBeginImplFrameDeadline(); |
| 372 EXPECT_ACTION("ScheduledActionDrawAndSwapIfPossible", client, 0, 2); | 376 EXPECT_SINGLE_ACTION("ScheduledActionDrawAndSwapIfPossible", client); |
| 373 EXPECT_ACTION("SetNeedsBeginImplFrame", client, 1, 2); | |
| 374 EXPECT_FALSE(scheduler->BeginImplFrameDeadlinePending()); | 377 EXPECT_FALSE(scheduler->BeginImplFrameDeadlinePending()); |
| 375 EXPECT_FALSE(scheduler->RedrawPending()); | 378 EXPECT_FALSE(scheduler->RedrawPending()); |
| 376 EXPECT_TRUE(client.needs_begin_impl_frame()); | 379 EXPECT_TRUE(client.needs_begin_impl_frame()); |
| 377 | 380 |
| 378 client.Reset(); | 381 client.Reset(); |
| 379 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting()); | 382 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting()); |
| 380 EXPECT_EQ(client.num_actions_(), 0); | 383 EXPECT_SINGLE_ACTION("WillBeginImplFrame", client); |
| 381 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); | 384 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); |
| 382 client.Reset(); | 385 client.Reset(); |
| 383 scheduler->OnBeginImplFrameDeadline(); | 386 scheduler->OnBeginImplFrameDeadline(); |
| 384 EXPECT_SINGLE_ACTION("SetNeedsBeginImplFrame", client); | 387 EXPECT_SINGLE_ACTION("SetNeedsBeginFrame", client); |
| 385 EXPECT_FALSE(scheduler->BeginImplFrameDeadlinePending()); | 388 EXPECT_FALSE(scheduler->BeginImplFrameDeadlinePending()); |
| 386 EXPECT_FALSE(scheduler->RedrawPending()); | 389 EXPECT_FALSE(scheduler->RedrawPending()); |
| 387 EXPECT_FALSE(client.needs_begin_impl_frame()); | 390 EXPECT_FALSE(client.needs_begin_impl_frame()); |
| 388 | 391 |
| 389 client.Reset(); | 392 client.Reset(); |
| 390 scheduler->SetMainThreadNeedsLayerTextures(); | 393 scheduler->SetMainThreadNeedsLayerTextures(); |
| 391 EXPECT_SINGLE_ACTION("ScheduledActionAcquireLayerTexturesForMainThread", | 394 EXPECT_SINGLE_ACTION("ScheduledActionAcquireLayerTexturesForMainThread", |
| 392 client); | 395 client); |
| 393 | 396 |
| 394 // We should request a BeginImplFrame in anticipation of a draw. | 397 // We should request a BeginImplFrame in anticipation of a draw. |
| 395 client.Reset(); | 398 client.Reset(); |
| 396 scheduler->SetNeedsRedraw(); | 399 scheduler->SetNeedsRedraw(); |
| 397 EXPECT_TRUE(scheduler->RedrawPending()); | 400 EXPECT_TRUE(scheduler->RedrawPending()); |
| 398 EXPECT_SINGLE_ACTION("SetNeedsBeginImplFrame", client); | 401 EXPECT_SINGLE_ACTION("SetNeedsBeginFrame", client); |
| 399 EXPECT_TRUE(client.needs_begin_impl_frame()); | 402 EXPECT_TRUE(client.needs_begin_impl_frame()); |
| 400 | 403 |
| 401 // No draw happens since the textures are acquired by the main thread. | 404 // No draw happens since the textures are acquired by the main thread. |
| 402 client.Reset(); | 405 client.Reset(); |
| 403 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting()); | 406 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting()); |
| 404 EXPECT_EQ(client.num_actions_(), 0); | 407 EXPECT_SINGLE_ACTION("WillBeginImplFrame", client); |
| 405 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); | 408 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); |
| 406 client.Reset(); | 409 client.Reset(); |
| 407 scheduler->OnBeginImplFrameDeadline(); | 410 scheduler->OnBeginImplFrameDeadline(); |
| 408 EXPECT_SINGLE_ACTION("SetNeedsBeginImplFrame", client); | 411 EXPECT_EQ(0, client.num_actions_()); |
| 409 EXPECT_FALSE(scheduler->BeginImplFrameDeadlinePending()); | 412 EXPECT_FALSE(scheduler->BeginImplFrameDeadlinePending()); |
| 410 EXPECT_TRUE(scheduler->RedrawPending()); | 413 EXPECT_TRUE(scheduler->RedrawPending()); |
| 411 EXPECT_TRUE(client.needs_begin_impl_frame()); | 414 EXPECT_TRUE(client.needs_begin_impl_frame()); |
| 412 | 415 |
| 413 client.Reset(); | 416 client.Reset(); |
| 414 scheduler->SetNeedsCommit(); | 417 scheduler->SetNeedsCommit(); |
| 415 EXPECT_EQ(0, client.num_actions_()); | 418 EXPECT_EQ(0, client.num_actions_()); |
| 416 | 419 |
| 417 client.Reset(); | 420 client.Reset(); |
| 418 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting()); | 421 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting()); |
| 419 EXPECT_SINGLE_ACTION("ScheduledActionSendBeginMainFrame", client); | 422 EXPECT_ACTION("WillBeginImplFrame", client, 0, 2); |
| 423 EXPECT_ACTION("ScheduledActionSendBeginMainFrame", client, 1, 2); |
| 420 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); | 424 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); |
| 421 | 425 |
| 422 // Commit will release the texture. | 426 // Commit will release the texture. |
| 423 client.Reset(); | 427 client.Reset(); |
| 424 scheduler->NotifyBeginMainFrameStarted(); | 428 scheduler->NotifyBeginMainFrameStarted(); |
| 425 scheduler->NotifyReadyToCommit(); | 429 scheduler->NotifyReadyToCommit(); |
| 426 EXPECT_SINGLE_ACTION("ScheduledActionCommit", client); | 430 EXPECT_SINGLE_ACTION("ScheduledActionCommit", client); |
| 427 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); | 431 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); |
| 428 EXPECT_TRUE(scheduler->RedrawPending()); | 432 EXPECT_TRUE(scheduler->RedrawPending()); |
| 429 | 433 |
| 430 // Now we can draw again after the commit happens. | 434 // Now we can draw again after the commit happens. |
| 431 client.Reset(); | 435 client.Reset(); |
| 432 scheduler->OnBeginImplFrameDeadline(); | 436 scheduler->OnBeginImplFrameDeadline(); |
| 433 EXPECT_ACTION("ScheduledActionDrawAndSwapIfPossible", client, 0, 2); | 437 EXPECT_SINGLE_ACTION("ScheduledActionDrawAndSwapIfPossible", client); |
| 434 EXPECT_ACTION("SetNeedsBeginImplFrame", client, 1, 2); | |
| 435 EXPECT_FALSE(scheduler->BeginImplFrameDeadlinePending()); | 438 EXPECT_FALSE(scheduler->BeginImplFrameDeadlinePending()); |
| 436 EXPECT_FALSE(scheduler->RedrawPending()); | 439 EXPECT_FALSE(scheduler->RedrawPending()); |
| 437 EXPECT_TRUE(client.needs_begin_impl_frame()); | 440 EXPECT_TRUE(client.needs_begin_impl_frame()); |
| 438 | 441 |
| 439 // Make sure we stop requesting BeginImplFrames if we don't swap. | 442 // Make sure we stop requesting BeginImplFrames if we don't swap. |
| 440 client.Reset(); | 443 client.Reset(); |
| 441 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting()); | 444 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting()); |
| 442 EXPECT_EQ(client.num_actions_(), 0); | 445 EXPECT_SINGLE_ACTION("WillBeginImplFrame", client); |
| 443 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); | 446 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); |
| 444 client.Reset(); | 447 client.Reset(); |
| 445 scheduler->OnBeginImplFrameDeadline(); | 448 scheduler->OnBeginImplFrameDeadline(); |
| 446 EXPECT_SINGLE_ACTION("SetNeedsBeginImplFrame", client); | 449 EXPECT_SINGLE_ACTION("SetNeedsBeginFrame", client); |
| 447 EXPECT_FALSE(client.needs_begin_impl_frame()); | 450 EXPECT_FALSE(client.needs_begin_impl_frame()); |
| 448 } | 451 } |
| 449 | 452 |
| 450 TEST(SchedulerTest, TextureAcquisitionCollision) { | 453 TEST(SchedulerTest, TextureAcquisitionCollision) { |
| 451 FakeSchedulerClient client; | 454 FakeSchedulerClient client; |
| 452 SchedulerSettings scheduler_settings; | 455 SchedulerSettings scheduler_settings; |
| 453 Scheduler* scheduler = client.CreateScheduler(scheduler_settings); | 456 Scheduler* scheduler = client.CreateScheduler(scheduler_settings); |
| 454 scheduler->SetCanStart(); | 457 scheduler->SetCanStart(); |
| 455 scheduler->SetVisible(true); | 458 scheduler->SetVisible(true); |
| 456 scheduler->SetCanDraw(true); | 459 scheduler->SetCanDraw(true); |
| 457 | 460 |
| 458 EXPECT_SINGLE_ACTION("ScheduledActionBeginOutputSurfaceCreation", client); | 461 EXPECT_SINGLE_ACTION("ScheduledActionBeginOutputSurfaceCreation", client); |
| 459 InitializeOutputSurfaceAndFirstCommit(scheduler); | 462 InitializeOutputSurfaceAndFirstCommit(scheduler); |
| 460 | 463 |
| 461 client.Reset(); | 464 client.Reset(); |
| 462 scheduler->SetNeedsCommit(); | 465 scheduler->SetNeedsCommit(); |
| 463 EXPECT_SINGLE_ACTION("SetNeedsBeginImplFrame", client); | 466 EXPECT_SINGLE_ACTION("SetNeedsBeginFrame", client); |
| 464 | 467 |
| 465 client.Reset(); | 468 client.Reset(); |
| 466 scheduler->SetMainThreadNeedsLayerTextures(); | 469 scheduler->SetMainThreadNeedsLayerTextures(); |
| 467 EXPECT_SINGLE_ACTION( | 470 EXPECT_SINGLE_ACTION( |
| 468 "ScheduledActionAcquireLayerTexturesForMainThread", client); | 471 "ScheduledActionAcquireLayerTexturesForMainThread", client); |
| 469 | 472 |
| 470 client.Reset(); | 473 client.Reset(); |
| 471 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting()); | 474 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting()); |
| 472 EXPECT_SINGLE_ACTION("ScheduledActionSendBeginMainFrame", client); | 475 EXPECT_ACTION("WillBeginImplFrame", client, 0, 2); |
| 476 EXPECT_ACTION("ScheduledActionSendBeginMainFrame", client, 1, 2); |
| 473 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); | 477 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); |
| 474 | 478 |
| 475 client.Reset(); | 479 client.Reset(); |
| 476 scheduler->OnBeginImplFrameDeadline(); | 480 scheduler->OnBeginImplFrameDeadline(); |
| 477 EXPECT_SINGLE_ACTION("SetNeedsBeginImplFrame", client); | 481 EXPECT_EQ(0, client.num_actions_()); |
| 478 | 482 |
| 479 // Although the compositor cannot draw because textures are locked by main | 483 // Although the compositor cannot draw because textures are locked by main |
| 480 // thread, we continue requesting SetNeedsBeginImplFrame in anticipation of | 484 // thread, we continue requesting SetNeedsBeginFrame in anticipation of |
| 481 // the unlock. | 485 // the unlock. |
| 482 EXPECT_TRUE(client.needs_begin_impl_frame()); | 486 EXPECT_TRUE(client.needs_begin_impl_frame()); |
| 483 | 487 |
| 484 // Trigger the commit. | 488 // Trigger the commit. |
| 485 scheduler->NotifyBeginMainFrameStarted(); | 489 scheduler->NotifyBeginMainFrameStarted(); |
| 486 scheduler->NotifyReadyToCommit(); | 490 scheduler->NotifyReadyToCommit(); |
| 487 EXPECT_TRUE(client.needs_begin_impl_frame()); | 491 EXPECT_TRUE(client.needs_begin_impl_frame()); |
| 488 | 492 |
| 489 // Between commit and draw, texture acquisition for main thread delayed, | 493 // Between commit and draw, texture acquisition for main thread delayed, |
| 490 // and main thread blocks. | 494 // and main thread blocks. |
| 491 client.Reset(); | 495 client.Reset(); |
| 492 scheduler->SetMainThreadNeedsLayerTextures(); | 496 scheduler->SetMainThreadNeedsLayerTextures(); |
| 493 EXPECT_EQ(0, client.num_actions_()); | 497 EXPECT_EQ(0, client.num_actions_()); |
| 494 | 498 |
| 495 // No implicit commit is expected. | 499 // No implicit commit is expected. |
| 496 client.Reset(); | 500 client.Reset(); |
| 497 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting()); | 501 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting()); |
| 498 EXPECT_EQ(client.num_actions_(), 0); | 502 EXPECT_SINGLE_ACTION("WillBeginImplFrame", client); |
| 499 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); | 503 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); |
| 500 | 504 |
| 501 client.Reset(); | 505 client.Reset(); |
| 502 scheduler->OnBeginImplFrameDeadline(); | 506 scheduler->OnBeginImplFrameDeadline(); |
| 503 EXPECT_ACTION("ScheduledActionDrawAndSwapIfPossible", client, 0, 3); | 507 EXPECT_ACTION("ScheduledActionDrawAndSwapIfPossible", client, 0, 2); |
| 504 EXPECT_ACTION( | 508 EXPECT_ACTION( |
| 505 "ScheduledActionAcquireLayerTexturesForMainThread", client, 1, 3); | 509 "ScheduledActionAcquireLayerTexturesForMainThread", client, 1, 2); |
| 506 EXPECT_ACTION("SetNeedsBeginImplFrame", client, 2, 3); | |
| 507 EXPECT_FALSE(scheduler->BeginImplFrameDeadlinePending()); | 510 EXPECT_FALSE(scheduler->BeginImplFrameDeadlinePending()); |
| 508 EXPECT_TRUE(client.needs_begin_impl_frame()); | 511 EXPECT_TRUE(client.needs_begin_impl_frame()); |
| 509 | 512 |
| 510 // The compositor should not draw because textures are locked by main | 513 // The compositor should not draw because textures are locked by main |
| 511 // thread. | 514 // thread. |
| 512 client.Reset(); | 515 client.Reset(); |
| 513 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting()); | 516 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting()); |
| 514 EXPECT_EQ(client.num_actions_(), 0); | 517 EXPECT_SINGLE_ACTION("WillBeginImplFrame", client); |
| 515 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); | 518 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); |
| 516 client.Reset(); | 519 client.Reset(); |
| 517 scheduler->OnBeginImplFrameDeadline(); | 520 scheduler->OnBeginImplFrameDeadline(); |
| 518 EXPECT_SINGLE_ACTION("SetNeedsBeginImplFrame", client); | 521 EXPECT_SINGLE_ACTION("SetNeedsBeginFrame", client); |
| 519 EXPECT_FALSE(client.needs_begin_impl_frame()); | 522 EXPECT_FALSE(client.needs_begin_impl_frame()); |
| 520 EXPECT_FALSE(scheduler->BeginImplFrameDeadlinePending()); | 523 EXPECT_FALSE(scheduler->BeginImplFrameDeadlinePending()); |
| 521 | 524 |
| 522 // The impl thread need an explicit commit from the main thread to lock | 525 // The impl thread need an explicit commit from the main thread to lock |
| 523 // the textures. | 526 // the textures. |
| 524 client.Reset(); | 527 client.Reset(); |
| 525 scheduler->SetNeedsCommit(); | 528 scheduler->SetNeedsCommit(); |
| 526 EXPECT_SINGLE_ACTION("SetNeedsBeginImplFrame", client); | 529 EXPECT_SINGLE_ACTION("SetNeedsBeginFrame", client); |
| 527 EXPECT_TRUE(client.needs_begin_impl_frame()); | 530 EXPECT_TRUE(client.needs_begin_impl_frame()); |
| 528 | 531 |
| 529 client.Reset(); | 532 client.Reset(); |
| 530 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting()); | 533 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting()); |
| 531 EXPECT_SINGLE_ACTION("ScheduledActionSendBeginMainFrame", client); | 534 EXPECT_ACTION("WillBeginImplFrame", client, 0, 2); |
| 535 EXPECT_ACTION("ScheduledActionSendBeginMainFrame", client, 1, 2); |
| 532 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); | 536 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); |
| 533 client.Reset(); | 537 client.Reset(); |
| 534 | 538 |
| 535 // Trigger the commit, which will trigger the deadline task early. | 539 // Trigger the commit, which will trigger the deadline task early. |
| 536 scheduler->NotifyBeginMainFrameStarted(); | 540 scheduler->NotifyBeginMainFrameStarted(); |
| 537 scheduler->NotifyReadyToCommit(); | 541 scheduler->NotifyReadyToCommit(); |
| 538 EXPECT_SINGLE_ACTION("ScheduledActionCommit", client); | 542 EXPECT_SINGLE_ACTION("ScheduledActionCommit", client); |
| 539 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); | 543 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); |
| 540 EXPECT_TRUE(client.needs_begin_impl_frame()); | 544 EXPECT_TRUE(client.needs_begin_impl_frame()); |
| 541 client.Reset(); | 545 client.Reset(); |
| 542 | 546 |
| 543 // Verify we draw on the next BeginImplFrame deadline | 547 // Verify we draw on the next BeginImplFrame deadline |
| 544 scheduler->OnBeginImplFrameDeadline(); | 548 scheduler->OnBeginImplFrameDeadline(); |
| 545 EXPECT_ACTION("ScheduledActionDrawAndSwapIfPossible", client, 0, 2); | 549 EXPECT_SINGLE_ACTION("ScheduledActionDrawAndSwapIfPossible", client); |
| 546 EXPECT_ACTION("SetNeedsBeginImplFrame", client, 1, 2); | |
| 547 EXPECT_TRUE(client.needs_begin_impl_frame()); | 550 EXPECT_TRUE(client.needs_begin_impl_frame()); |
| 548 EXPECT_FALSE(scheduler->BeginImplFrameDeadlinePending()); | 551 EXPECT_FALSE(scheduler->BeginImplFrameDeadlinePending()); |
| 549 client.Reset(); | 552 client.Reset(); |
| 550 } | 553 } |
| 551 | 554 |
| 552 TEST(SchedulerTest, VisibilitySwitchWithTextureAcquisition) { | 555 TEST(SchedulerTest, VisibilitySwitchWithTextureAcquisition) { |
| 553 FakeSchedulerClient client; | 556 FakeSchedulerClient client; |
| 554 SchedulerSettings scheduler_settings; | 557 SchedulerSettings scheduler_settings; |
| 555 Scheduler* scheduler = client.CreateScheduler(scheduler_settings); | 558 Scheduler* scheduler = client.CreateScheduler(scheduler_settings); |
| 556 scheduler->SetCanStart(); | 559 scheduler->SetCanStart(); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 578 client.Reset(); | 581 client.Reset(); |
| 579 scheduler->SetVisible(true); | 582 scheduler->SetVisible(true); |
| 580 EXPECT_EQ(0, client.num_actions_()); | 583 EXPECT_EQ(0, client.num_actions_()); |
| 581 EXPECT_TRUE(client.needs_begin_impl_frame()); | 584 EXPECT_TRUE(client.needs_begin_impl_frame()); |
| 582 | 585 |
| 583 // Regaining visibility with textures acquired by main thread while | 586 // Regaining visibility with textures acquired by main thread while |
| 584 // compositor is waiting for first draw should result in a request | 587 // compositor is waiting for first draw should result in a request |
| 585 // for a new frame in order to escape a deadlock. | 588 // for a new frame in order to escape a deadlock. |
| 586 client.Reset(); | 589 client.Reset(); |
| 587 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting()); | 590 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting()); |
| 588 EXPECT_SINGLE_ACTION("ScheduledActionSendBeginMainFrame", client); | 591 EXPECT_ACTION("WillBeginImplFrame", client, 0, 2); |
| 592 EXPECT_ACTION("ScheduledActionSendBeginMainFrame", client, 1, 2); |
| 589 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); | 593 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); |
| 590 } | 594 } |
| 591 | 595 |
| 592 class SchedulerClientThatsetNeedsDrawInsideDraw : public FakeSchedulerClient { | 596 class SchedulerClientThatsetNeedsDrawInsideDraw : public FakeSchedulerClient { |
| 593 public: | 597 public: |
| 594 virtual void ScheduledActionSendBeginMainFrame() OVERRIDE {} | 598 virtual void ScheduledActionSendBeginMainFrame() OVERRIDE {} |
| 595 virtual DrawSwapReadbackResult ScheduledActionDrawAndSwapIfPossible() | 599 virtual DrawSwapReadbackResult ScheduledActionDrawAndSwapIfPossible() |
| 596 OVERRIDE { | 600 OVERRIDE { |
| 597 // Only SetNeedsRedraw the first time this is called | 601 // Only SetNeedsRedraw the first time this is called |
| 598 if (!num_draws_) | 602 if (!num_draws_) |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 935 EXPECT_TRUE(scheduler->ManageTilesPending()); | 939 EXPECT_TRUE(scheduler->ManageTilesPending()); |
| 936 EXPECT_TRUE(client.needs_begin_impl_frame()); | 940 EXPECT_TRUE(client.needs_begin_impl_frame()); |
| 937 EXPECT_EQ(0, client.num_draws()); | 941 EXPECT_EQ(0, client.num_draws()); |
| 938 EXPECT_FALSE(client.HasAction("ScheduledActionManageTiles")); | 942 EXPECT_FALSE(client.HasAction("ScheduledActionManageTiles")); |
| 939 EXPECT_FALSE(client.HasAction("ScheduledActionDrawAndSwapIfPossible")); | 943 EXPECT_FALSE(client.HasAction("ScheduledActionDrawAndSwapIfPossible")); |
| 940 | 944 |
| 941 // We have no immediate actions to perform, so the BeginImplFrame should post | 945 // We have no immediate actions to perform, so the BeginImplFrame should post |
| 942 // the deadline task. | 946 // the deadline task. |
| 943 client.Reset(); | 947 client.Reset(); |
| 944 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting()); | 948 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting()); |
| 945 EXPECT_EQ(client.num_actions_(), 0); | 949 EXPECT_SINGLE_ACTION("WillBeginImplFrame", client); |
| 946 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); | 950 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); |
| 947 | 951 |
| 948 // On the deadline, he actions should have occured in the right order. | 952 // On the deadline, he actions should have occured in the right order. |
| 949 client.Reset(); | 953 client.Reset(); |
| 950 scheduler->OnBeginImplFrameDeadline(); | 954 scheduler->OnBeginImplFrameDeadline(); |
| 951 EXPECT_EQ(1, client.num_draws()); | 955 EXPECT_EQ(1, client.num_draws()); |
| 952 EXPECT_TRUE(client.HasAction("ScheduledActionDrawAndSwapIfPossible")); | 956 EXPECT_TRUE(client.HasAction("ScheduledActionDrawAndSwapIfPossible")); |
| 953 EXPECT_TRUE(client.HasAction("ScheduledActionManageTiles")); | 957 EXPECT_TRUE(client.HasAction("ScheduledActionManageTiles")); |
| 954 EXPECT_LT(client.ActionIndex("ScheduledActionDrawAndSwapIfPossible"), | 958 EXPECT_LT(client.ActionIndex("ScheduledActionDrawAndSwapIfPossible"), |
| 955 client.ActionIndex("ScheduledActionManageTiles")); | 959 client.ActionIndex("ScheduledActionManageTiles")); |
| 956 EXPECT_FALSE(scheduler->RedrawPending()); | 960 EXPECT_FALSE(scheduler->RedrawPending()); |
| 957 EXPECT_FALSE(scheduler->ManageTilesPending()); | 961 EXPECT_FALSE(scheduler->ManageTilesPending()); |
| 958 EXPECT_FALSE(scheduler->BeginImplFrameDeadlinePending()); | 962 EXPECT_FALSE(scheduler->BeginImplFrameDeadlinePending()); |
| 959 | 963 |
| 960 // Request a draw. We don't need a ManageTiles yet. | 964 // Request a draw. We don't need a ManageTiles yet. |
| 961 client.Reset(); | 965 client.Reset(); |
| 962 scheduler->SetNeedsRedraw(); | 966 scheduler->SetNeedsRedraw(); |
| 963 EXPECT_TRUE(scheduler->RedrawPending()); | 967 EXPECT_TRUE(scheduler->RedrawPending()); |
| 964 EXPECT_FALSE(scheduler->ManageTilesPending()); | 968 EXPECT_FALSE(scheduler->ManageTilesPending()); |
| 965 EXPECT_TRUE(client.needs_begin_impl_frame()); | 969 EXPECT_TRUE(client.needs_begin_impl_frame()); |
| 966 EXPECT_EQ(0, client.num_draws()); | 970 EXPECT_EQ(0, client.num_draws()); |
| 967 | 971 |
| 968 // We have no immediate actions to perform, so the BeginImplFrame should post | 972 // We have no immediate actions to perform, so the BeginImplFrame should post |
| 969 // the deadline task. | 973 // the deadline task. |
| 970 client.Reset(); | 974 client.Reset(); |
| 971 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting()); | 975 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting()); |
| 972 EXPECT_EQ(client.num_actions_(), 0); | 976 EXPECT_SINGLE_ACTION("WillBeginImplFrame", client); |
| 973 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); | 977 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); |
| 974 | 978 |
| 975 // Draw. The draw will trigger SetNeedsManageTiles, and | 979 // Draw. The draw will trigger SetNeedsManageTiles, and |
| 976 // then the ManageTiles action will be triggered after the Draw. | 980 // then the ManageTiles action will be triggered after the Draw. |
| 977 // Afterwards, neither a draw nor ManageTiles are pending. | 981 // Afterwards, neither a draw nor ManageTiles are pending. |
| 978 client.Reset(); | 982 client.Reset(); |
| 979 scheduler->OnBeginImplFrameDeadline(); | 983 scheduler->OnBeginImplFrameDeadline(); |
| 980 EXPECT_EQ(1, client.num_draws()); | 984 EXPECT_EQ(1, client.num_draws()); |
| 981 EXPECT_TRUE(client.HasAction("ScheduledActionDrawAndSwapIfPossible")); | 985 EXPECT_TRUE(client.HasAction("ScheduledActionDrawAndSwapIfPossible")); |
| 982 EXPECT_TRUE(client.HasAction("ScheduledActionManageTiles")); | 986 EXPECT_TRUE(client.HasAction("ScheduledActionManageTiles")); |
| 983 EXPECT_LT(client.ActionIndex("ScheduledActionDrawAndSwapIfPossible"), | 987 EXPECT_LT(client.ActionIndex("ScheduledActionDrawAndSwapIfPossible"), |
| 984 client.ActionIndex("ScheduledActionManageTiles")); | 988 client.ActionIndex("ScheduledActionManageTiles")); |
| 985 EXPECT_FALSE(scheduler->RedrawPending()); | 989 EXPECT_FALSE(scheduler->RedrawPending()); |
| 986 EXPECT_FALSE(scheduler->ManageTilesPending()); | 990 EXPECT_FALSE(scheduler->ManageTilesPending()); |
| 987 EXPECT_FALSE(scheduler->BeginImplFrameDeadlinePending()); | 991 EXPECT_FALSE(scheduler->BeginImplFrameDeadlinePending()); |
| 988 | 992 |
| 989 // We need a BeginImplFrame where we don't swap to go idle. | 993 // We need a BeginImplFrame where we don't swap to go idle. |
| 990 client.Reset(); | 994 client.Reset(); |
| 991 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting()); | 995 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting()); |
| 992 EXPECT_EQ(client.num_actions_(), 0); | 996 EXPECT_SINGLE_ACTION("WillBeginImplFrame", client); |
| 993 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); | 997 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); |
| 994 client.Reset(); | 998 client.Reset(); |
| 995 scheduler->OnBeginImplFrameDeadline(); | 999 scheduler->OnBeginImplFrameDeadline(); |
| 996 EXPECT_SINGLE_ACTION("SetNeedsBeginImplFrame", client); | 1000 EXPECT_SINGLE_ACTION("SetNeedsBeginFrame", client); |
| 997 EXPECT_FALSE(scheduler->BeginImplFrameDeadlinePending()); | 1001 EXPECT_FALSE(scheduler->BeginImplFrameDeadlinePending()); |
| 998 EXPECT_EQ(0, client.num_draws()); | 1002 EXPECT_EQ(0, client.num_draws()); |
| 999 | 1003 |
| 1000 // Now trigger a ManageTiles outside of a draw. We will then need | 1004 // Now trigger a ManageTiles outside of a draw. We will then need |
| 1001 // a begin-frame for the ManageTiles, but we don't need a draw. | 1005 // a begin-frame for the ManageTiles, but we don't need a draw. |
| 1002 client.Reset(); | 1006 client.Reset(); |
| 1003 EXPECT_FALSE(client.needs_begin_impl_frame()); | 1007 EXPECT_FALSE(client.needs_begin_impl_frame()); |
| 1004 scheduler->SetNeedsManageTiles(); | 1008 scheduler->SetNeedsManageTiles(); |
| 1005 EXPECT_TRUE(client.needs_begin_impl_frame()); | 1009 EXPECT_TRUE(client.needs_begin_impl_frame()); |
| 1006 EXPECT_TRUE(scheduler->ManageTilesPending()); | 1010 EXPECT_TRUE(scheduler->ManageTilesPending()); |
| 1007 EXPECT_FALSE(scheduler->RedrawPending()); | 1011 EXPECT_FALSE(scheduler->RedrawPending()); |
| 1008 | 1012 |
| 1009 // BeginImplFrame. There will be no draw, only ManageTiles. | 1013 // BeginImplFrame. There will be no draw, only ManageTiles. |
| 1010 client.Reset(); | 1014 client.Reset(); |
| 1011 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting()); | 1015 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting()); |
| 1012 EXPECT_EQ(client.num_actions_(), 0); | 1016 EXPECT_SINGLE_ACTION("WillBeginImplFrame", client); |
| 1013 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); | 1017 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); |
| 1014 client.Reset(); | 1018 client.Reset(); |
| 1015 scheduler->OnBeginImplFrameDeadline(); | 1019 scheduler->OnBeginImplFrameDeadline(); |
| 1016 EXPECT_EQ(0, client.num_draws()); | 1020 EXPECT_EQ(0, client.num_draws()); |
| 1017 EXPECT_FALSE(client.HasAction("ScheduledActionDrawAndSwapIfPossible")); | 1021 EXPECT_FALSE(client.HasAction("ScheduledActionDrawAndSwapIfPossible")); |
| 1018 EXPECT_TRUE(client.HasAction("ScheduledActionManageTiles")); | 1022 EXPECT_TRUE(client.HasAction("ScheduledActionManageTiles")); |
| 1019 EXPECT_FALSE(scheduler->BeginImplFrameDeadlinePending()); | 1023 EXPECT_FALSE(scheduler->BeginImplFrameDeadlinePending()); |
| 1020 } | 1024 } |
| 1021 | 1025 |
| 1022 // Test that ManageTiles only happens once per frame. If an external caller | 1026 // Test that ManageTiles only happens once per frame. If an external caller |
| 1023 // initiates it, then the state machine should not ManageTiles on that frame. | 1027 // initiates it, then the state machine should not ManageTiles on that frame. |
| 1024 TEST(SchedulerTest, ManageTilesOncePerFrame) { | 1028 TEST(SchedulerTest, ManageTilesOncePerFrame) { |
| 1025 FakeSchedulerClient client; | 1029 FakeSchedulerClient client; |
| 1026 SchedulerSettings default_scheduler_settings; | 1030 SchedulerSettings default_scheduler_settings; |
| 1027 Scheduler* scheduler = client.CreateScheduler(default_scheduler_settings); | 1031 Scheduler* scheduler = client.CreateScheduler(default_scheduler_settings); |
| 1028 scheduler->SetCanStart(); | 1032 scheduler->SetCanStart(); |
| 1029 scheduler->SetVisible(true); | 1033 scheduler->SetVisible(true); |
| 1030 scheduler->SetCanDraw(true); | 1034 scheduler->SetCanDraw(true); |
| 1031 InitializeOutputSurfaceAndFirstCommit(scheduler); | 1035 InitializeOutputSurfaceAndFirstCommit(scheduler); |
| 1032 | 1036 |
| 1033 // If DidManageTiles during a frame, then ManageTiles should not occur again. | 1037 // If DidManageTiles during a frame, then ManageTiles should not occur again. |
| 1034 scheduler->SetNeedsManageTiles(); | 1038 scheduler->SetNeedsManageTiles(); |
| 1035 scheduler->SetNeedsRedraw(); | 1039 scheduler->SetNeedsRedraw(); |
| 1036 client.Reset(); | 1040 client.Reset(); |
| 1037 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting()); | 1041 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting()); |
| 1038 EXPECT_EQ(client.num_actions_(), 0); | 1042 EXPECT_SINGLE_ACTION("WillBeginImplFrame", client); |
| 1039 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); | 1043 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); |
| 1040 | 1044 |
| 1041 EXPECT_TRUE(scheduler->ManageTilesPending()); | 1045 EXPECT_TRUE(scheduler->ManageTilesPending()); |
| 1042 scheduler->DidManageTiles(); // An explicit ManageTiles. | 1046 scheduler->DidManageTiles(); // An explicit ManageTiles. |
| 1043 EXPECT_FALSE(scheduler->ManageTilesPending()); | 1047 EXPECT_FALSE(scheduler->ManageTilesPending()); |
| 1044 | 1048 |
| 1045 client.Reset(); | 1049 client.Reset(); |
| 1046 scheduler->OnBeginImplFrameDeadline(); | 1050 scheduler->OnBeginImplFrameDeadline(); |
| 1047 EXPECT_EQ(1, client.num_draws()); | 1051 EXPECT_EQ(1, client.num_draws()); |
| 1048 EXPECT_TRUE(client.HasAction("ScheduledActionDrawAndSwapIfPossible")); | 1052 EXPECT_TRUE(client.HasAction("ScheduledActionDrawAndSwapIfPossible")); |
| 1049 EXPECT_FALSE(client.HasAction("ScheduledActionManageTiles")); | 1053 EXPECT_FALSE(client.HasAction("ScheduledActionManageTiles")); |
| 1050 EXPECT_FALSE(scheduler->RedrawPending()); | 1054 EXPECT_FALSE(scheduler->RedrawPending()); |
| 1051 EXPECT_FALSE(scheduler->ManageTilesPending()); | 1055 EXPECT_FALSE(scheduler->ManageTilesPending()); |
| 1052 EXPECT_FALSE(scheduler->BeginImplFrameDeadlinePending()); | 1056 EXPECT_FALSE(scheduler->BeginImplFrameDeadlinePending()); |
| 1053 | 1057 |
| 1054 // Next frame without DidManageTiles should ManageTiles with draw. | 1058 // Next frame without DidManageTiles should ManageTiles with draw. |
| 1055 scheduler->SetNeedsManageTiles(); | 1059 scheduler->SetNeedsManageTiles(); |
| 1056 scheduler->SetNeedsRedraw(); | 1060 scheduler->SetNeedsRedraw(); |
| 1057 client.Reset(); | 1061 client.Reset(); |
| 1058 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting()); | 1062 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting()); |
| 1059 EXPECT_EQ(client.num_actions_(), 0); | 1063 EXPECT_SINGLE_ACTION("WillBeginImplFrame", client); |
| 1060 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); | 1064 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); |
| 1061 | 1065 |
| 1062 client.Reset(); | 1066 client.Reset(); |
| 1063 scheduler->OnBeginImplFrameDeadline(); | 1067 scheduler->OnBeginImplFrameDeadline(); |
| 1064 EXPECT_EQ(1, client.num_draws()); | 1068 EXPECT_EQ(1, client.num_draws()); |
| 1065 EXPECT_TRUE(client.HasAction("ScheduledActionDrawAndSwapIfPossible")); | 1069 EXPECT_TRUE(client.HasAction("ScheduledActionDrawAndSwapIfPossible")); |
| 1066 EXPECT_TRUE(client.HasAction("ScheduledActionManageTiles")); | 1070 EXPECT_TRUE(client.HasAction("ScheduledActionManageTiles")); |
| 1067 EXPECT_LT(client.ActionIndex("ScheduledActionDrawAndSwapIfPossible"), | 1071 EXPECT_LT(client.ActionIndex("ScheduledActionDrawAndSwapIfPossible"), |
| 1068 client.ActionIndex("ScheduledActionManageTiles")); | 1072 client.ActionIndex("ScheduledActionManageTiles")); |
| 1069 EXPECT_FALSE(scheduler->RedrawPending()); | 1073 EXPECT_FALSE(scheduler->RedrawPending()); |
| 1070 EXPECT_FALSE(scheduler->ManageTilesPending()); | 1074 EXPECT_FALSE(scheduler->ManageTilesPending()); |
| 1071 EXPECT_FALSE(scheduler->BeginImplFrameDeadlinePending()); | 1075 EXPECT_FALSE(scheduler->BeginImplFrameDeadlinePending()); |
| 1072 scheduler->DidManageTiles(); // Corresponds to ScheduledActionManageTiles | 1076 scheduler->DidManageTiles(); // Corresponds to ScheduledActionManageTiles |
| 1073 | 1077 |
| 1074 // If we get another DidManageTiles within the same frame, we should | 1078 // If we get another DidManageTiles within the same frame, we should |
| 1075 // not ManageTiles on the next frame. | 1079 // not ManageTiles on the next frame. |
| 1076 scheduler->DidManageTiles(); // An explicit ManageTiles. | 1080 scheduler->DidManageTiles(); // An explicit ManageTiles. |
| 1077 scheduler->SetNeedsManageTiles(); | 1081 scheduler->SetNeedsManageTiles(); |
| 1078 scheduler->SetNeedsRedraw(); | 1082 scheduler->SetNeedsRedraw(); |
| 1079 client.Reset(); | 1083 client.Reset(); |
| 1080 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting()); | 1084 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting()); |
| 1081 EXPECT_EQ(client.num_actions_(), 0); | 1085 EXPECT_SINGLE_ACTION("WillBeginImplFrame", client); |
| 1082 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); | 1086 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); |
| 1083 | 1087 |
| 1084 EXPECT_TRUE(scheduler->ManageTilesPending()); | 1088 EXPECT_TRUE(scheduler->ManageTilesPending()); |
| 1085 | 1089 |
| 1086 client.Reset(); | 1090 client.Reset(); |
| 1087 scheduler->OnBeginImplFrameDeadline(); | 1091 scheduler->OnBeginImplFrameDeadline(); |
| 1088 EXPECT_EQ(1, client.num_draws()); | 1092 EXPECT_EQ(1, client.num_draws()); |
| 1089 EXPECT_TRUE(client.HasAction("ScheduledActionDrawAndSwapIfPossible")); | 1093 EXPECT_TRUE(client.HasAction("ScheduledActionDrawAndSwapIfPossible")); |
| 1090 EXPECT_FALSE(client.HasAction("ScheduledActionManageTiles")); | 1094 EXPECT_FALSE(client.HasAction("ScheduledActionManageTiles")); |
| 1091 EXPECT_FALSE(scheduler->RedrawPending()); | 1095 EXPECT_FALSE(scheduler->RedrawPending()); |
| 1092 EXPECT_FALSE(scheduler->BeginImplFrameDeadlinePending()); | 1096 EXPECT_FALSE(scheduler->BeginImplFrameDeadlinePending()); |
| 1093 | 1097 |
| 1094 // If we get another DidManageTiles, we should not ManageTiles on the next | 1098 // If we get another DidManageTiles, we should not ManageTiles on the next |
| 1095 // frame. This verifies we don't alternate calling ManageTiles once and twice. | 1099 // frame. This verifies we don't alternate calling ManageTiles once and twice. |
| 1096 EXPECT_TRUE(scheduler->ManageTilesPending()); | 1100 EXPECT_TRUE(scheduler->ManageTilesPending()); |
| 1097 scheduler->DidManageTiles(); // An explicit ManageTiles. | 1101 scheduler->DidManageTiles(); // An explicit ManageTiles. |
| 1098 EXPECT_FALSE(scheduler->ManageTilesPending()); | 1102 EXPECT_FALSE(scheduler->ManageTilesPending()); |
| 1099 scheduler->SetNeedsManageTiles(); | 1103 scheduler->SetNeedsManageTiles(); |
| 1100 scheduler->SetNeedsRedraw(); | 1104 scheduler->SetNeedsRedraw(); |
| 1101 client.Reset(); | 1105 client.Reset(); |
| 1102 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting()); | 1106 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting()); |
| 1103 EXPECT_EQ(client.num_actions_(), 0); | 1107 EXPECT_SINGLE_ACTION("WillBeginImplFrame", client); |
| 1104 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); | 1108 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); |
| 1105 | 1109 |
| 1106 EXPECT_TRUE(scheduler->ManageTilesPending()); | 1110 EXPECT_TRUE(scheduler->ManageTilesPending()); |
| 1107 | 1111 |
| 1108 client.Reset(); | 1112 client.Reset(); |
| 1109 scheduler->OnBeginImplFrameDeadline(); | 1113 scheduler->OnBeginImplFrameDeadline(); |
| 1110 EXPECT_EQ(1, client.num_draws()); | 1114 EXPECT_EQ(1, client.num_draws()); |
| 1111 EXPECT_TRUE(client.HasAction("ScheduledActionDrawAndSwapIfPossible")); | 1115 EXPECT_TRUE(client.HasAction("ScheduledActionDrawAndSwapIfPossible")); |
| 1112 EXPECT_FALSE(client.HasAction("ScheduledActionManageTiles")); | 1116 EXPECT_FALSE(client.HasAction("ScheduledActionManageTiles")); |
| 1113 EXPECT_FALSE(scheduler->RedrawPending()); | 1117 EXPECT_FALSE(scheduler->RedrawPending()); |
| 1114 EXPECT_FALSE(scheduler->BeginImplFrameDeadlinePending()); | 1118 EXPECT_FALSE(scheduler->BeginImplFrameDeadlinePending()); |
| 1115 | 1119 |
| 1116 // Next frame without DidManageTiles should ManageTiles with draw. | 1120 // Next frame without DidManageTiles should ManageTiles with draw. |
| 1117 scheduler->SetNeedsManageTiles(); | 1121 scheduler->SetNeedsManageTiles(); |
| 1118 scheduler->SetNeedsRedraw(); | 1122 scheduler->SetNeedsRedraw(); |
| 1119 client.Reset(); | 1123 client.Reset(); |
| 1120 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting()); | 1124 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting()); |
| 1121 EXPECT_EQ(client.num_actions_(), 0); | 1125 EXPECT_SINGLE_ACTION("WillBeginImplFrame", client); |
| 1122 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); | 1126 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); |
| 1123 | 1127 |
| 1124 client.Reset(); | 1128 client.Reset(); |
| 1125 scheduler->OnBeginImplFrameDeadline(); | 1129 scheduler->OnBeginImplFrameDeadline(); |
| 1126 EXPECT_EQ(1, client.num_draws()); | 1130 EXPECT_EQ(1, client.num_draws()); |
| 1127 EXPECT_TRUE(client.HasAction("ScheduledActionDrawAndSwapIfPossible")); | 1131 EXPECT_TRUE(client.HasAction("ScheduledActionDrawAndSwapIfPossible")); |
| 1128 EXPECT_TRUE(client.HasAction("ScheduledActionManageTiles")); | 1132 EXPECT_TRUE(client.HasAction("ScheduledActionManageTiles")); |
| 1129 EXPECT_LT(client.ActionIndex("ScheduledActionDrawAndSwapIfPossible"), | 1133 EXPECT_LT(client.ActionIndex("ScheduledActionDrawAndSwapIfPossible"), |
| 1130 client.ActionIndex("ScheduledActionManageTiles")); | 1134 client.ActionIndex("ScheduledActionManageTiles")); |
| 1131 EXPECT_FALSE(scheduler->RedrawPending()); | 1135 EXPECT_FALSE(scheduler->RedrawPending()); |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1303 SpinForMillis(interval * 2); | 1307 SpinForMillis(interval * 2); |
| 1304 EXPECT_GT(client.num_actions_(), actions_so_far); | 1308 EXPECT_GT(client.num_actions_(), actions_so_far); |
| 1305 EXPECT_STREQ(client.Action(client.num_actions_() - 1), | 1309 EXPECT_STREQ(client.Action(client.num_actions_() - 1), |
| 1306 "DidAnticipatedDrawTimeChange"); | 1310 "DidAnticipatedDrawTimeChange"); |
| 1307 actions_so_far = client.num_actions_(); | 1311 actions_so_far = client.num_actions_(); |
| 1308 } | 1312 } |
| 1309 } | 1313 } |
| 1310 | 1314 |
| 1311 } // namespace | 1315 } // namespace |
| 1312 } // namespace cc | 1316 } // namespace cc |
| OLD | NEW |