| 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/PinchViewport.h" | 7 #include "core/frame/PinchViewport.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 1397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1408 registerMockedHttpURLLoad("content-width-1000.html"); | 1408 registerMockedHttpURLLoad("content-width-1000.html"); |
| 1409 navigateTo(m_baseURL + "content-width-1000.html"); | 1409 navigateTo(m_baseURL + "content-width-1000.html"); |
| 1410 | 1410 |
| 1411 FrameView& frameView = *webViewImpl()->mainFrameImpl()->frameView(); | 1411 FrameView& frameView = *webViewImpl()->mainFrameImpl()->frameView(); |
| 1412 WebLayer* scrollLayer = frameView.layerForScrolling()->platformLayer(); | 1412 WebLayer* scrollLayer = frameView.layerForScrolling()->platformLayer(); |
| 1413 | 1413 |
| 1414 webViewImpl()->mainFrame()->executeScript(WebScriptSource( | 1414 webViewImpl()->mainFrame()->executeScript(WebScriptSource( |
| 1415 "var content = document.getElementById(\"content\");" | 1415 "var content = document.getElementById(\"content\");" |
| 1416 "content.style.width = \"1500px\";" | 1416 "content.style.width = \"1500px\";" |
| 1417 "content.style.height = \"2400px\";")); | 1417 "content.style.height = \"2400px\";")); |
| 1418 frameView.updateAllLifecyclePhases(); | 1418 frameView.updateLayoutAndStyleForPainting(); |
| 1419 | 1419 |
| 1420 EXPECT_SIZE_EQ(IntSize(1500, 2400), IntSize(scrollLayer->bounds())); | 1420 EXPECT_SIZE_EQ(IntSize(1500, 2400), IntSize(scrollLayer->bounds())); |
| 1421 } | 1421 } |
| 1422 | 1422 |
| 1423 // Tests that resizing the pinch viepwort keeps its bounds within the outer | 1423 // Tests that resizing the pinch viepwort keeps its bounds within the outer |
| 1424 // viewport. | 1424 // viewport. |
| 1425 TEST_P(ParameterizedPinchViewportTest, ResizePinchViewportStaysWithinOuterViewpo
rt) | 1425 TEST_P(ParameterizedPinchViewportTest, ResizePinchViewportStaysWithinOuterViewpo
rt) |
| 1426 { | 1426 { |
| 1427 initializeWithDesktopSettings(); | 1427 initializeWithDesktopSettings(); |
| 1428 webViewImpl()->resize(IntSize(100, 200)); | 1428 webViewImpl()->resize(IntSize(100, 200)); |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1746 webViewImpl()->handleInputEvent(pinchUpdate); | 1746 webViewImpl()->handleInputEvent(pinchUpdate); |
| 1747 | 1747 |
| 1748 PinchViewport& pinchViewport = webViewImpl()->page()->frameHost().pinchViewp
ort(); | 1748 PinchViewport& pinchViewport = webViewImpl()->page()->frameHost().pinchViewp
ort(); |
| 1749 FrameView& frameView = *webViewImpl()->mainFrameImpl()->frameView(); | 1749 FrameView& frameView = *webViewImpl()->mainFrameImpl()->frameView(); |
| 1750 | 1750 |
| 1751 EXPECT_FLOAT_POINT_EQ(FloatPoint(50, 50), pinchViewport.location()); | 1751 EXPECT_FLOAT_POINT_EQ(FloatPoint(50, 50), pinchViewport.location()); |
| 1752 EXPECT_FLOAT_POINT_EQ(FloatPoint(0, 0), frameView.scrollPositionDouble()); | 1752 EXPECT_FLOAT_POINT_EQ(FloatPoint(0, 0), frameView.scrollPositionDouble()); |
| 1753 } | 1753 } |
| 1754 | 1754 |
| 1755 } // namespace | 1755 } // namespace |
| OLD | NEW |