| 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 782a82135e3d218bde407ea4743145d988ca67fa..418e6480cd5f46389c1a47420f68a29dbdcb0223 100644
|
| --- a/third_party/WebKit/Source/web/tests/VisualViewportTest.cpp
|
| +++ b/third_party/WebKit/Source/web/tests/VisualViewportTest.cpp
|
| @@ -108,9 +108,15 @@ namespace blink {
|
|
|
| namespace {
|
|
|
| -class VisualViewportTest : public testing::Test {
|
| +typedef bool TestParamRootLayerScrolling;
|
| +class VisualViewportTest
|
| + : public testing::Test,
|
| + public testing::WithParamInterface<TestParamRootLayerScrolling>,
|
| + private ScopedRootLayerScrollingForTest {
|
| public:
|
| - VisualViewportTest() : m_baseURL("http://www.test.com/") {}
|
| + VisualViewportTest()
|
| + : ScopedRootLayerScrollingForTest(GetParam()),
|
| + m_baseURL("http://www.test.com/") {}
|
|
|
| void initializeWithDesktopSettings(
|
| void (*overrideSettingsFunc)(WebSettings*) = 0) {
|
| @@ -185,23 +191,11 @@ class VisualViewportTest : public testing::Test {
|
| FrameTestHelpers::WebViewHelper m_helper;
|
| };
|
|
|
| -typedef bool TestParamRootLayerScrolling;
|
| -class ParameterizedVisualViewportTest
|
| - : public testing::WithParamInterface<TestParamRootLayerScrolling>,
|
| - private ScopedRootLayerScrollingForTest,
|
| - public VisualViewportTest {
|
| - public:
|
| - ParameterizedVisualViewportTest()
|
| - : ScopedRootLayerScrollingForTest(GetParam()) {}
|
| -};
|
| -
|
| -INSTANTIATE_TEST_CASE_P(All,
|
| - ParameterizedVisualViewportTest,
|
| - ::testing::Bool());
|
| +INSTANTIATE_TEST_CASE_P(All, VisualViewportTest, ::testing::Bool());
|
|
|
| // Test that resizing the VisualViewport works as expected and that resizing the
|
| // WebView resizes the VisualViewport.
|
| -TEST_P(ParameterizedVisualViewportTest, TestResize) {
|
| +TEST_P(VisualViewportTest, TestResize) {
|
| initializeWithDesktopSettings();
|
| webViewImpl()->resize(IntSize(320, 240));
|
|
|
| @@ -231,7 +225,7 @@ TEST_P(ParameterizedVisualViewportTest, TestResize) {
|
|
|
| // Make sure that the visibleContentRect method acurately reflects the scale and
|
| // scroll location of the viewport with and without scrollbars.
|
| -TEST_P(ParameterizedVisualViewportTest, TestVisibleContentRect) {
|
| +TEST_P(VisualViewportTest, TestVisibleContentRect) {
|
| RuntimeEnabledFeatures::setOverlayScrollbarsEnabled(false);
|
| initializeWithDesktopSettings();
|
|
|
| @@ -271,8 +265,7 @@ TEST_P(ParameterizedVisualViewportTest, TestVisibleContentRect) {
|
| // unchanged from the user's perspective (shrinking the FrameView will clamp
|
| // the VisualViewport so we need to counter scroll the FrameView to make it
|
| // appear to stay still). This caused bugs like crbug.com/453859.
|
| -TEST_P(ParameterizedVisualViewportTest,
|
| - TestResizeAtFullyScrolledPreservesViewportLocation) {
|
| +TEST_P(VisualViewportTest, TestResizeAtFullyScrolledPreservesViewportLocation) {
|
| initializeWithDesktopSettings();
|
| webViewImpl()->resize(IntSize(800, 600));
|
|
|
| @@ -314,45 +307,9 @@ TEST_P(ParameterizedVisualViewportTest,
|
| frameView.getScrollableArea()->visibleContentRect().location());
|
| }
|
|
|
| -// Test the main frame scrollbars take visual viewport into account.
|
| -TEST_F(VisualViewportTest, VerifyScrollbarBehavior) {
|
| - initializeWithDesktopSettings();
|
| -
|
| - registerMockedHttpURLLoad("200-by-800-viewport.html");
|
| - navigateTo(m_baseURL + "200-by-800-viewport.html");
|
| -
|
| - webViewImpl()->resize(IntSize(300, 200));
|
| -
|
| - ScrollableArea* scroller = frame()->view()->getScrollableArea();
|
| -
|
| - // Initially, there is no horizontal scrollbar since the content fits.
|
| - EXPECT_FALSE(scroller->horizontalScrollbar());
|
| - EXPECT_TRUE(scroller->verticalScrollbar());
|
| -
|
| - // Scroll layout viewport.
|
| - webViewImpl()->mainFrame()->setScrollOffset(WebSize(0, 200));
|
| - EXPECT_SIZE_EQ(ScrollOffset(0, 200), scroller->scrollOffset());
|
| -
|
| - webViewImpl()->setPageScaleFactor(2.0);
|
| -
|
| - // Pinch-zooming should add horizontal scrollbar.
|
| - EXPECT_TRUE(scroller->horizontalScrollbar());
|
| - EXPECT_TRUE(scroller->verticalScrollbar());
|
| -
|
| - // Scroll visual viewport.
|
| - VisualViewport& visualViewport =
|
| - frame()->page()->frameHost().visualViewport();
|
| - visualViewport.setLocation(FloatPoint(100, 100));
|
| - EXPECT_FLOAT_SIZE_EQ(FloatSize(100, 100), visualViewport.scrollOffset());
|
| -
|
| - // Scrollbar offset should take visual viewport into account.
|
| - EXPECT_FLOAT_EQ(100, scroller->horizontalScrollbar()->currentPos());
|
| - EXPECT_FLOAT_EQ(300, scroller->verticalScrollbar()->currentPos());
|
| -}
|
| -
|
| // Test that the VisualViewport works as expected in case of a scaled
|
| // and scrolled viewport - scroll down.
|
| -TEST_P(ParameterizedVisualViewportTest, TestResizeAfterVerticalScroll) {
|
| +TEST_P(VisualViewportTest, TestResizeAfterVerticalScroll) {
|
| /*
|
| 200 200
|
| | | | |
|
| @@ -422,7 +379,7 @@ TEST_P(ParameterizedVisualViewportTest, TestResizeAfterVerticalScroll) {
|
|
|
| // Test that the VisualViewport works as expected in case if a scaled
|
| // and scrolled viewport - scroll right.
|
| -TEST_P(ParameterizedVisualViewportTest, TestResizeAfterHorizontalScroll) {
|
| +TEST_P(VisualViewportTest, TestResizeAfterHorizontalScroll) {
|
| /*
|
| 200 200
|
| ---------------o----- ---------------o-----
|
| @@ -487,7 +444,7 @@ TEST_P(ParameterizedVisualViewportTest, TestResizeAfterHorizontalScroll) {
|
|
|
| // Test that the container layer gets sized properly if the WebView is resized
|
| // prior to the VisualViewport being attached to the layer tree.
|
| -TEST_P(ParameterizedVisualViewportTest, TestWebViewResizedBeforeAttachment) {
|
| +TEST_P(VisualViewportTest, TestWebViewResizedBeforeAttachment) {
|
| initializeWithDesktopSettings();
|
| FrameView& frameView = *webViewImpl()->mainFrameImpl()->frameView();
|
| GraphicsLayer* rootGraphicsLayer =
|
| @@ -512,7 +469,7 @@ TEST_P(ParameterizedVisualViewportTest, TestWebViewResizedBeforeAttachment) {
|
|
|
| // Make sure that the visibleRect method acurately reflects the scale and scroll
|
| // location of the viewport.
|
| -TEST_P(ParameterizedVisualViewportTest, TestVisibleRect) {
|
| +TEST_P(VisualViewportTest, TestVisibleRect) {
|
| initializeWithDesktopSettings();
|
| webViewImpl()->resize(IntSize(320, 240));
|
|
|
| @@ -563,7 +520,7 @@ TEST_P(ParameterizedVisualViewportTest, TestVisibleRect) {
|
|
|
| // Make sure that the visibleRectInDocument method acurately reflects the scale
|
| // and scroll location of the viewport relative to the document.
|
| -TEST_P(ParameterizedVisualViewportTest, TestVisibleRectInDocument) {
|
| +TEST_P(VisualViewportTest, TestVisibleRectInDocument) {
|
| initializeWithDesktopSettings();
|
| webViewImpl()->resize(IntSize(100, 400));
|
|
|
| @@ -588,8 +545,7 @@ TEST_P(ParameterizedVisualViewportTest, TestVisibleRectInDocument) {
|
| visualViewport.visibleRectInDocument());
|
| }
|
|
|
| -TEST_P(ParameterizedVisualViewportTest,
|
| - TestFractionalScrollOffsetIsNotOverwritten) {
|
| +TEST_P(VisualViewportTest, TestFractionalScrollOffsetIsNotOverwritten) {
|
| bool origFractionalOffsetsEnabled =
|
| RuntimeEnabledFeatures::fractionalScrollOffsetsEnabled();
|
| RuntimeEnabledFeatures::setFractionalScrollOffsetsEnabled(true);
|
| @@ -615,7 +571,7 @@ TEST_P(ParameterizedVisualViewportTest,
|
|
|
| // Test that the viewport's scroll offset is always appropriately bounded such
|
| // that the visual viewport always stays within the bounds of the main frame.
|
| -TEST_P(ParameterizedVisualViewportTest, TestOffsetClamping) {
|
| +TEST_P(VisualViewportTest, TestOffsetClamping) {
|
| initializeWithDesktopSettings();
|
| webViewImpl()->resize(IntSize(320, 240));
|
|
|
| @@ -671,7 +627,7 @@ TEST_P(ParameterizedVisualViewportTest, TestOffsetClamping) {
|
| // Test that the viewport can be scrolled around only within the main frame in
|
| // the presence of viewport resizes, as would be the case if the on screen
|
| // keyboard came up.
|
| -TEST_P(ParameterizedVisualViewportTest, TestOffsetClampingWithResize) {
|
| +TEST_P(VisualViewportTest, TestOffsetClampingWithResize) {
|
| initializeWithDesktopSettings();
|
| webViewImpl()->resize(IntSize(320, 240));
|
|
|
| @@ -740,7 +696,7 @@ TEST_P(ParameterizedVisualViewportTest, TestOffsetClampingWithResize) {
|
|
|
| // Test that the viewport is scrollable but bounded appropriately within the
|
| // main frame when we apply both scaling and resizes.
|
| -TEST_P(ParameterizedVisualViewportTest, TestOffsetClampingWithResizeAndScale) {
|
| +TEST_P(VisualViewportTest, TestOffsetClampingWithResizeAndScale) {
|
| initializeWithDesktopSettings();
|
| webViewImpl()->resize(IntSize(320, 240));
|
|
|
| @@ -795,7 +751,7 @@ TEST_P(ParameterizedVisualViewportTest, TestOffsetClampingWithResizeAndScale) {
|
| // viewport at minimum scale. If there's no explicit minimum scale set, the
|
| // FrameView should be set to the content width and height derived by the aspect
|
| // ratio.
|
| -TEST_P(ParameterizedVisualViewportTest, TestFrameViewSizedToContent) {
|
| +TEST_P(VisualViewportTest, TestFrameViewSizedToContent) {
|
| initializeWithAndroidSettings();
|
| webViewImpl()->resize(IntSize(320, 240));
|
|
|
| @@ -815,7 +771,7 @@ TEST_P(ParameterizedVisualViewportTest, TestFrameViewSizedToContent) {
|
| // The main FrameView's size should be set such that its the size of the visual
|
| // viewport at minimum scale. On Desktop, the minimum scale is set at 1 so make
|
| // sure the FrameView is sized to the viewport.
|
| -TEST_P(ParameterizedVisualViewportTest, TestFrameViewSizedToMinimumScale) {
|
| +TEST_P(VisualViewportTest, TestFrameViewSizedToMinimumScale) {
|
| initializeWithDesktopSettings();
|
| webViewImpl()->resize(IntSize(320, 240));
|
|
|
| @@ -832,8 +788,7 @@ TEST_P(ParameterizedVisualViewportTest, TestFrameViewSizedToMinimumScale) {
|
|
|
| // Test that attaching a new frame view resets the size of the inner viewport
|
| // scroll layer. crbug.com/423189.
|
| -TEST_P(ParameterizedVisualViewportTest,
|
| - TestAttachingNewFrameSetsInnerScrollLayerSize) {
|
| +TEST_P(VisualViewportTest, TestAttachingNewFrameSetsInnerScrollLayerSize) {
|
| initializeWithAndroidSettings();
|
| webViewImpl()->resize(IntSize(320, 240));
|
|
|
| @@ -870,8 +825,7 @@ TEST_P(ParameterizedVisualViewportTest,
|
| // The main FrameView's size should be set such that its the size of the visual
|
| // viewport at minimum scale. Test that the FrameView is appropriately sized in
|
| // the presence of a viewport <meta> tag.
|
| -TEST_P(ParameterizedVisualViewportTest,
|
| - TestFrameViewSizedToViewportMetaMinimumScale) {
|
| +TEST_P(VisualViewportTest, TestFrameViewSizedToViewportMetaMinimumScale) {
|
| initializeWithAndroidSettings();
|
| webViewImpl()->resize(IntSize(320, 240));
|
|
|
| @@ -887,8 +841,7 @@ TEST_P(ParameterizedVisualViewportTest,
|
| }
|
|
|
| // Test that the visual viewport still gets sized in AutoSize/AutoResize mode.
|
| -TEST_P(ParameterizedVisualViewportTest,
|
| - TestVisualViewportGetsSizeInAutoSizeMode) {
|
| +TEST_P(VisualViewportTest, TestVisualViewportGetsSizeInAutoSizeMode) {
|
| initializeWithDesktopSettings();
|
|
|
| EXPECT_SIZE_EQ(IntSize(0, 0), IntSize(webViewImpl()->size()));
|
| @@ -906,7 +859,7 @@ TEST_P(ParameterizedVisualViewportTest,
|
|
|
| // Test that the text selection handle's position accounts for the visual
|
| // viewport.
|
| -TEST_P(ParameterizedVisualViewportTest, TestTextSelectionHandles) {
|
| +TEST_P(VisualViewportTest, TestTextSelectionHandles) {
|
| initializeWithDesktopSettings();
|
| webViewImpl()->resize(IntSize(500, 800));
|
|
|
| @@ -941,7 +894,7 @@ TEST_P(ParameterizedVisualViewportTest, TestTextSelectionHandles) {
|
|
|
| // Test that the HistoryItem for the page stores the visual viewport's offset
|
| // and scale.
|
| -TEST_P(ParameterizedVisualViewportTest, TestSavedToHistoryItem) {
|
| +TEST_P(VisualViewportTest, TestSavedToHistoryItem) {
|
| initializeWithDesktopSettings();
|
| webViewImpl()->resize(IntSize(200, 300));
|
| webViewImpl()->updateAllLifecyclePhases();
|
| @@ -974,7 +927,7 @@ TEST_P(ParameterizedVisualViewportTest, TestSavedToHistoryItem) {
|
| }
|
|
|
| // Test restoring a HistoryItem properly restores the visual viewport's state.
|
| -TEST_P(ParameterizedVisualViewportTest, TestRestoredFromHistoryItem) {
|
| +TEST_P(VisualViewportTest, TestRestoredFromHistoryItem) {
|
| initializeWithDesktopSettings();
|
| webViewImpl()->resize(IntSize(200, 300));
|
|
|
| @@ -1002,7 +955,7 @@ TEST_P(ParameterizedVisualViewportTest, TestRestoredFromHistoryItem) {
|
| // Test restoring a HistoryItem without the visual viewport offset falls back to
|
| // distributing the scroll offset between the main frame and the visual
|
| // viewport.
|
| -TEST_P(ParameterizedVisualViewportTest, TestRestoredFromLegacyHistoryItem) {
|
| +TEST_P(VisualViewportTest, TestRestoredFromLegacyHistoryItem) {
|
| initializeWithDesktopSettings();
|
| webViewImpl()->resize(IntSize(100, 150));
|
|
|
| @@ -1035,7 +988,7 @@ TEST_P(ParameterizedVisualViewportTest, TestRestoredFromLegacyHistoryItem) {
|
|
|
| // Test that navigation to a new page with a different sized main frame doesn't
|
| // clobber the history item's main frame scroll offset. crbug.com/371867
|
| -TEST_P(ParameterizedVisualViewportTest,
|
| +TEST_P(VisualViewportTest,
|
| TestNavigateToSmallerFrameViewHistoryItemClobberBug) {
|
| initializeWithAndroidSettings();
|
| webViewImpl()->resize(IntSize(400, 400));
|
| @@ -1073,7 +1026,7 @@ TEST_P(ParameterizedVisualViewportTest,
|
|
|
| // Test that the coordinates sent into moveRangeSelection are offset by the
|
| // visual viewport's location.
|
| -TEST_P(ParameterizedVisualViewportTest,
|
| +TEST_P(VisualViewportTest,
|
| DISABLED_TestWebFrameRangeAccountsForVisualViewportScroll) {
|
| initializeWithDesktopSettings();
|
| webViewImpl()->settings()->setDefaultFontSize(12);
|
| @@ -1109,8 +1062,7 @@ TEST_P(ParameterizedVisualViewportTest,
|
|
|
| // Test that the scrollFocusedEditableElementIntoRect method works with the
|
| // visual viewport.
|
| -TEST_P(ParameterizedVisualViewportTest,
|
| - DISABLED_TestScrollFocusedEditableElementIntoRect) {
|
| +TEST_P(VisualViewportTest, DISABLED_TestScrollFocusedEditableElementIntoRect) {
|
| initializeWithDesktopSettings();
|
| webViewImpl()->resize(IntSize(500, 300));
|
|
|
| @@ -1163,8 +1115,7 @@ TEST_P(ParameterizedVisualViewportTest,
|
|
|
| // Test that resizing the WebView causes ViewportConstrained objects to
|
| // relayout.
|
| -TEST_P(ParameterizedVisualViewportTest,
|
| - TestWebViewResizeCausesViewportConstrainedLayout) {
|
| +TEST_P(VisualViewportTest, TestWebViewResizeCausesViewportConstrainedLayout) {
|
| initializeWithDesktopSettings();
|
| webViewImpl()->resize(IntSize(500, 300));
|
|
|
| @@ -1200,7 +1151,7 @@ MATCHER_P2(ContextMenuAtLocation,
|
|
|
| // Test that the context menu's location is correct in the presence of visual
|
| // viewport offset.
|
| -TEST_P(ParameterizedVisualViewportTest, TestContextMenuShownInCorrectLocation) {
|
| +TEST_P(VisualViewportTest, TestContextMenuShownInCorrectLocation) {
|
| initializeWithDesktopSettings();
|
| webViewImpl()->resize(IntSize(200, 300));
|
|
|
| @@ -1255,7 +1206,7 @@ TEST_P(ParameterizedVisualViewportTest, TestContextMenuShownInCorrectLocation) {
|
| }
|
|
|
| // Test that the client is notified if page scroll events.
|
| -TEST_P(ParameterizedVisualViewportTest, TestClientNotifiedOfScrollEvents) {
|
| +TEST_P(VisualViewportTest, TestClientNotifiedOfScrollEvents) {
|
| initializeWithAndroidSettings();
|
| webViewImpl()->resize(IntSize(200, 300));
|
|
|
| @@ -1289,7 +1240,7 @@ TEST_P(ParameterizedVisualViewportTest, TestClientNotifiedOfScrollEvents) {
|
|
|
| // 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) {
|
| +TEST_P(VisualViewportTest, ScrollIntoViewFractionalOffset) {
|
| initializeWithAndroidSettings();
|
|
|
| webViewImpl()->resize(IntSize(1000, 1000));
|
| @@ -1367,7 +1318,7 @@ static ScrollOffset expectedMaxFrameViewScrollOffset(
|
| frameView.contentsSize().height() - newHeight);
|
| }
|
|
|
| -TEST_P(ParameterizedVisualViewportTest, TestBrowserControlsAdjustment) {
|
| +TEST_P(VisualViewportTest, TestBrowserControlsAdjustment) {
|
| initializeWithAndroidSettings();
|
| webViewImpl()->resizeWithBrowserControls(IntSize(500, 450), 20, false);
|
|
|
| @@ -1418,8 +1369,7 @@ TEST_P(ParameterizedVisualViewportTest, TestBrowserControlsAdjustment) {
|
| frameView.layoutViewportScrollableArea()->scrollOffset());
|
| }
|
|
|
| -TEST_P(ParameterizedVisualViewportTest,
|
| - TestBrowserControlsAdjustmentWithScale) {
|
| +TEST_P(VisualViewportTest, TestBrowserControlsAdjustmentWithScale) {
|
| initializeWithAndroidSettings();
|
| webViewImpl()->resizeWithBrowserControls(IntSize(500, 450), 20, false);
|
|
|
| @@ -1493,8 +1443,7 @@ TEST_P(ParameterizedVisualViewportTest,
|
| // Tests that a scroll all the way to the bottom of the page, while hiding the
|
| // browser controls doesn't cause a clamp in the viewport scroll offset when the
|
| // top controls initiated resize occurs.
|
| -TEST_P(ParameterizedVisualViewportTest,
|
| - TestBrowserControlsAdjustmentAndResize) {
|
| +TEST_P(VisualViewportTest, TestBrowserControlsAdjustmentAndResize) {
|
| int browserControlsHeight = 20;
|
| int visualViewportHeight = 450;
|
| int layoutViewportHeight = 900;
|
| @@ -1565,8 +1514,7 @@ TEST_P(ParameterizedVisualViewportTest,
|
| // Tests that a scroll all the way to the bottom while showing the browser
|
| // controls doesn't cause a clamp to the viewport scroll offset when the browser
|
| // controls initiated resize occurs.
|
| -TEST_P(ParameterizedVisualViewportTest,
|
| - TestBrowserControlsShrinkAdjustmentAndResize) {
|
| +TEST_P(VisualViewportTest, TestBrowserControlsShrinkAdjustmentAndResize) {
|
| int browserControlsHeight = 20;
|
| int visualViewportHeight = 500;
|
| int layoutViewportHeight = 1000;
|
| @@ -1641,8 +1589,7 @@ TEST_P(ParameterizedVisualViewportTest,
|
|
|
| // Tests that a resize due to browser controls hiding doesn't incorrectly clamp
|
| // the main frame's scroll offset. crbug.com/428193.
|
| -TEST_P(ParameterizedVisualViewportTest,
|
| - TestTopControlHidingResizeDoesntClampMainFrame) {
|
| +TEST_P(VisualViewportTest, TestTopControlHidingResizeDoesntClampMainFrame) {
|
| initializeWithAndroidSettings();
|
| webViewImpl()->resizeWithBrowserControls(webViewImpl()->size(), 500, false);
|
| webViewImpl()->applyViewportDeltas(WebFloatSize(), WebFloatSize(),
|
| @@ -1676,7 +1623,7 @@ static void configureHiddenScrollbarsSettings(WebSettings* settings) {
|
|
|
| // Tests that scrollbar layers are not attached to the inner viewport container
|
| // layer when hideScrollbars WebSetting is true.
|
| -TEST_P(ParameterizedVisualViewportTest,
|
| +TEST_P(VisualViewportTest,
|
| TestScrollbarsNotAttachedWhenHideScrollbarsSettingIsTrue) {
|
| initializeWithAndroidSettings(configureHiddenScrollbarsSettings);
|
| webViewImpl()->resize(IntSize(100, 150));
|
| @@ -1690,7 +1637,7 @@ TEST_P(ParameterizedVisualViewportTest,
|
|
|
| // Tests that scrollbar layers are attached to the inner viewport container
|
| // layer when hideScrollbars WebSetting is false.
|
| -TEST_P(ParameterizedVisualViewportTest,
|
| +TEST_P(VisualViewportTest,
|
| TestScrollbarsAttachedWhenHideScrollbarsSettingIsFalse) {
|
| initializeWithAndroidSettings();
|
| webViewImpl()->resize(IntSize(100, 150));
|
| @@ -1704,8 +1651,7 @@ TEST_P(ParameterizedVisualViewportTest,
|
|
|
| // Tests that the layout viewport's scroll layer bounds are updated in a
|
| // compositing change update. crbug.com/423188.
|
| -TEST_P(ParameterizedVisualViewportTest,
|
| - TestChangingContentSizeAffectsScrollBounds) {
|
| +TEST_P(VisualViewportTest, TestChangingContentSizeAffectsScrollBounds) {
|
| initializeWithAndroidSettings();
|
| webViewImpl()->resize(IntSize(100, 150));
|
|
|
| @@ -1726,8 +1672,7 @@ TEST_P(ParameterizedVisualViewportTest,
|
|
|
| // Tests that resizing the visual viepwort keeps its bounds within the outer
|
| // viewport.
|
| -TEST_P(ParameterizedVisualViewportTest,
|
| - ResizeVisualViewportStaysWithinOuterViewport) {
|
| +TEST_P(VisualViewportTest, ResizeVisualViewportStaysWithinOuterViewport) {
|
| initializeWithDesktopSettings();
|
| webViewImpl()->resize(IntSize(100, 200));
|
|
|
| @@ -1747,8 +1692,7 @@ TEST_P(ParameterizedVisualViewportTest,
|
| EXPECT_EQ(0, visualViewport.scrollOffset().height());
|
| }
|
|
|
| -TEST_P(ParameterizedVisualViewportTest,
|
| - ElementBoundsInViewportSpaceAccountsForViewport) {
|
| +TEST_P(VisualViewportTest, ElementBoundsInViewportSpaceAccountsForViewport) {
|
| initializeWithAndroidSettings();
|
|
|
| webViewImpl()->resize(IntSize(500, 800));
|
| @@ -1778,7 +1722,7 @@ TEST_P(ParameterizedVisualViewportTest,
|
| EXPECT_SIZE_EQ(expectedBounds.size(), boundsInViewport.size());
|
| }
|
|
|
| -TEST_P(ParameterizedVisualViewportTest, ElementVisibleBoundsInVisualViewport) {
|
| +TEST_P(VisualViewportTest, ElementVisibleBoundsInVisualViewport) {
|
| initializeWithAndroidSettings();
|
| webViewImpl()->resize(IntSize(640, 1080));
|
| registerMockedHttpURLLoad("viewport-select.html");
|
| @@ -1795,8 +1739,7 @@ TEST_P(ParameterizedVisualViewportTest, ElementVisibleBoundsInVisualViewport) {
|
|
|
| // Test that the various window.scroll and document.body.scroll properties and
|
| // methods work unchanged from the pre-virtual viewport mode.
|
| -TEST_P(ParameterizedVisualViewportTest,
|
| - bodyAndWindowScrollPropertiesAccountForViewport) {
|
| +TEST_P(VisualViewportTest, bodyAndWindowScrollPropertiesAccountForViewport) {
|
| initializeWithAndroidSettings();
|
|
|
| webViewImpl()->resize(IntSize(200, 300));
|
| @@ -1875,7 +1818,7 @@ TEST_P(ParameterizedVisualViewportTest,
|
|
|
| // Tests that when a new frame is created, it is created with the intended size
|
| // (i.e. viewport at minimum scale, 100x200 / 0.5).
|
| -TEST_P(ParameterizedVisualViewportTest, TestMainFrameInitializationSizing) {
|
| +TEST_P(VisualViewportTest, TestMainFrameInitializationSizing) {
|
| initializeWithAndroidSettings();
|
|
|
| webViewImpl()->resize(IntSize(100, 200));
|
| @@ -1895,7 +1838,7 @@ TEST_P(ParameterizedVisualViewportTest, TestMainFrameInitializationSizing) {
|
| }
|
|
|
| // Tests that the maximum scroll offset of the viewport can be fractional.
|
| -TEST_P(ParameterizedVisualViewportTest, FractionalMaxScrollOffset) {
|
| +TEST_P(VisualViewportTest, FractionalMaxScrollOffset) {
|
| initializeWithDesktopSettings();
|
| webViewImpl()->resize(IntSize(101, 201));
|
| navigateTo("about:blank");
|
| @@ -1915,7 +1858,7 @@ TEST_P(ParameterizedVisualViewportTest, FractionalMaxScrollOffset) {
|
| // Tests that the slow scrolling after an impl scroll on the visual viewport is
|
| // continuous. crbug.com/453460 was caused by the impl-path not updating the
|
| // ScrollAnimatorBase class.
|
| -TEST_P(ParameterizedVisualViewportTest, SlowScrollAfterImplScroll) {
|
| +TEST_P(VisualViewportTest, SlowScrollAfterImplScroll) {
|
| initializeWithDesktopSettings();
|
| webViewImpl()->resize(IntSize(800, 600));
|
| navigateTo("about:blank");
|
| @@ -1949,7 +1892,7 @@ static void accessibilitySettings(WebSettings* settings) {
|
| settings->setAccessibilityEnabled(true);
|
| }
|
|
|
| -TEST_P(ParameterizedVisualViewportTest, AccessibilityHitTestWhileZoomedIn) {
|
| +TEST_P(VisualViewportTest, AccessibilityHitTestWhileZoomedIn) {
|
| initializeWithDesktopSettings(accessibilitySettings);
|
|
|
| registerMockedHttpURLLoad("hit-test.html");
|
| @@ -1979,7 +1922,7 @@ TEST_P(ParameterizedVisualViewportTest, AccessibilityHitTestWhileZoomedIn) {
|
| }
|
|
|
| // Tests that the maximum scroll offset of the viewport can be fractional.
|
| -TEST_P(ParameterizedVisualViewportTest, TestCoordinateTransforms) {
|
| +TEST_P(VisualViewportTest, TestCoordinateTransforms) {
|
| initializeWithAndroidSettings();
|
| webViewImpl()->resize(IntSize(800, 600));
|
| registerMockedHttpURLLoad("content-width-1000.html");
|
| @@ -2033,7 +1976,7 @@ TEST_P(ParameterizedVisualViewportTest, TestCoordinateTransforms) {
|
| // More specifically, it checks that the innerWidth and innerHeight window
|
| // properties will trigger a layout which will cause an update to viewport
|
| // constraints and a refreshed initial scale. crbug.com/466718
|
| -TEST_P(ParameterizedVisualViewportTest, WindowDimensionsOnLoad) {
|
| +TEST_P(VisualViewportTest, WindowDimensionsOnLoad) {
|
| initializeWithAndroidSettings();
|
| registerMockedHttpURLLoad("window_dimensions.html");
|
| webViewImpl()->resize(IntSize(800, 600));
|
| @@ -2049,7 +1992,7 @@ TEST_P(ParameterizedVisualViewportTest, WindowDimensionsOnLoad) {
|
| // width for a very wide page. That is, make that innerWidth/Height actually
|
| // trigger a layout of the content, and not just an update of the viepwort.
|
| // crbug.com/466718
|
| -TEST_P(ParameterizedVisualViewportTest, WindowDimensionsOnLoadWideContent) {
|
| +TEST_P(VisualViewportTest, WindowDimensionsOnLoadWideContent) {
|
| initializeWithAndroidSettings();
|
| registerMockedHttpURLLoad("window_dimensions_wide_div.html");
|
| webViewImpl()->resize(IntSize(800, 600));
|
| @@ -2061,8 +2004,7 @@ TEST_P(ParameterizedVisualViewportTest, WindowDimensionsOnLoadWideContent) {
|
| std::string(output->innerHTML().ascii().data()));
|
| }
|
|
|
| -TEST_P(ParameterizedVisualViewportTest,
|
| - PinchZoomGestureScrollsVisualViewportOnly) {
|
| +TEST_P(VisualViewportTest, PinchZoomGestureScrollsVisualViewportOnly) {
|
| initializeWithDesktopSettings();
|
| webViewImpl()->resize(IntSize(100, 100));
|
|
|
| @@ -2088,7 +2030,7 @@ TEST_P(ParameterizedVisualViewportTest,
|
| frameView.layoutViewportScrollableArea()->scrollOffset());
|
| }
|
|
|
| -TEST_P(ParameterizedVisualViewportTest, ResizeWithScrollAnchoring) {
|
| +TEST_P(VisualViewportTest, ResizeWithScrollAnchoring) {
|
| bool wasScrollAnchoringEnabled =
|
| RuntimeEnabledFeatures::scrollAnchoringEnabled();
|
| RuntimeEnabledFeatures::setScrollAnchoringEnabled(true);
|
| @@ -2113,7 +2055,7 @@ TEST_P(ParameterizedVisualViewportTest, ResizeWithScrollAnchoring) {
|
|
|
| // Ensure that resize anchoring as happens when browser controls hide/show
|
| // affects the scrollable area that's currently set as the root scroller.
|
| -TEST_P(ParameterizedVisualViewportTest, ResizeAnchoringWithRootScroller) {
|
| +TEST_P(VisualViewportTest, ResizeAnchoringWithRootScroller) {
|
| bool wasRootScrollerEnabled =
|
| RuntimeEnabledFeatures::setRootScrollerEnabled();
|
| RuntimeEnabledFeatures::setSetRootScrollerEnabled(true);
|
| @@ -2148,7 +2090,7 @@ TEST_P(ParameterizedVisualViewportTest, ResizeAnchoringWithRootScroller) {
|
|
|
| // Ensure that resize anchoring as happens when the device is rotated affects
|
| // the scrollable area that's currently set as the root scroller.
|
| -TEST_P(ParameterizedVisualViewportTest, RotationAnchoringWithRootScroller) {
|
| +TEST_P(VisualViewportTest, RotationAnchoringWithRootScroller) {
|
| bool wasRootScrollerEnabled =
|
| RuntimeEnabledFeatures::setRootScrollerEnabled();
|
| RuntimeEnabledFeatures::setSetRootScrollerEnabled(true);
|
| @@ -2188,7 +2130,7 @@ static void configureAndroidCompositing(WebSettings* settings) {
|
|
|
| // Make sure a composited background-attachment:fixed background gets resized
|
| // when using inert (non-layout affecting) browser controls.
|
| -TEST_P(ParameterizedVisualViewportTest, ResizeCompositedAndFixedBackground) {
|
| +TEST_P(VisualViewportTest, ResizeCompositedAndFixedBackground) {
|
| bool originalInertTopControls =
|
| RuntimeEnabledFeatures::inertTopControlsEnabled();
|
| RuntimeEnabledFeatures::setInertTopControlsEnabled(true);
|
| @@ -2275,7 +2217,7 @@ static void configureAndroidNonCompositing(WebSettings* settings) {
|
|
|
| // Make sure a non-composited background-attachment:fixed background gets
|
| // resized when using inert (non-layout affecting) browser controls.
|
| -TEST_P(ParameterizedVisualViewportTest, ResizeNonCompositedAndFixedBackground) {
|
| +TEST_P(VisualViewportTest, ResizeNonCompositedAndFixedBackground) {
|
| bool originalInertTopControls =
|
| RuntimeEnabledFeatures::inertTopControlsEnabled();
|
| RuntimeEnabledFeatures::setInertTopControlsEnabled(true);
|
| @@ -2378,8 +2320,7 @@ TEST_P(ParameterizedVisualViewportTest, ResizeNonCompositedAndFixedBackground) {
|
|
|
| // Make sure a browser control resize with background-attachment:not-fixed
|
| // background doesn't cause invalidation or layout.
|
| -TEST_P(ParameterizedVisualViewportTest,
|
| - ResizeNonFixedBackgroundNoLayoutOrInvalidation) {
|
| +TEST_P(VisualViewportTest, ResizeNonFixedBackgroundNoLayoutOrInvalidation) {
|
| bool originalInertTopControls =
|
| RuntimeEnabledFeatures::inertTopControlsEnabled();
|
| RuntimeEnabledFeatures::setInertTopControlsEnabled(true);
|
|
|