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

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

Issue 2460683002: Fix focus ring damage sometimes being 1 pixel off. (Closed)
Patch Set: fix linux component/debug link error Created 4 years, 1 month 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 90016dd2f4ee1d11d99d9f1cc61835f8f340cc07..76e7135702ed8990667fb2c5282132808e477b5c 100644
--- a/third_party/WebKit/Source/core/style/ComputedStyleTest.cpp
+++ b/third_party/WebKit/Source/core/style/ComputedStyleTest.cpp
@@ -43,4 +43,29 @@ TEST(ComputedStyleTest, ClipPathEqual) {
ASSERT_EQ(*style1, *style2);
}
+TEST(ComputedStyleTest, FocusRingWidth) {
+ RefPtr<ComputedStyle> style = ComputedStyle::create();
+ style->setEffectiveZoom(3.5);
+#if OS(MACOSX)
+ style->setOutlineStyle(BorderStyleSolid);
+ ASSERT_EQ(3, style->getOutlineStrokeWidthForFocusRing());
+#else
+ ASSERT_EQ(3.5, style->getOutlineStrokeWidthForFocusRing());
+ style->setEffectiveZoom(0.5);
+ ASSERT_EQ(1, style->getOutlineStrokeWidthForFocusRing());
+#endif
+}
+
+TEST(ComputedStyleTest, FocusRingOutset) {
+ RefPtr<ComputedStyle> style = ComputedStyle::create();
+ style->setOutlineStyle(BorderStyleSolid);
+ style->setOutlineStyleIsAuto(OutlineIsAutoOn);
+ style->setEffectiveZoom(4.75);
+#if OS(MACOSX)
+ ASSERT_EQ(4, style->outlineOutsetExtent());
+#else
+ ASSERT_EQ(3, style->outlineOutsetExtent());
+#endif
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/style/ComputedStyle.cpp ('k') | third_party/WebKit/Source/core/style/StyleBackgroundData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698