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

Unified Diff: third_party/WebKit/Source/core/frame/RootFrameViewportTest.cpp

Issue 1435233002: Remove invert viewport scroll order setting from Blink (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Build fix after rebase Created 4 years, 12 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/core/frame/RootFrameViewportTest.cpp
diff --git a/third_party/WebKit/Source/core/frame/RootFrameViewportTest.cpp b/third_party/WebKit/Source/core/frame/RootFrameViewportTest.cpp
index 909a5c6501a518851ba0136ef314124737791f07..d4784ce1fd3e369ed2c60f6aeb4818a6ddb94cc7 100644
--- a/third_party/WebKit/Source/core/frame/RootFrameViewportTest.cpp
+++ b/third_party/WebKit/Source/core/frame/RootFrameViewportTest.cpp
@@ -359,10 +359,10 @@ TEST_F(RootFrameViewportTest, ScrollIntoView)
LayoutRect(25, 75, 50, 50),
ScrollAlignment::alignToEdgeIfNeeded,
ScrollAlignment::alignToEdgeIfNeeded);
- EXPECT_POINT_EQ(DoublePoint(25, 25), layoutViewport->scrollPositionDouble());
- EXPECT_POINT_EQ(DoublePoint(0, 50), visualViewport->scrollPositionDouble());
+ EXPECT_POINT_EQ(DoublePoint(25, 75), layoutViewport->scrollPositionDouble());
+ EXPECT_POINT_EQ(DoublePoint(0, 0), visualViewport->scrollPositionDouble());
- // Reset the visual viewport's size, scale the page and repeat the test
+ // Reset the visual viewport's size, scale the page, and repeat the test
visualViewport->setViewportSize(IntSize(100, 150));
visualViewport->setScale(2);
rootFrameViewport->setScrollPosition(DoublePoint(), ProgrammaticScroll);
@@ -371,8 +371,8 @@ TEST_F(RootFrameViewportTest, ScrollIntoView)
LayoutRect(50, 75, 50, 75),
ScrollAlignment::alignToEdgeIfNeeded,
ScrollAlignment::alignToEdgeIfNeeded);
- EXPECT_POINT_EQ(DoublePoint(50, 75), layoutViewport->scrollPositionDouble());
- EXPECT_POINT_EQ(DoublePoint(0, 0), visualViewport->scrollPositionDouble());
+ EXPECT_POINT_EQ(DoublePoint(0, 0), layoutViewport->scrollPositionDouble());
+ EXPECT_POINT_EQ(DoublePoint(50, 75), visualViewport->scrollPositionDouble());
rootFrameViewport->scrollIntoView(
LayoutRect(190, 290, 10, 10),
@@ -421,18 +421,18 @@ TEST_F(RootFrameViewportTest, SetScrollPosition)
visualViewport->setScale(2);
- // Ensure that the layout viewport scrolls first.
+ // Ensure that the visual viewport scrolls first.
rootFrameViewport->setScrollPosition(DoublePoint(100, 100), ProgrammaticScroll);
- EXPECT_POINT_EQ(DoublePoint(0, 0), visualViewport->scrollPositionDouble());
- EXPECT_POINT_EQ(DoublePoint(100, 100), layoutViewport->scrollPositionDouble());
+ EXPECT_POINT_EQ(DoublePoint(100, 100), visualViewport->scrollPositionDouble());
+ EXPECT_POINT_EQ(DoublePoint(0, 0), layoutViewport->scrollPositionDouble());
- // Scroll to the layout viewport's extent, the visual viewport should scroll the
+ // Scroll to the visual viewport's extent, the layout viewport should scroll the
// remainder.
- rootFrameViewport->setScrollPosition(DoublePoint(700, 1700), ProgrammaticScroll);
- EXPECT_POINT_EQ(DoublePoint(200, 200), visualViewport->scrollPositionDouble());
- EXPECT_POINT_EQ(DoublePoint(500, 1500), layoutViewport->scrollPositionDouble());
+ rootFrameViewport->setScrollPosition(DoublePoint(300, 400), ProgrammaticScroll);
+ EXPECT_POINT_EQ(DoublePoint(250, 250), visualViewport->scrollPositionDouble());
+ EXPECT_POINT_EQ(DoublePoint(50, 150), layoutViewport->scrollPositionDouble());
- // Only the visual viewport should scroll further. Make sure it doesn't scroll
+ // Only the layout viewport should scroll further. Make sure it doesn't scroll
// out of bounds.
rootFrameViewport->setScrollPosition(DoublePoint(780, 1780), ProgrammaticScroll);
EXPECT_POINT_EQ(DoublePoint(250, 250), visualViewport->scrollPositionDouble());
@@ -469,17 +469,16 @@ TEST_F(RootFrameViewportTest, VisibleContentRect)
EXPECT_SIZE_EQ(DoubleSize(250, 200.5), rootFrameViewport->visibleContentRectDouble().size());
}
-// Tests that the invert scroll order experiment scrolls the visual viewport
-// before trying to scroll the layout viewport.
+// Tests that scrolls on the root frame scroll the visual viewport before
+// trying to scroll the layout viewport.
TEST_F(RootFrameViewportTest, ViewportScrollOrder)
{
IntSize viewportSize(100, 100);
OwnPtrWillBeRawPtr<RootFrameViewStub> layoutViewport = RootFrameViewStub::create(viewportSize, IntSize(200, 300));
OwnPtrWillBeRawPtr<VisualViewportStub> visualViewport = VisualViewportStub::create(viewportSize, viewportSize);
- bool invertScrollOrder = true;
OwnPtrWillBeRawPtr<ScrollableArea> rootFrameViewport =
- RootFrameViewport::create(*visualViewport.get(), *layoutViewport.get(), invertScrollOrder);
+ RootFrameViewport::create(*visualViewport.get(), *layoutViewport.get());
visualViewport->setScale(2);
« no previous file with comments | « third_party/WebKit/Source/core/frame/RootFrameViewport.cpp ('k') | third_party/WebKit/Source/core/frame/Settings.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698