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

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

Issue 1463723003: Return VisualViewport coords in boundsInViewportSpace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years 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/WebElement.cpp ('k') | third_party/WebKit/Source/web/tests/WebFrameTest.cpp » ('j') | 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 3e54d0fa694925fbc891fc0633a986c0d2fd1979..f8b1a928b035d41066201e816f15ea5a775baaac 100644
--- a/third_party/WebKit/Source/web/tests/VisualViewportTest.cpp
+++ b/third_party/WebKit/Source/web/tests/VisualViewportTest.cpp
@@ -1398,11 +1398,15 @@ TEST_P(ParameterizedVisualViewportTest, ElementBoundsInViewportSpaceAccountsForV
visualViewport.setScale(2);
visualViewport.setLocation(scrollDelta);
- IntRect boundsInViewport = inputElement->boundsInViewportSpace();
+ const IntRect boundsInViewport = inputElement->boundsInViewport();
+ IntRect expectedBounds = bounds;
+ expectedBounds.scale(2.f);
+ IntPoint expectedScrollDelta = scrollDelta;
+ expectedScrollDelta.scale(2.f, 2.f);
- EXPECT_POINT_EQ(IntPoint(bounds.location() - scrollDelta),
+ EXPECT_POINT_EQ(IntPoint(expectedBounds.location() - expectedScrollDelta),
boundsInViewport.location());
- EXPECT_SIZE_EQ(bounds.size(), boundsInViewport.size());
+ EXPECT_SIZE_EQ(expectedBounds.size(), boundsInViewport.size());
}
// Tests that when a new frame is created, it is created with the intended
« no previous file with comments | « third_party/WebKit/Source/web/WebElement.cpp ('k') | third_party/WebKit/Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698