OLD | NEW |
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 "base/compiler_specific.h" | 5 #include "base/compiler_specific.h" |
6 #include "base/macros.h" | 6 #include "base/macros.h" |
7 #include "cc/test/fake_content_layer_client.h" | 7 #include "cc/test/fake_content_layer_client.h" |
8 #include "cc/test/fake_picture_layer.h" | 8 #include "cc/test/fake_picture_layer.h" |
9 #include "cc/test/layer_tree_test.h" | 9 #include "cc/test/layer_tree_test.h" |
10 #include "cc/trees/proxy_impl.h" | 10 #include "cc/trees/proxy_impl.h" |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 case 1: | 268 case 1: |
269 // This is for case 2 in DidCommit. | 269 // This is for case 2 in DidCommit. |
270 // Here we don't ever unblock activation. Since the commit hasn't | 270 // Here we don't ever unblock activation. Since the commit hasn't |
271 // requested to wait, we can verify that activation is blocked when the | 271 // requested to wait, we can verify that activation is blocked when the |
272 // commit completes (case 3 in DidCommit). | 272 // commit completes (case 3 in DidCommit). |
273 break; | 273 break; |
274 } | 274 } |
275 } | 275 } |
276 | 276 |
277 void DidCommit() override { | 277 void DidCommit() override { |
278 switch (layer_tree_host()->source_frame_number()) { | 278 switch (layer_tree_host()->SourceFrameNumber()) { |
279 case 1: | 279 case 1: |
280 // Request a new commit, but DidCommit will be delayed until activation | 280 // Request a new commit, but DidCommit will be delayed until activation |
281 // completes. | 281 // completes. |
282 layer_tree_host()->SetNextCommitWaitsForActivation(); | 282 layer_tree_host()->SetNextCommitWaitsForActivation(); |
283 layer_tree_host()->SetNeedsCommit(); | 283 layer_tree_host()->SetNeedsCommit(); |
284 break; | 284 break; |
285 case 2: { | 285 case 2: { |
286 base::AutoLock hold(activate_blocked_lock_); | 286 base::AutoLock hold(activate_blocked_lock_); |
287 EXPECT_FALSE(activate_blocked_); | 287 EXPECT_FALSE(activate_blocked_); |
288 } | 288 } |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 auto unblock = | 375 auto unblock = |
376 base::Bind(&LayerTreeHostProxyTestCommitWaitsForActivationMFBA:: | 376 base::Bind(&LayerTreeHostProxyTestCommitWaitsForActivationMFBA:: |
377 UnblockActivation, | 377 UnblockActivation, |
378 base::Unretained(this), impl); | 378 base::Unretained(this), impl); |
379 ImplThreadTaskRunner()->PostDelayedTask( | 379 ImplThreadTaskRunner()->PostDelayedTask( |
380 FROM_HERE, unblock, base::TimeDelta::FromMilliseconds(16 * 4)); | 380 FROM_HERE, unblock, base::TimeDelta::FromMilliseconds(16 * 4)); |
381 } | 381 } |
382 } | 382 } |
383 | 383 |
384 void DidCommit() override { | 384 void DidCommit() override { |
385 switch (layer_tree_host()->source_frame_number()) { | 385 switch (layer_tree_host()->SourceFrameNumber()) { |
386 case 1: | 386 case 1: |
387 // Request a new commit, but DidCommit will be delayed until activation | 387 // Request a new commit, but DidCommit will be delayed until activation |
388 // completes. | 388 // completes. |
389 layer_tree_host()->SetNextCommitWaitsForActivation(); | 389 layer_tree_host()->SetNextCommitWaitsForActivation(); |
390 layer_tree_host()->SetNeedsCommit(); | 390 layer_tree_host()->SetNeedsCommit(); |
391 break; | 391 break; |
392 case 2: | 392 case 2: |
393 // This DidCommit should not happen until activation is done for the | 393 // This DidCommit should not happen until activation is done for the |
394 // frame. | 394 // frame. |
395 { | 395 { |
(...skipping 18 matching lines...) Expand all Loading... |
414 private: | 414 private: |
415 base::Lock activate_blocked_lock_; | 415 base::Lock activate_blocked_lock_; |
416 bool activate_blocked_ = false; | 416 bool activate_blocked_ = false; |
417 | 417 |
418 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostProxyTestCommitWaitsForActivationMFBA); | 418 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostProxyTestCommitWaitsForActivationMFBA); |
419 }; | 419 }; |
420 | 420 |
421 MULTI_THREAD_TEST_F(LayerTreeHostProxyTestCommitWaitsForActivationMFBA); | 421 MULTI_THREAD_TEST_F(LayerTreeHostProxyTestCommitWaitsForActivationMFBA); |
422 | 422 |
423 } // namespace cc | 423 } // namespace cc |
OLD | NEW |