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 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
543 gfx::ScaleSize(root_bounds, layer_tree_host_->device_scale_factor())); | 543 gfx::ScaleSize(root_bounds, layer_tree_host_->device_scale_factor())); |
544 layer_tree_host_->SetViewportSize(device_root_bounds); | 544 layer_tree_host_->SetViewportSize(device_root_bounds); |
545 } | 545 } |
546 | 546 |
547 void LayerTreeTest::Timeout() { | 547 void LayerTreeTest::Timeout() { |
548 timed_out_ = true; | 548 timed_out_ = true; |
549 EndTest(); | 549 EndTest(); |
550 } | 550 } |
551 | 551 |
552 void LayerTreeTest::RealEndTest() { | 552 void LayerTreeTest::RealEndTest() { |
553 if (layer_tree_host_ && proxy()->CommitPendingForTesting()) { | 553 if (layer_tree_host_ && !timed_out_ && |
| 554 proxy()->MainFrameWillHappenForTesting()) { |
554 main_task_runner_->PostTask( | 555 main_task_runner_->PostTask( |
555 FROM_HERE, | 556 FROM_HERE, |
556 base::Bind(&LayerTreeTest::RealEndTest, main_thread_weak_ptr_)); | 557 base::Bind(&LayerTreeTest::RealEndTest, main_thread_weak_ptr_)); |
557 return; | 558 return; |
558 } | 559 } |
559 | 560 |
560 base::MessageLoop::current()->Quit(); | 561 base::MessageLoop::current()->Quit(); |
561 } | 562 } |
562 | 563 |
563 void LayerTreeTest::DispatchAddAnimation(Layer* layer_to_receive_animation, | 564 void LayerTreeTest::DispatchAddAnimation(Layer* layer_to_receive_animation, |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
697 return -1; | 698 return -1; |
698 } | 699 } |
699 | 700 |
700 void LayerTreeTest::DestroyLayerTreeHost() { | 701 void LayerTreeTest::DestroyLayerTreeHost() { |
701 if (layer_tree_host_ && layer_tree_host_->root_layer()) | 702 if (layer_tree_host_ && layer_tree_host_->root_layer()) |
702 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL); | 703 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL); |
703 layer_tree_host_.reset(); | 704 layer_tree_host_.reset(); |
704 } | 705 } |
705 | 706 |
706 } // namespace cc | 707 } // namespace cc |
OLD | NEW |