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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 } | 112 } |
113 | 113 |
114 void overrideSettings(WebSettings *settings) override | 114 void overrideSettings(WebSettings *settings) override |
115 { | 115 { |
116 } | 116 } |
117 | 117 |
118 void initializeWithDesktopSettings(void (*overrideSettingsFunc)(WebSettings*
) = 0) | 118 void initializeWithDesktopSettings(void (*overrideSettingsFunc)(WebSettings*
) = 0) |
119 { | 119 { |
120 if (!overrideSettingsFunc) | 120 if (!overrideSettingsFunc) |
121 overrideSettingsFunc = &configureSettings; | 121 overrideSettingsFunc = &configureSettings; |
122 m_helper.initialize(true, 0, &m_mockWebViewClient, overrideSettingsFunc)
; | 122 m_helper.initialize(true, nullptr, &m_mockWebViewClient, nullptr, overri
deSettingsFunc); |
123 webViewImpl()->setDefaultPageScaleLimits(1, 4); | 123 webViewImpl()->setDefaultPageScaleLimits(1, 4); |
124 } | 124 } |
125 | 125 |
126 void initializeWithAndroidSettings(void (*overrideSettingsFunc)(WebSettings*
) = 0) | 126 void initializeWithAndroidSettings(void (*overrideSettingsFunc)(WebSettings*
) = 0) |
127 { | 127 { |
128 if (!overrideSettingsFunc) | 128 if (!overrideSettingsFunc) |
129 overrideSettingsFunc = &configureAndroidSettings; | 129 overrideSettingsFunc = &configureAndroidSettings; |
130 m_helper.initialize(true, 0, &m_mockWebViewClient, overrideSettingsFunc)
; | 130 m_helper.initialize(true, nullptr, &m_mockWebViewClient, nullptr, overri
deSettingsFunc); |
131 webViewImpl()->setDefaultPageScaleLimits(0.25f, 5); | 131 webViewImpl()->setDefaultPageScaleLimits(0.25f, 5); |
132 } | 132 } |
133 | 133 |
134 ~VisualViewportTest() override | 134 ~VisualViewportTest() override |
135 { | 135 { |
136 Platform::current()->getURLLoaderMockFactory()->unregisterAllURLs(); | 136 Platform::current()->getURLLoaderMockFactory()->unregisterAllURLs(); |
137 WebCache::clear(); | 137 WebCache::clear(); |
138 } | 138 } |
139 | 139 |
140 void navigateTo(const std::string& url) | 140 void navigateTo(const std::string& url) |
(...skipping 1715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1856 webViewImpl()->handleInputEvent(pinchUpdate); | 1856 webViewImpl()->handleInputEvent(pinchUpdate); |
1857 | 1857 |
1858 VisualViewport& visualViewport = webViewImpl()->page()->frameHost().visualVi
ewport(); | 1858 VisualViewport& visualViewport = webViewImpl()->page()->frameHost().visualVi
ewport(); |
1859 FrameView& frameView = *webViewImpl()->mainFrameImpl()->frameView(); | 1859 FrameView& frameView = *webViewImpl()->mainFrameImpl()->frameView(); |
1860 | 1860 |
1861 EXPECT_FLOAT_POINT_EQ(FloatPoint(50, 50), visualViewport.location()); | 1861 EXPECT_FLOAT_POINT_EQ(FloatPoint(50, 50), visualViewport.location()); |
1862 EXPECT_FLOAT_POINT_EQ(FloatPoint(0, 0), frameView.scrollPositionDouble()); | 1862 EXPECT_FLOAT_POINT_EQ(FloatPoint(0, 0), frameView.scrollPositionDouble()); |
1863 } | 1863 } |
1864 | 1864 |
1865 } // namespace | 1865 } // namespace |
OLD | NEW |