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 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
561 void LayerTreeTest::ScheduleComposite() { | 561 void LayerTreeTest::ScheduleComposite() { |
562 if (!started_ || scheduled_) | 562 if (!started_ || scheduled_) |
563 return; | 563 return; |
564 scheduled_ = true; | 564 scheduled_ = true; |
565 main_task_runner_->PostTask( | 565 main_task_runner_->PostTask( |
566 FROM_HERE, | 566 FROM_HERE, |
567 base::Bind(&LayerTreeTest::DispatchComposite, main_thread_weak_ptr_)); | 567 base::Bind(&LayerTreeTest::DispatchComposite, main_thread_weak_ptr_)); |
568 } | 568 } |
569 | 569 |
570 void LayerTreeTest::RealEndTest() { | 570 void LayerTreeTest::RealEndTest() { |
571 if (layer_tree_host_ && proxy()->CommitPendingForTesting()) { | 571 if (layer_tree_host_ && !timed_out_ && |
| 572 proxy()->MainFrameWillHappenForTesting()) { |
572 main_task_runner_->PostTask( | 573 main_task_runner_->PostTask( |
573 FROM_HERE, | 574 FROM_HERE, |
574 base::Bind(&LayerTreeTest::RealEndTest, main_thread_weak_ptr_)); | 575 base::Bind(&LayerTreeTest::RealEndTest, main_thread_weak_ptr_)); |
575 return; | 576 return; |
576 } | 577 } |
577 | 578 |
578 base::MessageLoop::current()->Quit(); | 579 base::MessageLoop::current()->Quit(); |
579 } | 580 } |
580 | 581 |
581 void LayerTreeTest::DispatchAddAnimation(Layer* layer_to_receive_animation, | 582 void LayerTreeTest::DispatchAddAnimation(Layer* layer_to_receive_animation, |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
741 return -1; | 742 return -1; |
742 } | 743 } |
743 | 744 |
744 void LayerTreeTest::DestroyLayerTreeHost() { | 745 void LayerTreeTest::DestroyLayerTreeHost() { |
745 if (layer_tree_host_ && layer_tree_host_->root_layer()) | 746 if (layer_tree_host_ && layer_tree_host_->root_layer()) |
746 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL); | 747 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL); |
747 layer_tree_host_.reset(); | 748 layer_tree_host_.reset(); |
748 } | 749 } |
749 | 750 |
750 } // namespace cc | 751 } // namespace cc |
OLD | NEW |