| 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());
|
| }
|
|
|
|
|