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

Side by Side Diff: cc/layers/picture_layer_unittest.cc

Issue 2829853009: cc : Add DCHECKs to ensure we have valid proprety tree indices at commit (Closed)
Patch Set: test failure and comments Created 3 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
« no previous file with comments | « cc/layers/picture_layer_impl_unittest.cc ('k') | cc/layers/scrollbar_layer_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/layers/picture_layer.h" 5 #include "cc/layers/picture_layer.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/threading/thread_task_runner_handle.h" 10 #include "base/threading/thread_task_runner_handle.h"
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 layer->SetIsDrawable(true); 179 layer->SetIsDrawable(true);
180 layer->SavePaintProperties(); 180 layer->SavePaintProperties();
181 layer->Update(); 181 layer->Update();
182 182
183 EXPECT_EQ(0, host->SourceFrameNumber()); 183 EXPECT_EQ(0, host->SourceFrameNumber());
184 host->CommitComplete(); 184 host->CommitComplete();
185 EXPECT_EQ(1, host->SourceFrameNumber()); 185 EXPECT_EQ(1, host->SourceFrameNumber());
186 186
187 layer->SavePaintProperties(); 187 layer->SavePaintProperties();
188 layer->Update(); 188 layer->Update();
189 host->BuildPropertyTreesForTesting();
189 190
190 FakeImplTaskRunnerProvider impl_task_runner_provider; 191 FakeImplTaskRunnerProvider impl_task_runner_provider;
191 192
192 std::unique_ptr<CompositorFrameSink> compositor_frame_sink( 193 std::unique_ptr<CompositorFrameSink> compositor_frame_sink(
193 FakeCompositorFrameSink::Create3d()); 194 FakeCompositorFrameSink::Create3d());
194 LayerTreeSettings layer_tree_settings = LayerTreeSettings(); 195 LayerTreeSettings layer_tree_settings = LayerTreeSettings();
195 layer_tree_settings.image_decode_tasks_enabled = true; 196 layer_tree_settings.image_decode_tasks_enabled = true;
196 FakeLayerTreeHostImpl host_impl( 197 FakeLayerTreeHostImpl host_impl(
197 layer_tree_settings, &impl_task_runner_provider, &task_graph_runner); 198 layer_tree_settings, &impl_task_runner_provider, &task_graph_runner);
198 host_impl.SetVisible(true); 199 host_impl.SetVisible(true);
199 EXPECT_TRUE(host_impl.InitializeRenderer(compositor_frame_sink.get())); 200 EXPECT_TRUE(host_impl.InitializeRenderer(compositor_frame_sink.get()));
200 201
201 host_impl.CreatePendingTree(); 202 host_impl.CreatePendingTree();
202 host_impl.pending_tree()->SetRootLayerForTesting( 203 host_impl.pending_tree()->SetRootLayerForTesting(
203 FakePictureLayerImpl::Create(host_impl.pending_tree(), 1)); 204 FakePictureLayerImpl::Create(host_impl.pending_tree(), 1));
204 host_impl.pending_tree()->BuildLayerListForTesting(); 205 host_impl.pending_tree()->BuildLayerListAndPropertyTreesForTesting();
205 206
206 FakePictureLayerImpl* layer_impl = static_cast<FakePictureLayerImpl*>( 207 FakePictureLayerImpl* layer_impl = static_cast<FakePictureLayerImpl*>(
207 host_impl.pending_tree()->root_layer_for_testing()); 208 host_impl.pending_tree()->root_layer_for_testing());
208 209
209 layer->PushPropertiesTo(layer_impl); 210 layer->PushPropertiesTo(layer_impl);
210 211
211 host->CommitComplete(); 212 host->CommitComplete();
212 EXPECT_EQ(2, host->SourceFrameNumber()); 213 EXPECT_EQ(2, host->SourceFrameNumber());
213 214
214 host_impl.ActivateSyncTree(); 215 host_impl.ActivateSyncTree();
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 host2->Composite(base::TimeTicks::Now()); 356 host2->Composite(base::TimeTicks::Now());
356 EXPECT_EQ(3, layer->update_count()); 357 EXPECT_EQ(3, layer->update_count());
357 EXPECT_EQ(1, host2->SourceFrameNumber()); 358 EXPECT_EQ(1, host2->SourceFrameNumber());
358 359
359 animation_host->SetMutatorHostClient(nullptr); 360 animation_host->SetMutatorHostClient(nullptr);
360 animation_host2->SetMutatorHostClient(nullptr); 361 animation_host2->SetMutatorHostClient(nullptr);
361 } 362 }
362 363
363 } // namespace 364 } // namespace
364 } // namespace cc 365 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/picture_layer_impl_unittest.cc ('k') | cc/layers/scrollbar_layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698