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

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

Issue 1147283002: Add ScrollDirectionPhysical enum in Scroll types. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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
Index: Source/core/frame/RootFrameViewportTest.cpp
diff --git a/Source/core/frame/RootFrameViewportTest.cpp b/Source/core/frame/RootFrameViewportTest.cpp
index ac99d6c1e8aae7c1dc7edc33359f1e30db2b7557..f09bfbb636f856855df62555c36e8b9b07edc8b3 100644
--- a/Source/core/frame/RootFrameViewportTest.cpp
+++ b/Source/core/frame/RootFrameViewportTest.cpp
@@ -191,7 +191,7 @@ TEST_F(RootFrameViewportTest, UserInputScrollable)
// Layout viewport shouldn't scroll since it's not horizontally scrollable,
// but visual viewport should.
- rootFrameViewport->scroll(ScrollRight, ScrollByPixel, 300);
+ rootFrameViewport->scroll(ScrollPhysicalRight, ScrollByPixel, 300);
EXPECT_POINT_EQ(DoublePoint(0, 0), layoutViewport.scrollPositionDouble());
EXPECT_POINT_EQ(DoublePoint(50, 0), visualViewport.scrollPositionDouble());
EXPECT_POINT_EQ(DoublePoint(50, 0), rootFrameViewport->scrollPositionDouble());
@@ -202,7 +202,7 @@ TEST_F(RootFrameViewportTest, UserInputScrollable)
layoutViewport.setUserInputScrollable(true, true);
visualViewport.setUserInputScrollable(false, true);
- rootFrameViewport->scroll(ScrollRight, ScrollByPixel, 300);
+ rootFrameViewport->scroll(ScrollPhysicalRight, ScrollByPixel, 300);
EXPECT_POINT_EQ(DoublePoint(100, 0), layoutViewport.scrollPositionDouble());
EXPECT_POINT_EQ(DoublePoint(0, 0), visualViewport.scrollPositionDouble());
EXPECT_POINT_EQ(DoublePoint(100, 0), rootFrameViewport->scrollPositionDouble());
@@ -213,7 +213,7 @@ TEST_F(RootFrameViewportTest, UserInputScrollable)
layoutViewport.setUserInputScrollable(false, true);
visualViewport.setUserInputScrollable(false, true);
- rootFrameViewport->scroll(ScrollRight, ScrollByPixel, 300);
+ rootFrameViewport->scroll(ScrollPhysicalRight, ScrollByPixel, 300);
EXPECT_POINT_EQ(DoublePoint(0, 0), layoutViewport.scrollPositionDouble());
EXPECT_POINT_EQ(DoublePoint(0, 0), visualViewport.scrollPositionDouble());
EXPECT_POINT_EQ(DoublePoint(0, 0), rootFrameViewport->scrollPositionDouble());
@@ -222,7 +222,7 @@ TEST_F(RootFrameViewportTest, UserInputScrollable)
EXPECT_TRUE(rootFrameViewport->userInputScrollable(VerticalScrollbar));
// Vertical scrolling should be unaffected.
- rootFrameViewport->scroll(ScrollDown, ScrollByPixel, 300);
+ rootFrameViewport->scroll(ScrollPhysicalDown, ScrollByPixel, 300);
EXPECT_POINT_EQ(DoublePoint(0, 150), layoutViewport.scrollPositionDouble());
EXPECT_POINT_EQ(DoublePoint(0, 75), visualViewport.scrollPositionDouble());
EXPECT_POINT_EQ(DoublePoint(0, 225), rootFrameViewport->scrollPositionDouble());
@@ -242,7 +242,7 @@ TEST_F(RootFrameViewportTest, UserInputScrollable)
// Layout viewport shouldn't scroll since it's not vertically scrollable,
// but visual viewport should.
- rootFrameViewport->scroll(ScrollDown, ScrollByPixel, 300);
+ rootFrameViewport->scroll(ScrollPhysicalDown, ScrollByPixel, 300);
EXPECT_POINT_EQ(DoublePoint(0, 0), layoutViewport.scrollPositionDouble());
EXPECT_POINT_EQ(DoublePoint(0, 75), visualViewport.scrollPositionDouble());
EXPECT_POINT_EQ(DoublePoint(0, 75), rootFrameViewport->scrollPositionDouble());
@@ -253,7 +253,7 @@ TEST_F(RootFrameViewportTest, UserInputScrollable)
layoutViewport.setUserInputScrollable(true, true);
visualViewport.setUserInputScrollable(true, false);
- rootFrameViewport->scroll(ScrollDown, ScrollByPixel, 300);
+ rootFrameViewport->scroll(ScrollPhysicalDown, ScrollByPixel, 300);
EXPECT_POINT_EQ(DoublePoint(0, 150), layoutViewport.scrollPositionDouble());
EXPECT_POINT_EQ(DoublePoint(0, 0), visualViewport.scrollPositionDouble());
EXPECT_POINT_EQ(DoublePoint(0, 150), rootFrameViewport->scrollPositionDouble());
@@ -264,7 +264,7 @@ TEST_F(RootFrameViewportTest, UserInputScrollable)
layoutViewport.setUserInputScrollable(true, false);
visualViewport.setUserInputScrollable(true, false);
- rootFrameViewport->scroll(ScrollDown, ScrollByPixel, 300);
+ rootFrameViewport->scroll(ScrollPhysicalDown, ScrollByPixel, 300);
EXPECT_POINT_EQ(DoublePoint(0, 0), layoutViewport.scrollPositionDouble());
EXPECT_POINT_EQ(DoublePoint(0, 0), visualViewport.scrollPositionDouble());
EXPECT_POINT_EQ(DoublePoint(0, 0), rootFrameViewport->scrollPositionDouble());
@@ -273,7 +273,7 @@ TEST_F(RootFrameViewportTest, UserInputScrollable)
EXPECT_FALSE(rootFrameViewport->userInputScrollable(VerticalScrollbar));
// Horizontal scrolling should be unaffected.
- rootFrameViewport->scroll(ScrollRight, ScrollByPixel, 300);
+ rootFrameViewport->scroll(ScrollPhysicalRight, ScrollByPixel, 300);
EXPECT_POINT_EQ(DoublePoint(100, 0), layoutViewport.scrollPositionDouble());
EXPECT_POINT_EQ(DoublePoint(50, 0), visualViewport.scrollPositionDouble());
EXPECT_POINT_EQ(DoublePoint(150, 0), rootFrameViewport->scrollPositionDouble());
@@ -306,7 +306,7 @@ TEST_F(RootFrameViewportTest, TestScrollAnimatorUpdatedBeforeScroll)
visualViewport.setScrollPosition(DoublePoint(50, 75));
EXPECT_POINT_EQ(DoublePoint(50, 75), rootFrameViewport->scrollPositionDouble());
- rootFrameViewport->scroll(ScrollLeft, ScrollByPixel, 50);
+ rootFrameViewport->scroll(ScrollPhysicalLeft, ScrollByPixel, 50);
EXPECT_POINT_EQ(DoublePoint(0, 75), rootFrameViewport->scrollPositionDouble());
EXPECT_POINT_EQ(DoublePoint(0, 75), visualViewport.scrollPositionDouble());
@@ -328,7 +328,7 @@ TEST_F(RootFrameViewportTest, TestScrollAnimatorUpdatedBeforeScroll)
layoutViewport.setScrollPosition(DoublePoint(100, 150));
EXPECT_POINT_EQ(DoublePoint(100, 150), rootFrameViewport->scrollPositionDouble());
- rootFrameViewport->scroll(ScrollLeft, ScrollByPixel, 100);
+ rootFrameViewport->scroll(ScrollPhysicalLeft, ScrollByPixel, 100);
EXPECT_POINT_EQ(DoublePoint(0, 150), rootFrameViewport->scrollPositionDouble());
EXPECT_POINT_EQ(DoublePoint(0, 150), layoutViewport.scrollPositionDouble());
}

Powered by Google App Engine
This is Rietveld 408576698