| OLD | NEW |
| 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 "config.h" | 5 #include "config.h" |
| 6 #include "core/layout/style/LayoutStyle.h" | 6 #include "core/layout/style/ComputedStyle.h" |
| 7 | 7 |
| 8 #include "core/layout/ClipPathOperation.h" | 8 #include "core/layout/ClipPathOperation.h" |
| 9 #include "core/layout/style/ShapeValue.h" | 9 #include "core/layout/style/ShapeValue.h" |
| 10 | 10 |
| 11 #include <gtest/gtest.h> | 11 #include <gtest/gtest.h> |
| 12 | 12 |
| 13 using namespace blink; | 13 using namespace blink; |
| 14 | 14 |
| 15 namespace { | 15 namespace { |
| 16 | 16 |
| 17 TEST(LayoutStyleTest, ShapeOutsideBoxEqual) | 17 TEST(ComputedStyleTest, ShapeOutsideBoxEqual) |
| 18 { | 18 { |
| 19 RefPtr<ShapeValue> shape1 = ShapeValue::createBoxShapeValue(ContentBox); | 19 RefPtr<ShapeValue> shape1 = ShapeValue::createBoxShapeValue(ContentBox); |
| 20 RefPtr<ShapeValue> shape2 = ShapeValue::createBoxShapeValue(ContentBox); | 20 RefPtr<ShapeValue> shape2 = ShapeValue::createBoxShapeValue(ContentBox); |
| 21 RefPtr<LayoutStyle> style1 = LayoutStyle::create(); | 21 RefPtr<ComputedStyle> style1 = ComputedStyle::create(); |
| 22 RefPtr<LayoutStyle> style2 = LayoutStyle::create(); | 22 RefPtr<ComputedStyle> style2 = ComputedStyle::create(); |
| 23 style1->setShapeOutside(shape1); | 23 style1->setShapeOutside(shape1); |
| 24 style2->setShapeOutside(shape2); | 24 style2->setShapeOutside(shape2); |
| 25 ASSERT_EQ(*style1, *style2); | 25 ASSERT_EQ(*style1, *style2); |
| 26 } | 26 } |
| 27 | 27 |
| 28 TEST(LayoutStyleTest, ShapeOutsideCircleEqual) | 28 TEST(ComputedStyleTest, ShapeOutsideCircleEqual) |
| 29 { | 29 { |
| 30 RefPtr<BasicShapeCircle> circle1 = BasicShapeCircle::create(); | 30 RefPtr<BasicShapeCircle> circle1 = BasicShapeCircle::create(); |
| 31 RefPtr<BasicShapeCircle> circle2 = BasicShapeCircle::create(); | 31 RefPtr<BasicShapeCircle> circle2 = BasicShapeCircle::create(); |
| 32 RefPtr<ShapeValue> shape1 = ShapeValue::createShapeValue(circle1, ContentBox
); | 32 RefPtr<ShapeValue> shape1 = ShapeValue::createShapeValue(circle1, ContentBox
); |
| 33 RefPtr<ShapeValue> shape2 = ShapeValue::createShapeValue(circle2, ContentBox
); | 33 RefPtr<ShapeValue> shape2 = ShapeValue::createShapeValue(circle2, ContentBox
); |
| 34 RefPtr<LayoutStyle> style1 = LayoutStyle::create(); | 34 RefPtr<ComputedStyle> style1 = ComputedStyle::create(); |
| 35 RefPtr<LayoutStyle> style2 = LayoutStyle::create(); | 35 RefPtr<ComputedStyle> style2 = ComputedStyle::create(); |
| 36 style1->setShapeOutside(shape1); | 36 style1->setShapeOutside(shape1); |
| 37 style2->setShapeOutside(shape2); | 37 style2->setShapeOutside(shape2); |
| 38 ASSERT_EQ(*style1, *style2); | 38 ASSERT_EQ(*style1, *style2); |
| 39 } | 39 } |
| 40 | 40 |
| 41 TEST(LayoutStyleTest, ClipPathEqual) | 41 TEST(ComputedStyleTest, ClipPathEqual) |
| 42 { | 42 { |
| 43 RefPtr<BasicShapeCircle> shape = BasicShapeCircle::create(); | 43 RefPtr<BasicShapeCircle> shape = BasicShapeCircle::create(); |
| 44 RefPtr<ShapeClipPathOperation> path1 = ShapeClipPathOperation::create(shape)
; | 44 RefPtr<ShapeClipPathOperation> path1 = ShapeClipPathOperation::create(shape)
; |
| 45 RefPtr<ShapeClipPathOperation> path2 = ShapeClipPathOperation::create(shape)
; | 45 RefPtr<ShapeClipPathOperation> path2 = ShapeClipPathOperation::create(shape)
; |
| 46 RefPtr<LayoutStyle> style1 = LayoutStyle::create(); | 46 RefPtr<ComputedStyle> style1 = ComputedStyle::create(); |
| 47 RefPtr<LayoutStyle> style2 = LayoutStyle::create(); | 47 RefPtr<ComputedStyle> style2 = ComputedStyle::create(); |
| 48 style1->setClipPath(path1); | 48 style1->setClipPath(path1); |
| 49 style2->setClipPath(path2); | 49 style2->setClipPath(path2); |
| 50 ASSERT_EQ(*style1, *style2); | 50 ASSERT_EQ(*style1, *style2); |
| 51 } | 51 } |
| 52 | 52 |
| 53 } | 53 } |
| OLD | NEW |