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" |
11 #include "cc/animation/timing_function.h" | 11 #include "cc/animation/timing_function.h" |
12 #include "cc/base/thread_impl.h" | 12 #include "cc/base/thread_impl.h" |
13 #include "cc/input/input_handler.h" | 13 #include "cc/input/input_handler.h" |
14 #include "cc/layers/content_layer.h" | 14 #include "cc/layers/content_layer.h" |
15 #include "cc/layers/layer.h" | 15 #include "cc/layers/layer.h" |
16 #include "cc/layers/layer_impl.h" | 16 #include "cc/layers/layer_impl.h" |
17 #include "cc/test/animation_test_common.h" | 17 #include "cc/test/animation_test_common.h" |
18 #include "cc/test/fake_layer_tree_host_client.h" | 18 #include "cc/test/fake_layer_tree_host_client.h" |
19 #include "cc/test/fake_output_surface.h" | 19 #include "cc/test/fake_output_surface.h" |
20 #include "cc/test/occlusion_tracker_test_common.h" | 20 #include "cc/test/occlusion_tracker_test_common.h" |
21 #include "cc/test/tiled_layer_test_common.h" | 21 #include "cc/test/tiled_layer_test_common.h" |
22 #include "cc/trees/layer_tree_host_impl.h" | 22 #include "cc/trees/layer_tree_host_impl.h" |
23 #include "cc/trees/single_thread_proxy.h" | 23 #include "cc/trees/single_thread_proxy.h" |
24 #include "testing/gmock/include/gmock/gmock.h" | 24 #include "testing/gmock/include/gmock/gmock.h" |
25 #include "third_party/WebKit/Source/Platform/chromium/public/WebFilterOperation.
h" | |
26 #include "third_party/WebKit/Source/Platform/chromium/public/WebFilterOperations
.h" | |
27 #include "ui/gfx/size_conversions.h" | 25 #include "ui/gfx/size_conversions.h" |
28 | 26 |
29 using namespace WebKit; | |
30 | |
31 namespace cc { | 27 namespace cc { |
32 | 28 |
33 TestHooks::TestHooks() { | 29 TestHooks::TestHooks() { |
34 fake_client_.reset( | 30 fake_client_.reset( |
35 new FakeLayerTreeHostClient(FakeLayerTreeHostClient::DIRECT_3D)); | 31 new FakeLayerTreeHostClient(FakeLayerTreeHostClient::DIRECT_3D)); |
36 } | 32 } |
37 | 33 |
38 TestHooks::~TestHooks() {} | 34 TestHooks::~TestHooks() {} |
39 | 35 |
40 bool TestHooks::PrepareToDrawOnThread(LayerTreeHostImpl* host_impl, | 36 bool TestHooks::PrepareToDrawOnThread(LayerTreeHostImpl* host_impl, |
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 } | 437 } |
442 | 438 |
443 void LayerTreeTest::RealEndTest() { | 439 void LayerTreeTest::RealEndTest() { |
444 ended_ = true; | 440 ended_ = true; |
445 | 441 |
446 if (layer_tree_host_ && proxy()->CommitPendingForTesting()) { | 442 if (layer_tree_host_ && proxy()->CommitPendingForTesting()) { |
447 proxy()->MainThread()->PostTask( | 443 proxy()->MainThread()->PostTask( |
448 base::Bind(&LayerTreeTest::RealEndTest, main_thread_weak_ptr_)); | 444 base::Bind(&LayerTreeTest::RealEndTest, main_thread_weak_ptr_)); |
449 return; | 445 return; |
450 } | 446 } |
451 | 447 |
452 MessageLoop::current()->Quit(); | 448 MessageLoop::current()->Quit(); |
453 } | 449 } |
454 | 450 |
455 void LayerTreeTest::DispatchAddInstantAnimation() { | 451 void LayerTreeTest::DispatchAddInstantAnimation() { |
456 DCHECK(!proxy() || proxy()->IsMainThread()); | 452 DCHECK(!proxy() || proxy()->IsMainThread()); |
457 | 453 |
458 if (layer_tree_host_.get() && layer_tree_host_->root_layer()) { | 454 if (layer_tree_host_.get() && layer_tree_host_->root_layer()) { |
459 AddOpacityTransitionToLayer(layer_tree_host_->root_layer(), | 455 AddOpacityTransitionToLayer(layer_tree_host_->root_layer(), |
460 0, | 456 0, |
461 0, | 457 0, |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
553 ASSERT_FALSE(layer_tree_host_.get()); | 549 ASSERT_FALSE(layer_tree_host_.get()); |
554 client_.reset(); | 550 client_.reset(); |
555 if (timed_out_) { | 551 if (timed_out_) { |
556 FAIL() << "Test timed out"; | 552 FAIL() << "Test timed out"; |
557 return; | 553 return; |
558 } | 554 } |
559 AfterTest(); | 555 AfterTest(); |
560 } | 556 } |
561 | 557 |
562 } // namespace cc | 558 } // namespace cc |
OLD | NEW |