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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/style/RenderStyleTest.cpp
diff --git a/Source/core/rendering/style/RenderStyleTest.cpp b/Source/core/rendering/style/RenderStyleTest.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..5015f29855a35b7e0d0033d0d4b3f509abe915d4
--- /dev/null
+++ b/Source/core/rendering/style/RenderStyleTest.cpp
@@ -0,0 +1,53 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "config.h"
+#include "core/rendering/style/RenderStyle.h"
+
+#include "core/rendering/ClipPathOperation.h"
+#include "core/rendering/style/ShapeValue.h"
+
+#include <gtest/gtest.h>
+
+using namespace blink;
+
+namespace {
+
+TEST(RenderStyleTest, ShapeOutsideBoxEqual)
+{
+ RefPtr<ShapeValue> shape1 = ShapeValue::createBoxShapeValue(ContentBox);
+ RefPtr<ShapeValue> shape2 = ShapeValue::createBoxShapeValue(ContentBox);
+ RefPtr<RenderStyle> style1 = RenderStyle::create();
+ RefPtr<RenderStyle> style2 = RenderStyle::create();
+ style1->setShapeOutside(shape1);
+ style2->setShapeOutside(shape2);
+ ASSERT_EQ(*style1, *style2);
+}
+
+TEST(RenderStyleTest, ShapeOutsideCircleEqual)
+{
+ RefPtr<BasicShapeCircle> circle1 = BasicShapeCircle::create();
+ RefPtr<BasicShapeCircle> circle2 = BasicShapeCircle::create();
+ RefPtr<ShapeValue> shape1 = ShapeValue::createShapeValue(circle1, ContentBox);
+ RefPtr<ShapeValue> shape2 = ShapeValue::createShapeValue(circle2, ContentBox);
+ RefPtr<RenderStyle> style1 = RenderStyle::create();
+ RefPtr<RenderStyle> style2 = RenderStyle::create();
+ style1->setShapeOutside(shape1);
+ style2->setShapeOutside(shape2);
+ ASSERT_EQ(*style1, *style2);
+}
+
+TEST(RenderStyleTest, ClipPathEqual)
+{
+ RefPtr<BasicShapeCircle> shape = BasicShapeCircle::create();
+ RefPtr<ShapeClipPathOperation> path1 = ShapeClipPathOperation::create(shape);
+ RefPtr<ShapeClipPathOperation> path2 = ShapeClipPathOperation::create(shape);
+ RefPtr<RenderStyle> style1 = RenderStyle::create();
+ RefPtr<RenderStyle> style2 = RenderStyle::create();
+ style1->setClipPath(path1);
+ style2->setClipPath(path2);
+ ASSERT_EQ(*style1, *style2);
+}
+
+}
« 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