| 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 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 void DidCompleteSwapBuffers() override { | 435 void DidCompleteSwapBuffers() override { |
| 436 test_hooks_->DidCompleteSwapBuffers(); | 436 test_hooks_->DidCompleteSwapBuffers(); |
| 437 } | 437 } |
| 438 | 438 |
| 439 void DidPostSwapBuffers() override {} | 439 void DidPostSwapBuffers() override {} |
| 440 void DidAbortSwapBuffers() override {} | 440 void DidAbortSwapBuffers() override {} |
| 441 void ScheduleComposite() override { test_hooks_->ScheduleComposite(); } | 441 void ScheduleComposite() override { test_hooks_->ScheduleComposite(); } |
| 442 void DidCompletePageScaleAnimation() override {} | 442 void DidCompletePageScaleAnimation() override {} |
| 443 void BeginMainFrameNotExpectedSoon() override {} | 443 void BeginMainFrameNotExpectedSoon() override {} |
| 444 | 444 |
| 445 void RecordFrameTimingEvents( |
| 446 scoped_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, |
| 447 scoped_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events) |
| 448 override {} |
| 449 |
| 445 private: | 450 private: |
| 446 explicit LayerTreeHostClientForTesting(TestHooks* test_hooks) | 451 explicit LayerTreeHostClientForTesting(TestHooks* test_hooks) |
| 447 : test_hooks_(test_hooks) {} | 452 : test_hooks_(test_hooks) {} |
| 448 | 453 |
| 449 TestHooks* test_hooks_; | 454 TestHooks* test_hooks_; |
| 450 }; | 455 }; |
| 451 | 456 |
| 452 // Adapts LayerTreeHost for test. Injects LayerTreeHostImplForTesting. | 457 // Adapts LayerTreeHost for test. Injects LayerTreeHostImplForTesting. |
| 453 class LayerTreeHostForTesting : public LayerTreeHost { | 458 class LayerTreeHostForTesting : public LayerTreeHost { |
| 454 public: | 459 public: |
| (...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 884 LayerTreeHost* LayerTreeTest::layer_tree_host() { | 889 LayerTreeHost* LayerTreeTest::layer_tree_host() { |
| 885 // We check for a null proxy here as we sometimes ask for the layer tree host | 890 // We check for a null proxy here as we sometimes ask for the layer tree host |
| 886 // when the proxy does not exist, often for checking settings after a test has | 891 // when the proxy does not exist, often for checking settings after a test has |
| 887 // completed. For example, LTHPixelResourceTest::RunPixelResourceTest. See | 892 // completed. For example, LTHPixelResourceTest::RunPixelResourceTest. See |
| 888 // elsewhere in this file for other examples. | 893 // elsewhere in this file for other examples. |
| 889 DCHECK(!proxy() || proxy()->IsMainThread() || proxy()->IsMainThreadBlocked()); | 894 DCHECK(!proxy() || proxy()->IsMainThread() || proxy()->IsMainThreadBlocked()); |
| 890 return layer_tree_host_.get(); | 895 return layer_tree_host_.get(); |
| 891 } | 896 } |
| 892 | 897 |
| 893 } // namespace cc | 898 } // namespace cc |
| OLD | NEW |