| 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 } | 111 } |
| 112 | 112 |
| 113 void overrideSettings(WebSettings *settings) override | 113 void overrideSettings(WebSettings *settings) override |
| 114 { | 114 { |
| 115 } | 115 } |
| 116 | 116 |
| 117 void initializeWithDesktopSettings(void (*overrideSettingsFunc)(WebSettings*
) = 0) | 117 void initializeWithDesktopSettings(void (*overrideSettingsFunc)(WebSettings*
) = 0) |
| 118 { | 118 { |
| 119 if (!overrideSettingsFunc) | 119 if (!overrideSettingsFunc) |
| 120 overrideSettingsFunc = &configureSettings; | 120 overrideSettingsFunc = &configureSettings; |
| 121 m_helper.initialize(true, 0, &m_mockWebViewClient, overrideSettingsFunc)
; | 121 m_helper.initialize(true, nullptr, &m_mockWebViewClient, m_mockWebViewCl
ient.widgetClientForTests(), overrideSettingsFunc); |
| 122 webViewImpl()->setDefaultPageScaleLimits(1, 4); | 122 webViewImpl()->setDefaultPageScaleLimits(1, 4); |
| 123 } | 123 } |
| 124 | 124 |
| 125 void initializeWithAndroidSettings(void (*overrideSettingsFunc)(WebSettings*
) = 0) | 125 void initializeWithAndroidSettings(void (*overrideSettingsFunc)(WebSettings*
) = 0) |
| 126 { | 126 { |
| 127 if (!overrideSettingsFunc) | 127 if (!overrideSettingsFunc) |
| 128 overrideSettingsFunc = &configureAndroidSettings; | 128 overrideSettingsFunc = &configureAndroidSettings; |
| 129 m_helper.initialize(true, 0, &m_mockWebViewClient, overrideSettingsFunc)
; | 129 m_helper.initialize(true, nullptr, &m_mockWebViewClient, m_mockWebViewCl
ient.widgetClientForTests(), overrideSettingsFunc); |
| 130 webViewImpl()->setDefaultPageScaleLimits(0.25f, 5); | 130 webViewImpl()->setDefaultPageScaleLimits(0.25f, 5); |
| 131 } | 131 } |
| 132 | 132 |
| 133 ~VisualViewportTest() override | 133 ~VisualViewportTest() override |
| 134 { | 134 { |
| 135 Platform::current()->getURLLoaderMockFactory()->unregisterAllURLs(); | 135 Platform::current()->getURLLoaderMockFactory()->unregisterAllURLs(); |
| 136 WebCache::clear(); | 136 WebCache::clear(); |
| 137 } | 137 } |
| 138 | 138 |
| 139 void navigateTo(const std::string& url) | 139 void navigateTo(const std::string& url) |
| (...skipping 1603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1743 webViewImpl()->handleInputEvent(pinchUpdate); | 1743 webViewImpl()->handleInputEvent(pinchUpdate); |
| 1744 | 1744 |
| 1745 VisualViewport& visualViewport = webViewImpl()->page()->frameHost().visualVi
ewport(); | 1745 VisualViewport& visualViewport = webViewImpl()->page()->frameHost().visualVi
ewport(); |
| 1746 FrameView& frameView = *webViewImpl()->mainFrameImpl()->frameView(); | 1746 FrameView& frameView = *webViewImpl()->mainFrameImpl()->frameView(); |
| 1747 | 1747 |
| 1748 EXPECT_FLOAT_POINT_EQ(FloatPoint(50, 50), visualViewport.location()); | 1748 EXPECT_FLOAT_POINT_EQ(FloatPoint(50, 50), visualViewport.location()); |
| 1749 EXPECT_FLOAT_POINT_EQ(FloatPoint(0, 0), frameView.scrollPositionDouble()); | 1749 EXPECT_FLOAT_POINT_EQ(FloatPoint(0, 0), frameView.scrollPositionDouble()); |
| 1750 } | 1750 } |
| 1751 | 1751 |
| 1752 } // namespace | 1752 } // namespace |
| OLD | NEW |