OLD | NEW |
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 <vector> | 5 #include <vector> |
6 #include "cc/layers/picture_image_layer.h" | 6 #include "cc/layers/picture_image_layer.h" |
7 #include "cc/test/fake_layer_tree_host.h" | 7 #include "cc/test/fake_layer_tree_host.h" |
8 #include "cc/test/geometry_test_utils.h" | 8 #include "cc/test/geometry_test_utils.h" |
9 #include "cc/trees/layer_tree_host_common.h" | 9 #include "cc/trees/layer_tree_host_common.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
11 #include "third_party/WebKit/public/platform/WebFloatPoint.h" | 11 #include "third_party/WebKit/public/platform/WebFloatPoint.h" |
12 #include "third_party/WebKit/public/platform/WebSize.h" | 12 #include "third_party/WebKit/public/platform/WebSize.h" |
13 #include "third_party/skia/include/utils/SkMatrix44.h" | 13 #include "third_party/skia/include/utils/SkMatrix44.h" |
14 #include "ui/gfx/point3_f.h" | 14 #include "ui/gfx/point3_f.h" |
15 #include "webkit/renderer/compositor_bindings/web_layer_impl_fixed_bounds.h" | 15 #include "webkit/renderer/compositor_bindings/web_layer_impl_fixed_bounds.h" |
16 | 16 |
17 using WebKit::WebFloatPoint; | 17 using blink::WebFloatPoint; |
18 using WebKit::WebSize; | 18 using blink::WebSize; |
19 | 19 |
20 namespace webkit { | 20 namespace webkit { |
21 namespace { | 21 namespace { |
22 | 22 |
23 TEST(WebLayerImplFixedBoundsTest, IdentityBounds) { | 23 TEST(WebLayerImplFixedBoundsTest, IdentityBounds) { |
24 scoped_ptr<WebLayerImplFixedBounds> layer(new WebLayerImplFixedBounds()); | 24 scoped_ptr<WebLayerImplFixedBounds> layer(new WebLayerImplFixedBounds()); |
25 layer->setAnchorPoint(WebFloatPoint(0, 0)); | 25 layer->setAnchorPoint(WebFloatPoint(0, 0)); |
26 layer->SetFixedBounds(gfx::Size(100, 100)); | 26 layer->SetFixedBounds(gfx::Size(100, 100)); |
27 layer->setBounds(WebSize(100, 100)); | 27 layer->setBounds(WebSize(100, 100)); |
28 EXPECT_EQ(WebSize(100, 100), layer->bounds()); | 28 EXPECT_EQ(WebSize(100, 100), layer->bounds()); |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 | 194 |
195 // With non-zero anchor point, WebLayerImplFixedBounds will fall back to | 195 // With non-zero anchor point, WebLayerImplFixedBounds will fall back to |
196 // WebLayerImpl. | 196 // WebLayerImpl. |
197 CompareFixedBoundsLayerAndNormalLayer(WebFloatPoint(0.4f, 0.6f), | 197 CompareFixedBoundsLayerAndNormalLayer(WebFloatPoint(0.4f, 0.6f), |
198 transform, | 198 transform, |
199 sublayer_transform); | 199 sublayer_transform); |
200 } | 200 } |
201 | 201 |
202 } // namespace | 202 } // namespace |
203 } // namespace webkit | 203 } // namespace webkit |
OLD | NEW |