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

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

Issue 2005193005: Disable fractional scroll feature by default (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@layout-test-fix
Patch Set: Fix tests Created 4 years, 7 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 | « third_party/WebKit/Source/web/tests/ScrollingCoordinatorTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/tests/VisualViewportTest.cpp
diff --git a/third_party/WebKit/Source/web/tests/VisualViewportTest.cpp b/third_party/WebKit/Source/web/tests/VisualViewportTest.cpp
index 79d1249894dbc6bd7eeeec5a42665608d0e341f1..de41d3e91ce8ecd9b5bb46b2f2c9ee33fae80b21 100644
--- a/third_party/WebKit/Source/web/tests/VisualViewportTest.cpp
+++ b/third_party/WebKit/Source/web/tests/VisualViewportTest.cpp
@@ -512,6 +512,9 @@ TEST_P(ParameterizedVisualViewportTest, TestVisibleRectInDocument)
TEST_P(ParameterizedVisualViewportTest, TestFractionalScrollOffsetIsNotOverwritten)
{
+ bool origFractionalOffsetsEnabled = RuntimeEnabledFeatures::fractionalScrollOffsetsEnabled();
+ RuntimeEnabledFeatures::setFractionalScrollOffsetsEnabled(true);
+
initializeWithAndroidSettings();
webViewImpl()->resize(IntSize(200, 250));
@@ -523,6 +526,8 @@ TEST_P(ParameterizedVisualViewportTest, TestFractionalScrollOffsetIsNotOverwritt
webViewImpl()->applyViewportDeltas(WebFloatSize(), WebFloatSize(10, 20), WebFloatSize(), 1, 0);
EXPECT_EQ(30.5, frameView.layoutViewportScrollableArea()->scrollPositionDouble().y());
+
+ RuntimeEnabledFeatures::setFractionalScrollOffsetsEnabled(origFractionalOffsetsEnabled);
}
// Test that the viewport's scroll offset is always appropriately bounded such that the
@@ -1112,7 +1117,7 @@ TEST_P(ParameterizedVisualViewportTest, TestClientNotifiedOfScrollEvents)
webViewImpl()->mainFrameImpl()->setClient(oldClient);
}
-// Tests that calling scroll into view on a visible element doesn cause
+// Tests that calling scroll into view on a visible element doesn't cause
// a scroll due to a fractional offset. Bug crbug.com/463356.
TEST_P(ParameterizedVisualViewportTest, ScrollIntoViewFractionalOffset)
{
@@ -1136,14 +1141,14 @@ TEST_P(ParameterizedVisualViewportTest, ScrollIntoViewFractionalOffset)
layoutViewportScrollableArea->setScrollPosition(DoublePoint(0, 900.75), ProgrammaticScroll);
inputBox->scrollIntoViewIfNeeded(false);
- EXPECT_POINT_EQ(DoublePoint(0, 900.75), layoutViewportScrollableArea->scrollPositionDouble());
+ EXPECT_POINT_EQ(DoublePoint(0, 900), layoutViewportScrollableArea->scrollPositionDouble());
EXPECT_POINT_EQ(FloatPoint(250.25f, 100.25f), visualViewport.location());
// Change the fractional part of the frameview to one that would round down.
layoutViewportScrollableArea->setScrollPosition(DoublePoint(0, 900.125), ProgrammaticScroll);
inputBox->scrollIntoViewIfNeeded(false);
- EXPECT_POINT_EQ(DoublePoint(0, 900.125), layoutViewportScrollableArea->scrollPositionDouble());
+ EXPECT_POINT_EQ(DoublePoint(0, 900), layoutViewportScrollableArea->scrollPositionDouble());
EXPECT_POINT_EQ(FloatPoint(250.25f, 100.25f), visualViewport.location());
// Repeat both tests above with the visual viewport at a high fractional.
@@ -1151,14 +1156,14 @@ TEST_P(ParameterizedVisualViewportTest, ScrollIntoViewFractionalOffset)
layoutViewportScrollableArea->setScrollPosition(DoublePoint(0, 900.75), ProgrammaticScroll);
inputBox->scrollIntoViewIfNeeded(false);
- EXPECT_POINT_EQ(DoublePoint(0, 900.75), layoutViewportScrollableArea->scrollPositionDouble());
+ EXPECT_POINT_EQ(DoublePoint(0, 900), layoutViewportScrollableArea->scrollPositionDouble());
EXPECT_POINT_EQ(FloatPoint(250.875f, 100.875f), visualViewport.location());
// Change the fractional part of the frameview to one that would round down.
layoutViewportScrollableArea->setScrollPosition(DoublePoint(0, 900.125), ProgrammaticScroll);
inputBox->scrollIntoViewIfNeeded(false);
- EXPECT_POINT_EQ(DoublePoint(0, 900.125), layoutViewportScrollableArea->scrollPositionDouble());
+ EXPECT_POINT_EQ(DoublePoint(0, 900), layoutViewportScrollableArea->scrollPositionDouble());
EXPECT_POINT_EQ(FloatPoint(250.875f, 100.875f), visualViewport.location());
// Both viewports with a 0.5 fraction.
@@ -1166,7 +1171,7 @@ TEST_P(ParameterizedVisualViewportTest, ScrollIntoViewFractionalOffset)
layoutViewportScrollableArea->setScrollPosition(DoublePoint(0, 900.5), ProgrammaticScroll);
inputBox->scrollIntoViewIfNeeded(false);
- EXPECT_POINT_EQ(DoublePoint(0, 900.5), layoutViewportScrollableArea->scrollPositionDouble());
+ EXPECT_POINT_EQ(DoublePoint(0, 900), layoutViewportScrollableArea->scrollPositionDouble());
EXPECT_POINT_EQ(FloatPoint(250.5f, 100.5f), visualViewport.location());
}
« no previous file with comments | « third_party/WebKit/Source/web/tests/ScrollingCoordinatorTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698