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/trees/layer_tree_host.h" | 5 #include "cc/trees/layer_tree_host.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 LayerTreeHostTest() : contents_texture_manager_(nullptr) {} | 79 LayerTreeHostTest() : contents_texture_manager_(nullptr) {} |
80 | 80 |
81 void DidInitializeOutputSurface() override { | 81 void DidInitializeOutputSurface() override { |
82 contents_texture_manager_ = layer_tree_host()->contents_texture_manager(); | 82 contents_texture_manager_ = layer_tree_host()->contents_texture_manager(); |
83 } | 83 } |
84 | 84 |
85 protected: | 85 protected: |
86 PrioritizedResourceManager* contents_texture_manager_; | 86 PrioritizedResourceManager* contents_texture_manager_; |
87 }; | 87 }; |
88 | 88 |
| 89 class LayerTreeHostTestHasImplThreadTest : public LayerTreeHostTest { |
| 90 public: |
| 91 LayerTreeHostTestHasImplThreadTest() : threaded_(false) {} |
| 92 |
| 93 void RunTest(bool threaded, |
| 94 bool delegating_renderer, |
| 95 bool impl_side_painting) override { |
| 96 threaded_ = threaded; |
| 97 LayerTreeHostTest::RunTest(threaded, delegating_renderer, |
| 98 impl_side_painting); |
| 99 } |
| 100 |
| 101 void BeginTest() override { |
| 102 EXPECT_EQ(threaded_, HasImplThread()); |
| 103 EndTest(); |
| 104 } |
| 105 |
| 106 void AfterTest() override { EXPECT_EQ(threaded_, HasImplThread()); } |
| 107 |
| 108 private: |
| 109 bool threaded_; |
| 110 }; |
| 111 |
| 112 SINGLE_AND_MULTI_THREAD_IMPL_TEST_F(LayerTreeHostTestHasImplThreadTest); |
| 113 |
89 class LayerTreeHostTestSetNeedsCommitInsideLayout : public LayerTreeHostTest { | 114 class LayerTreeHostTestSetNeedsCommitInsideLayout : public LayerTreeHostTest { |
90 protected: | 115 protected: |
91 void BeginTest() override { PostSetNeedsCommitToMainThread(); } | 116 void BeginTest() override { PostSetNeedsCommitToMainThread(); } |
92 | 117 |
93 void Layout() override { | 118 void Layout() override { |
94 // This shouldn't cause a second commit to happen. | 119 // This shouldn't cause a second commit to happen. |
95 layer_tree_host()->SetNeedsCommit(); | 120 layer_tree_host()->SetNeedsCommit(); |
96 } | 121 } |
97 | 122 |
98 void DidCommit() override { | 123 void DidCommit() override { |
(...skipping 6926 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7025 void AfterTest() override {} | 7050 void AfterTest() override {} |
7026 | 7051 |
7027 scoped_refptr<FakePictureLayer> content_child_layer_; | 7052 scoped_refptr<FakePictureLayer> content_child_layer_; |
7028 FakeContentLayerClient client_; | 7053 FakeContentLayerClient client_; |
7029 }; | 7054 }; |
7030 | 7055 |
7031 SINGLE_AND_MULTI_THREAD_TEST_F( | 7056 SINGLE_AND_MULTI_THREAD_TEST_F( |
7032 LayerTreeTestReflectionMaskLayerForSurfaceWithUnclippedChild); | 7057 LayerTreeTestReflectionMaskLayerForSurfaceWithUnclippedChild); |
7033 | 7058 |
7034 } // namespace cc | 7059 } // namespace cc |
OLD | NEW |