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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/CompositorMutableStateTest.cpp

Issue 2084233002: cc: Move LayerImpl::AddChild and RemoveChild to LayerImplTestProperties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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/trees/occlusion_tracker_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "platform/graphics/CompositorMutableState.h" 5 #include "platform/graphics/CompositorMutableState.h"
6 6
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "cc/test/fake_impl_task_runner_provider.h" 8 #include "cc/test/fake_impl_task_runner_provider.h"
9 #include "cc/test/fake_layer_tree_host_impl.h" 9 #include "cc/test/fake_layer_tree_host_impl.h"
10 #include "cc/test/fake_output_surface.h" 10 #include "cc/test/fake_output_surface.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 // In this test, there is a layer with an element id and mutable properties. 106 // In this test, there is a layer with an element id and mutable properties.
107 // In this case, we should get a valid mutable state for this element id tha t 107 // In this case, we should get a valid mutable state for this element id tha t
108 // has a real effect on the corresponding layer. 108 // has a real effect on the corresponding layer.
109 std::unique_ptr<LayerImpl> root = LayerImpl::Create(hostImpl().active_tree() , 42); 109 std::unique_ptr<LayerImpl> root = LayerImpl::Create(hostImpl().active_tree() , 42);
110 110
111 std::unique_ptr<LayerImpl> scopedLayer = 111 std::unique_ptr<LayerImpl> scopedLayer =
112 LayerImpl::Create(hostImpl().active_tree(), 11); 112 LayerImpl::Create(hostImpl().active_tree(), 11);
113 LayerImpl* layer = scopedLayer.get(); 113 LayerImpl* layer = scopedLayer.get();
114 layer->SetScrollClipLayer(root->id()); 114 layer->SetScrollClipLayer(root->id());
115 115
116 root->AddChild(std::move(scopedLayer)); 116 root->test_properties()->AddChild(std::move(scopedLayer));
117 117
118 SetLayerPropertiesForTesting(layer); 118 SetLayerPropertiesForTesting(layer);
119 layer->SetElementId(12); 119 layer->SetElementId(12);
120 root->SetElementId(layer->element_id()); 120 root->SetElementId(layer->element_id());
121 121
122 root->SetMutableProperties(CompositorMutableProperty::kOpacity | CompositorM utableProperty::kTransform); 122 root->SetMutableProperties(CompositorMutableProperty::kOpacity | CompositorM utableProperty::kTransform);
123 layer->SetMutableProperties(CompositorMutableProperty::kScrollLeft | Composi torMutableProperty::kScrollTop); 123 layer->SetMutableProperties(CompositorMutableProperty::kScrollLeft | Composi torMutableProperty::kScrollTop);
124 124
125 hostImpl().SetViewportSize(layer->bounds()); 125 hostImpl().SetViewportSize(layer->bounds());
126 hostImpl().active_tree()->SetRootLayer(std::move(root)); 126 hostImpl().active_tree()->SetRootLayer(std::move(root));
(...skipping 30 matching lines...) Expand all
157 EXPECT_TRUE(mutation.isScrollLeftMutated()); 157 EXPECT_TRUE(mutation.isScrollLeftMutated());
158 EXPECT_TRUE(mutation.isScrollTopMutated()); 158 EXPECT_TRUE(mutation.isScrollTopMutated());
159 159
160 EXPECT_EQ(0.5, mutation.opacity()); 160 EXPECT_EQ(0.5, mutation.opacity());
161 EXPECT_EQ(zero.ToString(), gfx::Transform(mutation.transform()).ToString()); 161 EXPECT_EQ(zero.ToString(), gfx::Transform(mutation.transform()).ToString());
162 EXPECT_EQ(1.0, mutation.scrollLeft()); 162 EXPECT_EQ(1.0, mutation.scrollLeft());
163 EXPECT_EQ(1.0, mutation.scrollTop()); 163 EXPECT_EQ(1.0, mutation.scrollTop());
164 } 164 }
165 165
166 } // namespace blink 166 } // namespace blink
OLDNEW
« no previous file with comments | « cc/trees/occlusion_tracker_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698