| 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/FrameHost.h" | 8 #include "core/frame/FrameHost.h" |
| 9 #include "core/frame/FrameView.h" | 9 #include "core/frame/FrameView.h" |
| 10 #include "core/frame/LocalFrame.h" | 10 #include "core/frame/LocalFrame.h" |
| (...skipping 1625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1636 TEST_P(ParameterizedVisualViewportTest, TestMainFrameInitializationSizing) | 1636 TEST_P(ParameterizedVisualViewportTest, TestMainFrameInitializationSizing) |
| 1637 { | 1637 { |
| 1638 initializeWithAndroidSettings(); | 1638 initializeWithAndroidSettings(); |
| 1639 | 1639 |
| 1640 webViewImpl()->resize(IntSize(100, 200)); | 1640 webViewImpl()->resize(IntSize(100, 200)); |
| 1641 | 1641 |
| 1642 registerMockedHttpURLLoad("content-width-1000-min-scale.html"); | 1642 registerMockedHttpURLLoad("content-width-1000-min-scale.html"); |
| 1643 navigateTo(m_baseURL + "content-width-1000-min-scale.html"); | 1643 navigateTo(m_baseURL + "content-width-1000-min-scale.html"); |
| 1644 | 1644 |
| 1645 WebLocalFrameImpl* localFrame = webViewImpl()->mainFrameImpl(); | 1645 WebLocalFrameImpl* localFrame = webViewImpl()->mainFrameImpl(); |
| 1646 // The detachLayoutTree() and dispose() calls are a hack to prevent this tes
t | 1646 // The shutdown() calls are a hack to prevent this test |
| 1647 // from violating invariants about frame state during navigation/detach. | 1647 // from violating invariants about frame state during navigation/detach. |
| 1648 localFrame->frame()->document()->detachLayoutTree(); | 1648 localFrame->frame()->document()->shutdown(); |
| 1649 localFrame->createFrameView(); | 1649 localFrame->createFrameView(); |
| 1650 | 1650 |
| 1651 FrameView& frameView = *localFrame->frameView(); | 1651 FrameView& frameView = *localFrame->frameView(); |
| 1652 EXPECT_SIZE_EQ(IntSize(200, 400), frameView.frameRect().size()); | 1652 EXPECT_SIZE_EQ(IntSize(200, 400), frameView.frameRect().size()); |
| 1653 frameView.dispose(); | 1653 frameView.dispose(); |
| 1654 } | 1654 } |
| 1655 | 1655 |
| 1656 // Tests that the maximum scroll offset of the viewport can be fractional. | 1656 // Tests that the maximum scroll offset of the viewport can be fractional. |
| 1657 TEST_P(ParameterizedVisualViewportTest, FractionalMaxScrollOffset) | 1657 TEST_P(ParameterizedVisualViewportTest, FractionalMaxScrollOffset) |
| 1658 { | 1658 { |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1918 | 1918 |
| 1919 EXPECT_POINT_EQ( | 1919 EXPECT_POINT_EQ( |
| 1920 DoublePoint(), | 1920 DoublePoint(), |
| 1921 frameView.layoutViewportScrollableArea()->scrollPositionDouble()); | 1921 frameView.layoutViewportScrollableArea()->scrollPositionDouble()); |
| 1922 EXPECT_EQ(600, scroller->scrollTop()); | 1922 EXPECT_EQ(600, scroller->scrollTop()); |
| 1923 | 1923 |
| 1924 RuntimeEnabledFeatures::setSetRootScrollerEnabled(wasRootScrollerEnabled); | 1924 RuntimeEnabledFeatures::setSetRootScrollerEnabled(wasRootScrollerEnabled); |
| 1925 } | 1925 } |
| 1926 | 1926 |
| 1927 } // namespace | 1927 } // namespace |
| OLD | NEW |