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

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

Issue 1028333002: Chromium -> Mojo roll. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 9 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/layer_perftest.cc ('k') | cc/layers/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/layer_position_constraint.h" 5 #include "cc/layers/layer_position_constraint.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "cc/layers/layer_impl.h" 9 #include "cc/layers/layer_impl.h"
10 #include "cc/test/fake_impl_proxy.h" 10 #include "cc/test/fake_impl_proxy.h"
11 #include "cc/test/fake_layer_tree_host_impl.h" 11 #include "cc/test/fake_layer_tree_host_impl.h"
12 #include "cc/test/geometry_test_utils.h" 12 #include "cc/test/geometry_test_utils.h"
13 #include "cc/test/test_shared_bitmap_manager.h" 13 #include "cc/test/test_shared_bitmap_manager.h"
14 #include "cc/test/test_task_graph_runner.h"
14 #include "cc/trees/layer_tree_host_common.h" 15 #include "cc/trees/layer_tree_host_common.h"
15 #include "testing/gtest/include/gtest/gtest.h" 16 #include "testing/gtest/include/gtest/gtest.h"
16 17
17 namespace cc { 18 namespace cc {
18 namespace { 19 namespace {
19 20
20 void SetLayerPropertiesForTesting(LayerImpl* layer, 21 void SetLayerPropertiesForTesting(LayerImpl* layer,
21 const gfx::Transform& transform, 22 const gfx::Transform& transform,
22 const gfx::Point3F& transform_origin, 23 const gfx::Point3F& transform_origin,
23 const gfx::PointF& position, 24 const gfx::PointF& position,
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 } 57 }
57 58
58 void ExecuteCalculateDrawProperties(LayerImpl* root_layer) { 59 void ExecuteCalculateDrawProperties(LayerImpl* root_layer) {
59 LayerImpl* page_scale_application_layer = nullptr; 60 LayerImpl* page_scale_application_layer = nullptr;
60 ExecuteCalculateDrawProperties( 61 ExecuteCalculateDrawProperties(
61 root_layer, 1.f, 1.f, page_scale_application_layer, false); 62 root_layer, 1.f, 1.f, page_scale_application_layer, false);
62 } 63 }
63 64
64 class LayerPositionConstraintTest : public testing::Test { 65 class LayerPositionConstraintTest : public testing::Test {
65 public: 66 public:
66 LayerPositionConstraintTest() : host_impl_(&proxy_, &shared_bitmap_manager_) { 67 LayerPositionConstraintTest()
68 : host_impl_(&proxy_, &shared_bitmap_manager_, &task_graph_runner_) {
67 root_ = CreateTreeForTest(); 69 root_ = CreateTreeForTest();
68 scroll_ = root_->children()[0]; 70 scroll_ = root_->children()[0];
69 fixed_to_top_left_.set_is_fixed_position(true); 71 fixed_to_top_left_.set_is_fixed_position(true);
70 fixed_to_bottom_right_.set_is_fixed_position(true); 72 fixed_to_bottom_right_.set_is_fixed_position(true);
71 fixed_to_bottom_right_.set_is_fixed_to_right_edge(true); 73 fixed_to_bottom_right_.set_is_fixed_to_right_edge(true);
72 fixed_to_bottom_right_.set_is_fixed_to_bottom_edge(true); 74 fixed_to_bottom_right_.set_is_fixed_to_bottom_edge(true);
73 } 75 }
74 76
75 scoped_ptr<LayerImpl> CreateTreeForTest() { 77 scoped_ptr<LayerImpl> CreateTreeForTest() {
76 scoped_ptr<LayerImpl> root = 78 scoped_ptr<LayerImpl> root =
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 child->AddChild(grand_child.Pass()); 122 child->AddChild(grand_child.Pass());
121 scroll_layer->AddChild(child.Pass()); 123 scroll_layer->AddChild(child.Pass());
122 root->AddChild(scroll_layer.Pass()); 124 root->AddChild(scroll_layer.Pass());
123 125
124 return root.Pass(); 126 return root.Pass();
125 } 127 }
126 128
127 protected: 129 protected:
128 FakeImplProxy proxy_; 130 FakeImplProxy proxy_;
129 TestSharedBitmapManager shared_bitmap_manager_; 131 TestSharedBitmapManager shared_bitmap_manager_;
132 TestTaskGraphRunner task_graph_runner_;
130 FakeLayerTreeHostImpl host_impl_; 133 FakeLayerTreeHostImpl host_impl_;
131 scoped_ptr<LayerImpl> root_; 134 scoped_ptr<LayerImpl> root_;
132 LayerImpl* scroll_; 135 LayerImpl* scroll_;
133 136
134 LayerPositionConstraint fixed_to_top_left_; 137 LayerPositionConstraint fixed_to_top_left_;
135 LayerPositionConstraint fixed_to_bottom_right_; 138 LayerPositionConstraint fixed_to_bottom_right_;
136 }; 139 };
137 140
138 namespace { 141 namespace {
139 142
(...skipping 1010 matching lines...) Expand 10 before | Expand all | Expand 10 after
1150 fixed_to_container1->draw_transform()); 1153 fixed_to_container1->draw_transform());
1151 1154
1152 EXPECT_TRANSFORMATION_MATRIX_EQ(expected_container2_transform, 1155 EXPECT_TRANSFORMATION_MATRIX_EQ(expected_container2_transform,
1153 container2->draw_transform()); 1156 container2->draw_transform());
1154 1157
1155 EXPECT_TRANSFORMATION_MATRIX_EQ(expected_fixed_to_container2_transform, 1158 EXPECT_TRANSFORMATION_MATRIX_EQ(expected_fixed_to_container2_transform,
1156 fixed_to_container2->draw_transform()); 1159 fixed_to_container2->draw_transform());
1157 } 1160 }
1158 } // namespace 1161 } // namespace
1159 } // namespace cc 1162 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/layer_perftest.cc ('k') | cc/layers/layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698