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 "core/frame/VisualViewport.h" | 5 #include "core/frame/VisualViewport.h" |
6 | 6 |
7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
8 #include "core/frame/BrowserControls.h" | 8 #include "core/frame/BrowserControls.h" |
9 #include "core/frame/FrameHost.h" | 9 #include "core/frame/FrameHost.h" |
10 #include "core/frame/FrameView.h" | 10 #include "core/frame/FrameView.h" |
(...skipping 1634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1645 // Tests that the layout viewport's scroll layer bounds are updated in a | 1645 // Tests that the layout viewport's scroll layer bounds are updated in a |
1646 // compositing change update. crbug.com/423188. | 1646 // compositing change update. crbug.com/423188. |
1647 TEST_P(VisualViewportTest, TestChangingContentSizeAffectsScrollBounds) { | 1647 TEST_P(VisualViewportTest, TestChangingContentSizeAffectsScrollBounds) { |
1648 initializeWithAndroidSettings(); | 1648 initializeWithAndroidSettings(); |
1649 webViewImpl()->resize(IntSize(100, 150)); | 1649 webViewImpl()->resize(IntSize(100, 150)); |
1650 | 1650 |
1651 registerMockedHttpURLLoad("content-width-1000.html"); | 1651 registerMockedHttpURLLoad("content-width-1000.html"); |
1652 navigateTo(m_baseURL + "content-width-1000.html"); | 1652 navigateTo(m_baseURL + "content-width-1000.html"); |
1653 | 1653 |
1654 FrameView& frameView = *webViewImpl()->mainFrameImpl()->frameView(); | 1654 FrameView& frameView = *webViewImpl()->mainFrameImpl()->frameView(); |
1655 WebLayer* scrollLayer = frameView.layerForScrolling()->platformLayer(); | |
1656 | 1655 |
1657 webViewImpl()->mainFrame()->executeScript( | 1656 webViewImpl()->mainFrame()->executeScript( |
1658 WebScriptSource("var content = document.getElementById(\"content\");" | 1657 WebScriptSource("var content = document.getElementById(\"content\");" |
1659 "content.style.width = \"1500px\";" | 1658 "content.style.width = \"1500px\";" |
1660 "content.style.height = \"2400px\";")); | 1659 "content.style.height = \"2400px\";")); |
1661 frameView.updateAllLifecyclePhases(); | 1660 frameView.updateAllLifecyclePhases(); |
| 1661 WebLayer* scrollLayer = frameView.layoutViewportScrollableArea() |
| 1662 ->layerForScrolling() |
| 1663 ->platformLayer(); |
1662 | 1664 |
1663 EXPECT_SIZE_EQ(IntSize(1500, 2400), IntSize(scrollLayer->bounds())); | 1665 EXPECT_SIZE_EQ(IntSize(1500, 2400), IntSize(scrollLayer->bounds())); |
1664 } | 1666 } |
1665 | 1667 |
1666 // Tests that resizing the visual viepwort keeps its bounds within the outer | 1668 // Tests that resizing the visual viepwort keeps its bounds within the outer |
1667 // viewport. | 1669 // viewport. |
1668 TEST_P(VisualViewportTest, ResizeVisualViewportStaysWithinOuterViewport) { | 1670 TEST_P(VisualViewportTest, ResizeVisualViewportStaysWithinOuterViewport) { |
1669 initializeWithDesktopSettings(); | 1671 initializeWithDesktopSettings(); |
1670 webViewImpl()->resize(IntSize(100, 200)); | 1672 webViewImpl()->resize(IntSize(100, 200)); |
1671 | 1673 |
(...skipping 799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2471 " body {" | 2473 " body {" |
2472 " margin: 0px;" | 2474 " margin: 0px;" |
2473 " }" | 2475 " }" |
2474 " div { height:110vh; width: 110vw; }" | 2476 " div { height:110vh; width: 110vw; }" |
2475 "</style>" | 2477 "</style>" |
2476 "<div></div>", | 2478 "<div></div>", |
2477 baseURL); | 2479 baseURL); |
2478 } | 2480 } |
2479 | 2481 |
2480 } // namespace | 2482 } // namespace |
OLD | NEW |