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 { | |
danakj
2015/05/06 22:39:08
while i like tests that test themselves, i don't k
| |
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 SINGLE_AND_MULTI_THREAD_IMPL_TEST_F(LayerTreeHostTestHasImplThreadTest); | |
danakj
2015/05/06 22:39:08
whitespace after class defn
mithro-old
2015/05/06 23:24:43
Done.
| |
112 | |
89 class LayerTreeHostTestSetNeedsCommitInsideLayout : public LayerTreeHostTest { | 113 class LayerTreeHostTestSetNeedsCommitInsideLayout : public LayerTreeHostTest { |
90 protected: | 114 protected: |
91 void BeginTest() override { PostSetNeedsCommitToMainThread(); } | 115 void BeginTest() override { PostSetNeedsCommitToMainThread(); } |
92 | 116 |
93 void Layout() override { | 117 void Layout() override { |
94 // This shouldn't cause a second commit to happen. | 118 // This shouldn't cause a second commit to happen. |
95 layer_tree_host()->SetNeedsCommit(); | 119 layer_tree_host()->SetNeedsCommit(); |
96 } | 120 } |
97 | 121 |
98 void DidCommit() override { | 122 void DidCommit() override { |
(...skipping 6887 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6986 void AfterTest() override {} | 7010 void AfterTest() override {} |
6987 | 7011 |
6988 scoped_refptr<FakePictureLayer> content_child_layer_; | 7012 scoped_refptr<FakePictureLayer> content_child_layer_; |
6989 FakeContentLayerClient client_; | 7013 FakeContentLayerClient client_; |
6990 }; | 7014 }; |
6991 | 7015 |
6992 SINGLE_AND_MULTI_THREAD_TEST_F( | 7016 SINGLE_AND_MULTI_THREAD_TEST_F( |
6993 LayerTreeTestReflectionMaskLayerForSurfaceWithUnclippedChild); | 7017 LayerTreeTestReflectionMaskLayerForSurfaceWithUnclippedChild); |
6994 | 7018 |
6995 } // namespace cc | 7019 } // namespace cc |
OLD | NEW |