Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(230)

Side by Side Diff: cc/trees/layer_tree_host_unittest_no_message_loop.cc

Issue 1101823002: CC Animations: Make LayerAnimationController creation optional (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Plumb LayerSettings parameter for cc::Layer construction. Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "base/thread_task_runner_handle.h" 5 #include "base/thread_task_runner_handle.h"
6 #include "base/threading/simple_thread.h" 6 #include "base/threading/simple_thread.h"
7 #include "cc/layers/delegated_frame_provider.h" 7 #include "cc/layers/delegated_frame_provider.h"
8 #include "cc/layers/delegated_frame_resource_collection.h" 8 #include "cc/layers/delegated_frame_resource_collection.h"
9 #include "cc/layers/delegated_renderer_layer.h" 9 #include "cc/layers/delegated_renderer_layer.h"
10 #include "cc/layers/layer.h" 10 #include "cc/layers/layer.h"
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 141
142 class LayerTreeHostNoMessageLoopSmokeTest 142 class LayerTreeHostNoMessageLoopSmokeTest
143 : public LayerTreeHostNoMessageLoopTest { 143 : public LayerTreeHostNoMessageLoopTest {
144 protected: 144 protected:
145 void RunTestWithoutMessageLoop() override { 145 void RunTestWithoutMessageLoop() override {
146 gfx::Size size(100, 100); 146 gfx::Size size(100, 100);
147 147
148 // Set up root layer. 148 // Set up root layer.
149 { 149 {
150 scoped_refptr<SolidColorLayer> solid_color_layer = 150 scoped_refptr<SolidColorLayer> solid_color_layer =
151 SolidColorLayer::Create(); 151 SolidColorLayer::Create(LayerSettings());
152 solid_color_layer->SetBackgroundColor(SK_ColorRED); 152 solid_color_layer->SetBackgroundColor(SK_ColorRED);
153 solid_color_layer->SetBounds(size_); 153 solid_color_layer->SetBounds(size_);
154 solid_color_layer->SetIsDrawable(true); 154 solid_color_layer->SetIsDrawable(true);
155 root_layer_ = solid_color_layer; 155 root_layer_ = solid_color_layer;
156 } 156 }
157 157
158 SetupLayerTreeHost(); 158 SetupLayerTreeHost();
159 Composite(); 159 Composite();
160 TearDownLayerTreeHost(); 160 TearDownLayerTreeHost();
161 } 161 }
162 }; 162 };
163 163
164 TEST_F(LayerTreeHostNoMessageLoopSmokeTest, SmokeTest) { 164 TEST_F(LayerTreeHostNoMessageLoopSmokeTest, SmokeTest) {
165 RunTest(); 165 RunTest();
166 } 166 }
167 167
168 class LayerTreeHostNoMessageLoopDelegatedLayer 168 class LayerTreeHostNoMessageLoopDelegatedLayer
169 : public LayerTreeHostNoMessageLoopTest, 169 : public LayerTreeHostNoMessageLoopTest,
170 public DelegatedFrameResourceCollectionClient { 170 public DelegatedFrameResourceCollectionClient {
171 protected: 171 protected:
172 void RunTestWithoutMessageLoop() override { 172 void RunTestWithoutMessageLoop() override {
173 resource_collection_ = new DelegatedFrameResourceCollection; 173 resource_collection_ = new DelegatedFrameResourceCollection;
174 frame_provider_ = new DelegatedFrameProvider( 174 frame_provider_ = new DelegatedFrameProvider(
175 resource_collection_.get(), CreateFrameDataWithResource(998)); 175 resource_collection_.get(), CreateFrameDataWithResource(998));
176 176
177 root_layer_ = Layer::Create(); 177 LayerSettings layer_settings;
178 delegated_layer_ = 178 root_layer_ = Layer::Create(layer_settings);
179 FakeDelegatedRendererLayer::Create(frame_provider_.get()); 179 delegated_layer_ = FakeDelegatedRendererLayer::Create(
180 layer_settings, frame_provider_.get());
180 delegated_layer_->SetBounds(size_); 181 delegated_layer_->SetBounds(size_);
181 delegated_layer_->SetIsDrawable(true); 182 delegated_layer_->SetIsDrawable(true);
182 root_layer_->AddChild(delegated_layer_); 183 root_layer_->AddChild(delegated_layer_);
183 184
184 SetupLayerTreeHost(); 185 SetupLayerTreeHost();
185 186
186 // Draw first frame. 187 // Draw first frame.
187 Composite(); 188 Composite();
188 189
189 // Prepare and draw second frame. 190 // Prepare and draw second frame.
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 scoped_refptr<DelegatedFrameProvider> frame_provider_; 237 scoped_refptr<DelegatedFrameProvider> frame_provider_;
237 scoped_refptr<DelegatedRendererLayer> delegated_layer_; 238 scoped_refptr<DelegatedRendererLayer> delegated_layer_;
238 }; 239 };
239 240
240 TEST_F(LayerTreeHostNoMessageLoopDelegatedLayer, SingleDelegatedLayer) { 241 TEST_F(LayerTreeHostNoMessageLoopDelegatedLayer, SingleDelegatedLayer) {
241 RunTest(); 242 RunTest();
242 } 243 }
243 244
244 } // namespace 245 } // namespace
245 } // namespace cc 246 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698