| 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 "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
| 10 #include "base/thread_task_runner_handle.h" | 10 #include "base/thread_task_runner_handle.h" |
| (...skipping 805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 816 void LayerTreeTest::RealEndTest() { | 816 void LayerTreeTest::RealEndTest() { |
| 817 // TODO(mithro): Make this method only end when not inside an impl frame. | 817 // TODO(mithro): Make this method only end when not inside an impl frame. |
| 818 if (layer_tree_host_ && !timed_out_ && | 818 if (layer_tree_host_ && !timed_out_ && |
| 819 proxy()->MainFrameWillHappenForTesting()) { | 819 proxy()->MainFrameWillHappenForTesting()) { |
| 820 main_task_runner_->PostTask( | 820 main_task_runner_->PostTask( |
| 821 FROM_HERE, | 821 FROM_HERE, |
| 822 base::Bind(&LayerTreeTest::RealEndTest, main_thread_weak_ptr_)); | 822 base::Bind(&LayerTreeTest::RealEndTest, main_thread_weak_ptr_)); |
| 823 return; | 823 return; |
| 824 } | 824 } |
| 825 | 825 |
| 826 base::MessageLoop::current()->Quit(); | 826 base::MessageLoop::current()->QuitWhenIdle(); |
| 827 } | 827 } |
| 828 | 828 |
| 829 void LayerTreeTest::DispatchAddAnimation(Layer* layer_to_receive_animation, | 829 void LayerTreeTest::DispatchAddAnimation(Layer* layer_to_receive_animation, |
| 830 double animation_duration) { | 830 double animation_duration) { |
| 831 DCHECK(!proxy() || proxy()->IsMainThread()); | 831 DCHECK(!proxy() || proxy()->IsMainThread()); |
| 832 | 832 |
| 833 if (layer_to_receive_animation) { | 833 if (layer_to_receive_animation) { |
| 834 AddOpacityTransitionToLayer( | 834 AddOpacityTransitionToLayer( |
| 835 layer_to_receive_animation, animation_duration, 0, 0.5, true); | 835 layer_to_receive_animation, animation_duration, 0, 0.5, true); |
| 836 } | 836 } |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 997 LayerTreeHost* LayerTreeTest::layer_tree_host() { | 997 LayerTreeHost* LayerTreeTest::layer_tree_host() { |
| 998 // We check for a null proxy here as we sometimes ask for the layer tree host | 998 // We check for a null proxy here as we sometimes ask for the layer tree host |
| 999 // when the proxy does not exist, often for checking settings after a test has | 999 // when the proxy does not exist, often for checking settings after a test has |
| 1000 // completed. For example, LTHPixelResourceTest::RunPixelResourceTest. See | 1000 // completed. For example, LTHPixelResourceTest::RunPixelResourceTest. See |
| 1001 // elsewhere in this file for other examples. | 1001 // elsewhere in this file for other examples. |
| 1002 DCHECK(!proxy() || proxy()->IsMainThread() || proxy()->IsMainThreadBlocked()); | 1002 DCHECK(!proxy() || proxy()->IsMainThread() || proxy()->IsMainThreadBlocked()); |
| 1003 return layer_tree_host_.get(); | 1003 return layer_tree_host_.get(); |
| 1004 } | 1004 } |
| 1005 | 1005 |
| 1006 } // namespace cc | 1006 } // namespace cc |
| OLD | NEW |