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

Unified Diff: third_party/WebKit/Source/core/style/ComputedStyleTest.cpp

Issue 2753013004: Apply SVG styles paint-order, stroke-linejoin, and stroke-linecap on DOM text
Patch Set: Apply SVG styles paint-order, stroke-linejoin, and stroke-linecap on DOM text Created 3 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/style/ComputedStyleTest.cpp
diff --git a/third_party/WebKit/Source/core/style/ComputedStyleTest.cpp b/third_party/WebKit/Source/core/style/ComputedStyleTest.cpp
index 7c8f3c64a124c1d1e9c5d725abdbf2ef97d07eaa..351c75c0f834d852027dc48d035ea09bf6db089d 100644
--- a/third_party/WebKit/Source/core/style/ComputedStyleTest.cpp
+++ b/third_party/WebKit/Source/core/style/ComputedStyleTest.cpp
@@ -10,6 +10,18 @@
namespace blink {
+// This is not very useful for fields directly stored by values, because they
+// can only be compared by values. This macro mainly ensures that we update the
+// comparisons and tests when we change some field to RefPtr in the future.
+#define TEST_STYLE_VALUE_NO_DIFF(type, fieldName) \
+ { \
+ RefPtr<ComputedStyle> style1 = ComputedStyle::create(); \
+ RefPtr<ComputedStyle> style2 = ComputedStyle::create(); \
+ style1->set##fieldName(ComputedStyle::initial##fieldName()); \
+ style2->set##fieldName(ComputedStyle::initial##fieldName()); \
+ ASSERT_EQ(*style1, *style2); \
+ }
+
TEST(ComputedStyleTest, ShapeOutsideBoxEqual) {
ShapeValue* shape1 = ShapeValue::createBoxShapeValue(ContentBox);
ShapeValue* shape2 = ShapeValue::createBoxShapeValue(ContentBox);
@@ -92,4 +104,11 @@ TEST(ComputedStyleTest, LastPublicPseudoStyle) {
EXPECT_TRUE(style->hasAnyPublicPseudoStyles());
}
+TEST(ComputedStyleTest, MiscStyleShouldCompareValue) {
+ TEST_STYLE_VALUE_NO_DIFF(UnzoomedLength, StrokeWidth);
+ TEST_STYLE_VALUE_NO_DIFF(unsigned, PaintOrder);
+ TEST_STYLE_VALUE_NO_DIFF(unsigned, CapStyle);
+ TEST_STYLE_VALUE_NO_DIFF(unsigned, JoinStyle);
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/style/ComputedStyle.cpp ('k') | third_party/WebKit/Source/core/style/SVGComputedStyle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698