OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "config.h" | 5 #include "config.h" |
6 | 6 |
7 #include "core/frame/VisualViewport.h" | 7 #include "core/frame/VisualViewport.h" |
8 | 8 |
9 #include "core/dom/Document.h" | 9 #include "core/dom/Document.h" |
10 #include "core/frame/FrameHost.h" | 10 #include "core/frame/FrameHost.h" |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 | 50 | | 50 100| | 304 | 50 | | 50 100| |
305 o----- | o---- | | 305 o----- | o---- | |
306 | | | | | 25 | | 306 | | | | | 25 | |
307 | |100 | |-------------------| | 307 | |100 | |-------------------| |
308 | | | | | | 308 | | | | | |
309 | | | | | | 309 | | | | | |
310 -------------------- -------------------- | 310 -------------------- -------------------- |
311 | 311 |
312 */ | 312 */ |
313 | 313 |
314 // Disable the test on Mac OSX until futher investigation. | 314 // Disable the test on Mac OSX until further investigation. |
315 // Local build on Mac is OK but thes bot fails. | 315 // Local build on Mac is OK but thes bot fails. |
316 #if OS(MACOSX) | 316 #if OS(MACOSX) |
317 return; | 317 return; |
318 #endif | 318 #endif |
319 | 319 |
320 initializeWithAndroidSettings(); | 320 initializeWithAndroidSettings(); |
321 | 321 |
322 registerMockedHttpURLLoad("200-by-800-viewport.html"); | 322 registerMockedHttpURLLoad("200-by-800-viewport.html"); |
323 navigateTo(m_baseURL + "200-by-800-viewport.html"); | 323 navigateTo(m_baseURL + "200-by-800-viewport.html"); |
324 | 324 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 | | | | | 372 | | | | |
373 | | | | | 373 | | | | |
374 | | | | | 374 | | | | |
375 | | | | | 375 | | | | |
376 | | | | | 376 | | | | |
377 |-------------------| | | | 377 |-------------------| | | |
378 | | | | | 378 | | | | |
379 | 379 |
380 */ | 380 */ |
381 | 381 |
382 // Disable the test on Mac OSX until futher investigation. | 382 // Disable the test on Mac OSX until further investigation. |
383 // Local build on Mac is OK but thes bot fails. | 383 // Local build on Mac is OK but thes bot fails. |
384 #if OS(MACOSX) | 384 #if OS(MACOSX) |
385 return; | 385 return; |
386 #endif | 386 #endif |
387 | 387 |
388 initializeWithAndroidSettings(); | 388 initializeWithAndroidSettings(); |
389 | 389 |
390 registerMockedHttpURLLoad("200-by-800-viewport.html"); | 390 registerMockedHttpURLLoad("200-by-800-viewport.html"); |
391 navigateTo(m_baseURL + "200-by-800-viewport.html"); | 391 navigateTo(m_baseURL + "200-by-800-viewport.html"); |
392 | 392 |
(...skipping 836 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1229 // Test that the scroll bounds are adjusted appropriately. | 1229 // Test that the scroll bounds are adjusted appropriately. |
1230 visualViewport.move(FloatPoint(10000, 10000)); | 1230 visualViewport.move(FloatPoint(10000, 10000)); |
1231 EXPECT_POINT_EQ(FloatPoint(750, 860 - 215), visualViewport.location()); | 1231 EXPECT_POINT_EQ(FloatPoint(750, 860 - 215), visualViewport.location()); |
1232 | 1232 |
1233 // The outer viewport (FrameView) should be affected as well. | 1233 // The outer viewport (FrameView) should be affected as well. |
1234 frameView.scrollBy(IntSize(10000, 10000), UserScroll); | 1234 frameView.scrollBy(IntSize(10000, 10000), UserScroll); |
1235 IntPoint expected = expectedMaxFrameViewScrollOffset(visualViewport, frameVi
ew); | 1235 IntPoint expected = expectedMaxFrameViewScrollOffset(visualViewport, frameVi
ew); |
1236 EXPECT_POINT_EQ(expected, frameView.scrollPosition()); | 1236 EXPECT_POINT_EQ(expected, frameView.scrollPosition()); |
1237 | 1237 |
1238 // Scale back out, FrameView max scroll shouldn't have changed. Visual | 1238 // Scale back out, FrameView max scroll shouldn't have changed. Visual |
1239 // viewport should be moved up to accomodate larger view. | 1239 // viewport should be moved up to accommodate larger view. |
1240 webViewImpl()->applyViewportDeltas(WebFloatSize(), WebFloatSize(), WebFloatS
ize(), 0.5f, 0); | 1240 webViewImpl()->applyViewportDeltas(WebFloatSize(), WebFloatSize(), WebFloatS
ize(), 0.5f, 0); |
1241 EXPECT_EQ(1, visualViewport.scale()); | 1241 EXPECT_EQ(1, visualViewport.scale()); |
1242 EXPECT_POINT_EQ(expected, frameView.scrollPosition()); | 1242 EXPECT_POINT_EQ(expected, frameView.scrollPosition()); |
1243 frameView.scrollBy(IntSize(10000, 10000), UserScroll); | 1243 frameView.scrollBy(IntSize(10000, 10000), UserScroll); |
1244 EXPECT_POINT_EQ(expected, frameView.scrollPosition()); | 1244 EXPECT_POINT_EQ(expected, frameView.scrollPosition()); |
1245 | 1245 |
1246 EXPECT_POINT_EQ(FloatPoint(500, 860 - 430), visualViewport.location()); | 1246 EXPECT_POINT_EQ(FloatPoint(500, 860 - 430), visualViewport.location()); |
1247 visualViewport.move(FloatPoint(10000, 10000)); | 1247 visualViewport.move(FloatPoint(10000, 10000)); |
1248 EXPECT_POINT_EQ(FloatPoint(500, 860 - 430), visualViewport.location()); | 1248 EXPECT_POINT_EQ(FloatPoint(500, 860 - 430), visualViewport.location()); |
1249 | 1249 |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1608 webViewImpl()->handleInputEvent(pinchUpdate); | 1608 webViewImpl()->handleInputEvent(pinchUpdate); |
1609 | 1609 |
1610 VisualViewport& visualViewport = webViewImpl()->page()->frameHost().visualVi
ewport(); | 1610 VisualViewport& visualViewport = webViewImpl()->page()->frameHost().visualVi
ewport(); |
1611 FrameView& frameView = *webViewImpl()->mainFrameImpl()->frameView(); | 1611 FrameView& frameView = *webViewImpl()->mainFrameImpl()->frameView(); |
1612 | 1612 |
1613 EXPECT_FLOAT_POINT_EQ(FloatPoint(50, 50), visualViewport.location()); | 1613 EXPECT_FLOAT_POINT_EQ(FloatPoint(50, 50), visualViewport.location()); |
1614 EXPECT_FLOAT_POINT_EQ(FloatPoint(0, 0), frameView.scrollPositionDouble()); | 1614 EXPECT_FLOAT_POINT_EQ(FloatPoint(0, 0), frameView.scrollPositionDouble()); |
1615 } | 1615 } |
1616 | 1616 |
1617 } // namespace | 1617 } // namespace |
OLD | NEW |