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 | 4 |
5 #include "cc/test/layer_tree_test.h" | 5 #include "cc/test/layer_tree_test.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "cc/animation/animation.h" | 8 #include "cc/animation/animation.h" |
9 #include "cc/animation/animation_registrar.h" | 9 #include "cc/animation/animation_registrar.h" |
10 #include "cc/animation/layer_animation_controller.h" | 10 #include "cc/animation/layer_animation_controller.h" |
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 0, | 455 0, |
456 0.5, | 456 0.5, |
457 false); | 457 false); |
458 } | 458 } |
459 } | 459 } |
460 | 460 |
461 void LayerTreeTest::DispatchAddAnimation(Layer* layer_to_receive_animation) { | 461 void LayerTreeTest::DispatchAddAnimation(Layer* layer_to_receive_animation) { |
462 DCHECK(!proxy() || proxy()->IsMainThread()); | 462 DCHECK(!proxy() || proxy()->IsMainThread()); |
463 | 463 |
464 if (layer_to_receive_animation) | 464 if (layer_to_receive_animation) |
465 AddOpacityTransitionToLayer(layer_to_receive_animation, 10, 0, 0.5, true); | 465 AddOpacityTransitionToLayer(layer_to_receive_animation, |
| 466 0.000001, |
| 467 0, |
| 468 0.5, |
| 469 true); |
466 } | 470 } |
467 | 471 |
468 void LayerTreeTest::DispatchSetNeedsCommit() { | 472 void LayerTreeTest::DispatchSetNeedsCommit() { |
469 DCHECK(!proxy() || proxy()->IsMainThread()); | 473 DCHECK(!proxy() || proxy()->IsMainThread()); |
470 | 474 |
471 if (layer_tree_host_) | 475 if (layer_tree_host_) |
472 layer_tree_host_->SetNeedsCommit(); | 476 layer_tree_host_->SetNeedsCommit(); |
473 } | 477 } |
474 | 478 |
475 void LayerTreeTest::DispatchAcquireLayerTextures() { | 479 void LayerTreeTest::DispatchAcquireLayerTextures() { |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
507 return; | 511 return; |
508 | 512 |
509 // If the LTH is not visible, defer the composite until the LTH is made | 513 // If the LTH is not visible, defer the composite until the LTH is made |
510 // visible. | 514 // visible. |
511 if (!layer_tree_host_->visible()) { | 515 if (!layer_tree_host_->visible()) { |
512 schedule_when_set_visible_true_ = true; | 516 schedule_when_set_visible_true_ = true; |
513 return; | 517 return; |
514 } | 518 } |
515 | 519 |
516 schedule_when_set_visible_true_ = false; | 520 schedule_when_set_visible_true_ = false; |
517 layer_tree_host_->Composite(base::TimeTicks::Now()); | 521 base::TimeTicks now = base::TimeTicks::Now(); |
| 522 layer_tree_host_->UpdateAnimations(now); |
| 523 layer_tree_host_->Composite(now); |
518 } | 524 } |
519 | 525 |
520 void LayerTreeTest::RunTest(bool threaded) { | 526 void LayerTreeTest::RunTest(bool threaded) { |
521 if (threaded) { | 527 if (threaded) { |
522 impl_thread_.reset(new base::Thread("LayerTreeTest")); | 528 impl_thread_.reset(new base::Thread("LayerTreeTest")); |
523 ASSERT_TRUE(impl_thread_->Start()); | 529 ASSERT_TRUE(impl_thread_->Start()); |
524 } | 530 } |
525 | 531 |
526 main_ccthread_ = cc::ThreadImpl::CreateForCurrentThread(); | 532 main_ccthread_ = cc::ThreadImpl::CreateForCurrentThread(); |
527 | 533 |
(...skipping 19 matching lines...) Expand all Loading... |
547 ASSERT_FALSE(layer_tree_host_.get()); | 553 ASSERT_FALSE(layer_tree_host_.get()); |
548 client_.reset(); | 554 client_.reset(); |
549 if (timed_out_) { | 555 if (timed_out_) { |
550 FAIL() << "Test timed out"; | 556 FAIL() << "Test timed out"; |
551 return; | 557 return; |
552 } | 558 } |
553 AfterTest(); | 559 AfterTest(); |
554 } | 560 } |
555 | 561 |
556 } // namespace cc | 562 } // namespace cc |
OLD | NEW |