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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 DCHECK(CalledOnValidThread()); | 84 DCHECK(CalledOnValidThread()); |
85 is_ready_ = true; | 85 is_ready_ = true; |
86 } | 86 } |
87 | 87 |
88 bool is_ready() const { | 88 bool is_ready() const { |
89 return is_ready_; | 89 return is_ready_; |
90 } | 90 } |
91 | 91 |
92 void TestOnBeginFrame() { | 92 void TestOnBeginFrame() { |
93 DCHECK(CalledOnValidThread()); | 93 DCHECK(CalledOnValidThread()); |
94 CallOnBeginFrame(CreateBeginFrameArgsForTesting()); | 94 CallOnBeginFrame(CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE)); |
95 } | 95 } |
96 | 96 |
97 private: | 97 private: |
98 double milliseconds_per_frame_; | 98 double milliseconds_per_frame_; |
99 bool is_ready_; | 99 bool is_ready_; |
100 base::WeakPtrFactory<ExternalBeginFrameSourceForTest> weak_ptr_factory_; | 100 base::WeakPtrFactory<ExternalBeginFrameSourceForTest> weak_ptr_factory_; |
101 }; | 101 }; |
102 | 102 |
103 // Adapts ThreadProxy for test. Injects test hooks for testing. | 103 // Adapts ThreadProxy for test. Injects test hooks for testing. |
104 class ThreadProxyForTest : public ThreadProxy { | 104 class ThreadProxyForTest : public ThreadProxy { |
(...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
824 return -1; | 824 return -1; |
825 } | 825 } |
826 | 826 |
827 void LayerTreeTest::DestroyLayerTreeHost() { | 827 void LayerTreeTest::DestroyLayerTreeHost() { |
828 if (layer_tree_host_ && layer_tree_host_->root_layer()) | 828 if (layer_tree_host_ && layer_tree_host_->root_layer()) |
829 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL); | 829 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL); |
830 layer_tree_host_ = nullptr; | 830 layer_tree_host_ = nullptr; |
831 } | 831 } |
832 | 832 |
833 } // namespace cc | 833 } // namespace cc |
OLD | NEW |