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

Unified Diff: third_party/WebKit/Source/web/tests/ScrollingCoordinatorTest.cpp

Issue 2638013002: Record box shadow as main thread scrolling reasons (Closed)
Patch Set: Add flag related test && bug fix Created 3 years, 11 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/web/tests/ScrollingCoordinatorTest.cpp
diff --git a/third_party/WebKit/Source/web/tests/ScrollingCoordinatorTest.cpp b/third_party/WebKit/Source/web/tests/ScrollingCoordinatorTest.cpp
index b63f40506c09166436649eeee8c49008228350e3..9c3eca1630e4214be0710e08057f77355d844074 100644
--- a/third_party/WebKit/Source/web/tests/ScrollingCoordinatorTest.cpp
+++ b/third_party/WebKit/Source/web/tests/ScrollingCoordinatorTest.cpp
@@ -1037,7 +1037,11 @@ class StyleRelatedMainThreadScrollingReasonTest
static const uint32_t m_LCDTextRelatedReasons =
MainThreadScrollingReason::kHasOpacityAndLCDText |
MainThreadScrollingReason::kHasTransformAndLCDText |
- MainThreadScrollingReason::kBackgroundNotOpaqueInRectAndLCDText;
+ MainThreadScrollingReason::kBackgroundNotOpaqueInRectAndLCDText |
+ MainThreadScrollingReason::kHasBoxShadowAndLCDText |
+ MainThreadScrollingReason::kHasTranslucentBorderAndLCDText;
+ static const uint32_t m_OpaqueScrollersRelatedReasons =
+ MainThreadScrollingReason::kHasTranslucentBorderAndLCDText;
protected:
StyleRelatedMainThreadScrollingReasonTest() {
@@ -1089,6 +1093,12 @@ class StyleRelatedMainThreadScrollingReasonTest
forceFullCompositingUpdate();
ASSERT_FALSE(frameView->mainThreadScrollingReasons());
}
+ if ((reason & m_OpaqueScrollersRelatedReasons) &&
+ !(reason & ~m_OpaqueScrollersRelatedReasons)) {
+ RuntimeEnabledFeatures::setCompositeOpaqueScrollersEnabled(true);
+ forceFullCompositingUpdate();
+ ASSERT_FALSE(frameView->mainThreadScrollingReasons());
+ }
}
};
@@ -1154,4 +1164,20 @@ TEST_F(StyleRelatedMainThreadScrollingReasonTest, LCDTextEnabledTest) {
MainThreadScrollingReason::kHasBorderRadius);
}
+TEST_F(StyleRelatedMainThreadScrollingReasonTest, BoxShadowTest) {
+ testStyle("box-shadow", MainThreadScrollingReason::kHasBoxShadowAndLCDText);
+}
+
+TEST_F(StyleRelatedMainThreadScrollingReasonTest, TranslucentBorderTest) {
+ RuntimeEnabledFeatures::setCompositeOpaqueScrollersEnabled(false);
+ testStyle("translucent-border",
+ MainThreadScrollingReason::kHasTranslucentBorderAndLCDText);
+}
+
+TEST_F(StyleRelatedMainThreadScrollingReasonTest, OpaqueScrollersEnabledTest) {
+ testStyle("translucent-border border-radius",
+ MainThreadScrollingReason::kHasOpacityAndLCDText |
+ MainThreadScrollingReason::kHasBorderRadius);
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698