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 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 main_thread_weak_ptr_)); | 566 main_thread_weak_ptr_)); |
567 } | 567 } |
568 | 568 |
569 void LayerTreeTest::PostCompositeImmediatelyToMainThread() { | 569 void LayerTreeTest::PostCompositeImmediatelyToMainThread() { |
570 main_task_runner_->PostTask( | 570 main_task_runner_->PostTask( |
571 FROM_HERE, | 571 FROM_HERE, |
572 base::Bind(&LayerTreeTest::DispatchCompositeImmediately, | 572 base::Bind(&LayerTreeTest::DispatchCompositeImmediately, |
573 main_thread_weak_ptr_)); | 573 main_thread_weak_ptr_)); |
574 } | 574 } |
575 | 575 |
| 576 void LayerTreeTest::PostEndTestToMainThread() { |
| 577 main_task_runner_->PostTask( |
| 578 FROM_HERE, base::Bind(&LayerTreeTest::EndTest, main_thread_weak_ptr_)); |
| 579 } |
| 580 |
576 void LayerTreeTest::WillBeginTest() { | 581 void LayerTreeTest::WillBeginTest() { |
577 layer_tree_host_->SetLayerTreeHostClientReady(); | 582 layer_tree_host_->SetLayerTreeHostClientReady(); |
578 } | 583 } |
579 | 584 |
580 void LayerTreeTest::DoBeginTest() { | 585 void LayerTreeTest::DoBeginTest() { |
581 client_ = LayerTreeHostClientForTesting::Create(this); | 586 client_ = LayerTreeHostClientForTesting::Create(this); |
582 | 587 |
583 scoped_ptr<FakeExternalBeginFrameSource> external_begin_frame_source; | 588 scoped_ptr<FakeExternalBeginFrameSource> external_begin_frame_source; |
584 if (settings_.use_external_begin_frame_source) { | 589 if (settings_.use_external_begin_frame_source) { |
585 external_begin_frame_source.reset(new FakeExternalBeginFrameSource( | 590 external_begin_frame_source.reset(new FakeExternalBeginFrameSource( |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
791 return -1; | 796 return -1; |
792 } | 797 } |
793 | 798 |
794 void LayerTreeTest::DestroyLayerTreeHost() { | 799 void LayerTreeTest::DestroyLayerTreeHost() { |
795 if (layer_tree_host_ && layer_tree_host_->root_layer()) | 800 if (layer_tree_host_ && layer_tree_host_->root_layer()) |
796 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL); | 801 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL); |
797 layer_tree_host_ = nullptr; | 802 layer_tree_host_ = nullptr; |
798 } | 803 } |
799 | 804 |
800 } // namespace cc | 805 } // namespace cc |
OLD | NEW |