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

Side by Side Diff: Source/core/rendering/style/RenderStyleTest.cpp

Issue 669093002: RenderStyle operator== incorrect for shape-outside and clip-path. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 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 | « Source/core/rendering/style/RenderStyle.cpp ('k') | Source/core/rendering/style/ShapeValue.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "config.h"
6 #include "core/rendering/style/RenderStyle.h"
7
8 #include "core/rendering/ClipPathOperation.h"
9 #include "core/rendering/style/ShapeValue.h"
10
11 #include <gtest/gtest.h>
12
13 using namespace blink;
14
15 namespace {
16
17 TEST(RenderStyleTest, ShapeOutsideBoxEqual)
18 {
19 RefPtr<ShapeValue> shape1 = ShapeValue::createBoxShapeValue(ContentBox);
20 RefPtr<ShapeValue> shape2 = ShapeValue::createBoxShapeValue(ContentBox);
21 RefPtr<RenderStyle> style1 = RenderStyle::create();
22 RefPtr<RenderStyle> style2 = RenderStyle::create();
23 style1->setShapeOutside(shape1);
24 style2->setShapeOutside(shape2);
25 ASSERT_EQ(*style1, *style2);
26 }
27
28 TEST(RenderStyleTest, ShapeOutsideCircleEqual)
29 {
30 RefPtr<BasicShapeCircle> circle1 = BasicShapeCircle::create();
31 RefPtr<BasicShapeCircle> circle2 = BasicShapeCircle::create();
32 RefPtr<ShapeValue> shape1 = ShapeValue::createShapeValue(circle1, ContentBox );
33 RefPtr<ShapeValue> shape2 = ShapeValue::createShapeValue(circle2, ContentBox );
34 RefPtr<RenderStyle> style1 = RenderStyle::create();
35 RefPtr<RenderStyle> style2 = RenderStyle::create();
36 style1->setShapeOutside(shape1);
37 style2->setShapeOutside(shape2);
38 ASSERT_EQ(*style1, *style2);
39 }
40
41 TEST(RenderStyleTest, ClipPathEqual)
42 {
43 RefPtr<BasicShapeCircle> shape = BasicShapeCircle::create();
44 RefPtr<ShapeClipPathOperation> path1 = ShapeClipPathOperation::create(shape) ;
45 RefPtr<ShapeClipPathOperation> path2 = ShapeClipPathOperation::create(shape) ;
46 RefPtr<RenderStyle> style1 = RenderStyle::create();
47 RefPtr<RenderStyle> style2 = RenderStyle::create();
48 style1->setClipPath(path1);
49 style2->setClipPath(path2);
50 ASSERT_EQ(*style1, *style2);
51 }
52
53 }
OLDNEW
« no previous file with comments | « Source/core/rendering/style/RenderStyle.cpp ('k') | Source/core/rendering/style/ShapeValue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698