OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 14 matching lines...) Expand all Loading... | |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #include "config.h" | 31 #include "config.h" |
32 | 32 |
33 #include "FrameTestHelpers.h" | 33 #include "FrameTestHelpers.h" |
34 #include "URLTestHelpers.h" | 34 #include "URLTestHelpers.h" |
35 #include "WebConsoleMessage.h" | |
36 #include "WebFrame.h" | |
37 #include "WebScriptSource.h" | |
35 #include "WebSettings.h" | 38 #include "WebSettings.h" |
39 #include "WebViewClient.h" | |
36 #include "core/dom/ViewportDescription.h" | 40 #include "core/dom/ViewportDescription.h" |
37 #include "core/frame/Frame.h" | 41 #include "core/frame/Frame.h" |
38 #include "core/frame/FrameView.h" | 42 #include "core/frame/FrameView.h" |
39 #include "core/page/Page.h" | 43 #include "core/page/Page.h" |
40 #include "core/page/PageScaleConstraints.h" | 44 #include "core/page/PageScaleConstraints.h" |
41 #include "core/page/Settings.h" | 45 #include "core/page/Settings.h" |
42 #include "core/platform/ScrollbarTheme.h" | 46 #include "core/platform/ScrollbarTheme.h" |
43 #include "platform/geometry/IntPoint.h" | 47 #include "platform/geometry/IntPoint.h" |
44 #include "platform/geometry/IntRect.h" | 48 #include "platform/geometry/IntRect.h" |
45 #include "platform/geometry/IntSize.h" | 49 #include "platform/geometry/IntSize.h" |
46 #include "public/platform/Platform.h" | 50 #include "public/platform/Platform.h" |
47 #include "public/platform/WebUnitTestSupport.h" | 51 #include "public/platform/WebUnitTestSupport.h" |
48 #include <gmock/gmock.h> | 52 #include <gmock/gmock.h> |
49 #include <gtest/gtest.h> | 53 #include <gtest/gtest.h> |
50 | 54 |
55 #include <vector> | |
56 | |
51 using namespace blink; | 57 using namespace blink; |
52 using WebCore::Frame; | 58 using WebCore::Frame; |
53 using WebCore::FrameView; | 59 using WebCore::FrameView; |
54 using WebCore::IntPoint; | 60 using WebCore::IntPoint; |
55 using WebCore::IntRect; | 61 using WebCore::IntRect; |
56 using WebCore::IntSize; | 62 using WebCore::IntSize; |
57 using WebCore::Page; | 63 using WebCore::Page; |
58 using WebCore::PageScaleConstraints; | 64 using WebCore::PageScaleConstraints; |
59 using WebCore::ViewportDescription; | 65 using WebCore::ViewportDescription; |
60 using blink::FrameTestHelpers::runPendingTasks; | 66 using blink::FrameTestHelpers::runPendingTasks; |
67 using blink::FrameTestHelpers::UseMockScrollbarSettings; | |
68 using blink::FrameTestHelpers::setViewportSettings; | |
61 | 69 |
62 namespace { | 70 namespace { |
63 | 71 |
64 class ViewportTest : public testing::Test { | 72 class LegacyViewportTest : public testing::Test { |
65 protected: | 73 protected: |
66 ViewportTest() | 74 LegacyViewportTest() |
67 : m_baseURL("http://www.test.com/") | 75 : m_baseURL("http://www.test.com/") |
68 , m_chromeURL("chrome://") | 76 , m_chromeURL("chrome://") |
69 { | 77 { |
70 } | 78 } |
71 | 79 |
72 virtual ~ViewportTest() | 80 virtual ~LegacyViewportTest() |
73 { | 81 { |
74 Platform::current()->unitTestSupport()->unregisterAllMockedURLs(); | 82 Platform::current()->unitTestSupport()->unregisterAllMockedURLs(); |
75 } | 83 } |
76 | 84 |
77 void registerMockedHttpURLLoad(const std::string& fileName) | 85 void registerMockedHttpURLLoad(const std::string& fileName) |
78 { | 86 { |
79 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseU RL.c_str()), WebString::fromUTF8(fileName.c_str())); | 87 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseU RL.c_str()), WebString::fromUTF8(fileName.c_str())); |
80 } | 88 } |
81 | 89 |
82 void registerMockedChromeURLLoad(const std::string& fileName) | 90 void registerMockedChromeURLLoad(const std::string& fileName) |
83 { | 91 { |
84 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_chrom eURL.c_str()), WebString::fromUTF8(fileName.c_str())); | 92 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_chrom eURL.c_str()), WebString::fromUTF8(fileName.c_str())); |
85 } | 93 } |
86 | 94 |
95 void executeScript(WebFrame* frame, const WebString& code) | |
96 { | |
97 frame->executeScript(WebScriptSource(code)); | |
98 runPendingTasks(); | |
99 } | |
100 | |
101 UseMockScrollbarSettings m_mockScrollbarSettings; | |
87 std::string m_baseURL; | 102 std::string m_baseURL; |
88 std::string m_chromeURL; | 103 std::string m_chromeURL; |
89 }; | 104 }; |
90 | 105 |
91 class UseMockScrollbarSettings { | 106 static PageScaleConstraints runTest(Page* page, int initialWidth, int initialHei ght) |
92 public: | |
93 UseMockScrollbarSettings() | |
94 { | |
95 WebCore::Settings::setMockScrollbarsEnabled(true); | |
96 WebCore::RuntimeEnabledFeatures::setOverlayScrollbarsEnabled(true); | |
97 EXPECT_TRUE(WebCore::ScrollbarTheme::theme()->usesOverlayScrollbars()); | |
98 } | |
99 | |
100 ~UseMockScrollbarSettings() | |
101 { | |
102 WebCore::Settings::setMockScrollbarsEnabled(false); | |
103 WebCore::RuntimeEnabledFeatures::setOverlayScrollbarsEnabled(false); | |
104 } | |
105 }; | |
106 | |
107 static void setViewportSettings(WebSettings* settings) | |
108 { | |
109 settings->setViewportEnabled(true); | |
110 } | |
111 | |
112 static PageScaleConstraints runViewportTest(Page* page, int initialWidth, int in itialHeight) | |
113 { | 107 { |
114 IntSize initialViewportSize(initialWidth, initialHeight); | 108 IntSize initialViewportSize(initialWidth, initialHeight); |
115 page->mainFrame()->view()->setFrameRect(IntRect(IntPoint::zero(), initialVie wportSize)); | 109 page->mainFrame()->view()->setFrameRect(IntRect(IntPoint::zero(), initialVie wportSize)); |
116 | 110 |
117 ViewportDescription description = page->viewportDescription(); | 111 ViewportDescription description = page->viewportDescription(); |
118 PageScaleConstraints constraints = description.resolve(initialViewportSize); | 112 PageScaleConstraints constraints = description.resolve(initialViewportSize); |
119 | 113 |
120 constraints.fitToContentsWidth(constraints.layoutSize.width(), initialWidth) ; | 114 constraints.fitToContentsWidth(constraints.layoutSize.width(), initialWidth) ; |
121 return constraints; | 115 return constraints; |
122 } | 116 } |
123 | 117 |
124 TEST_F(ViewportTest, viewport1) | 118 TEST_F(LegacyViewportTest, viewport1) |
125 { | 119 { |
126 UseMockScrollbarSettings mockScrollbarSettings; | |
127 registerMockedHttpURLLoad("viewport/viewport-1.html"); | 120 registerMockedHttpURLLoad("viewport/viewport-1.html"); |
128 | 121 |
129 FrameTestHelpers::WebViewHelper webViewHelper; | 122 FrameTestHelpers::WebViewHelper webViewHelper; |
130 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-1.html", true , 0, 0, setViewportSettings); | 123 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-1.html", true , 0, 0, setViewportSettings); |
131 | 124 |
132 Page* page = webViewHelper.webViewImpl()->page(); | 125 Page* page = webViewHelper.webViewImpl()->page(); |
133 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 126 PageScaleConstraints constraints = runTest(page, 320, 352); |
134 | 127 |
135 EXPECT_EQ(320, constraints.layoutSize.width()); | 128 EXPECT_EQ(320, constraints.layoutSize.width()); |
136 EXPECT_EQ(352, constraints.layoutSize.height()); | 129 EXPECT_EQ(352, constraints.layoutSize.height()); |
137 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); | 130 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); |
138 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); | 131 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); |
139 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 132 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
140 EXPECT_TRUE(page->viewportDescription().userZoom); | 133 EXPECT_TRUE(page->viewportDescription().userZoom); |
141 } | 134 } |
142 | 135 |
143 TEST_F(ViewportTest, viewport2) | 136 TEST_F(LegacyViewportTest, viewport2) |
144 { | 137 { |
145 UseMockScrollbarSettings mockScrollbarSettings; | |
146 registerMockedHttpURLLoad("viewport/viewport-2.html"); | 138 registerMockedHttpURLLoad("viewport/viewport-2.html"); |
147 | 139 |
148 FrameTestHelpers::WebViewHelper webViewHelper; | 140 FrameTestHelpers::WebViewHelper webViewHelper; |
149 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-2.html", true , 0, 0, setViewportSettings); | 141 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-2.html", true , 0, 0, setViewportSettings); |
150 | 142 |
151 Page* page = webViewHelper.webViewImpl()->page(); | 143 Page* page = webViewHelper.webViewImpl()->page(); |
152 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 144 PageScaleConstraints constraints = runTest(page, 320, 352); |
153 | 145 |
154 EXPECT_EQ(980, constraints.layoutSize.width()); | 146 EXPECT_EQ(980, constraints.layoutSize.width()); |
155 EXPECT_EQ(352, constraints.layoutSize.height()); | 147 EXPECT_EQ(352, constraints.layoutSize.height()); |
156 EXPECT_NEAR(0.32f, constraints.initialScale, 0.01f); | 148 EXPECT_NEAR(0.32f, constraints.initialScale, 0.01f); |
157 EXPECT_NEAR(0.32f, constraints.minimumScale, 0.01f); | 149 EXPECT_NEAR(0.32f, constraints.minimumScale, 0.01f); |
158 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 150 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
159 EXPECT_TRUE(page->viewportDescription().userZoom); | 151 EXPECT_TRUE(page->viewportDescription().userZoom); |
160 } | 152 } |
161 | 153 |
162 TEST_F(ViewportTest, viewport3) | 154 TEST_F(LegacyViewportTest, viewport3) |
163 { | 155 { |
164 UseMockScrollbarSettings mockScrollbarSettings; | |
165 registerMockedHttpURLLoad("viewport/viewport-3.html"); | 156 registerMockedHttpURLLoad("viewport/viewport-3.html"); |
166 | 157 |
167 FrameTestHelpers::WebViewHelper webViewHelper; | 158 FrameTestHelpers::WebViewHelper webViewHelper; |
168 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-3.html", true , 0, 0, setViewportSettings); | 159 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-3.html", true , 0, 0, setViewportSettings); |
169 | 160 |
170 Page* page = webViewHelper.webViewImpl()->page(); | 161 Page* page = webViewHelper.webViewImpl()->page(); |
171 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 162 PageScaleConstraints constraints = runTest(page, 320, 352); |
172 | 163 |
173 EXPECT_EQ(320, constraints.layoutSize.width()); | 164 EXPECT_EQ(320, constraints.layoutSize.width()); |
174 EXPECT_EQ(352, constraints.layoutSize.height()); | 165 EXPECT_EQ(352, constraints.layoutSize.height()); |
175 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); | 166 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); |
176 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); | 167 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); |
177 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 168 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
178 EXPECT_TRUE(page->viewportDescription().userZoom); | 169 EXPECT_TRUE(page->viewportDescription().userZoom); |
179 } | 170 } |
180 | 171 |
181 TEST_F(ViewportTest, viewport4) | 172 TEST_F(LegacyViewportTest, viewport4) |
182 { | 173 { |
183 UseMockScrollbarSettings mockScrollbarSettings; | |
184 registerMockedHttpURLLoad("viewport/viewport-4.html"); | 174 registerMockedHttpURLLoad("viewport/viewport-4.html"); |
185 | 175 |
186 FrameTestHelpers::WebViewHelper webViewHelper; | 176 FrameTestHelpers::WebViewHelper webViewHelper; |
187 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-4.html", true , 0, 0, setViewportSettings); | 177 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-4.html", true , 0, 0, setViewportSettings); |
188 | 178 |
189 Page* page = webViewHelper.webViewImpl()->page(); | 179 Page* page = webViewHelper.webViewImpl()->page(); |
190 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 180 PageScaleConstraints constraints = runTest(page, 320, 352); |
191 | 181 |
192 EXPECT_EQ(160, constraints.layoutSize.width()); | 182 EXPECT_EQ(160, constraints.layoutSize.width()); |
193 EXPECT_EQ(176, constraints.layoutSize.height()); | 183 EXPECT_EQ(176, constraints.layoutSize.height()); |
194 EXPECT_NEAR(2.0f, constraints.initialScale, 0.01f); | 184 EXPECT_NEAR(2.0f, constraints.initialScale, 0.01f); |
195 EXPECT_NEAR(2.0f, constraints.minimumScale, 0.01f); | 185 EXPECT_NEAR(2.0f, constraints.minimumScale, 0.01f); |
196 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 186 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
197 EXPECT_TRUE(page->viewportDescription().userZoom); | 187 EXPECT_TRUE(page->viewportDescription().userZoom); |
198 } | 188 } |
199 | 189 |
200 TEST_F(ViewportTest, viewport5) | 190 TEST_F(LegacyViewportTest, viewport5) |
201 { | 191 { |
202 UseMockScrollbarSettings mockScrollbarSettings; | |
203 registerMockedHttpURLLoad("viewport/viewport-5.html"); | 192 registerMockedHttpURLLoad("viewport/viewport-5.html"); |
204 | 193 |
205 FrameTestHelpers::WebViewHelper webViewHelper; | 194 FrameTestHelpers::WebViewHelper webViewHelper; |
206 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-5.html", true , 0, 0, setViewportSettings); | 195 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-5.html", true , 0, 0, setViewportSettings); |
207 | 196 |
208 Page* page = webViewHelper.webViewImpl()->page(); | 197 Page* page = webViewHelper.webViewImpl()->page(); |
209 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 198 PageScaleConstraints constraints = runTest(page, 320, 352); |
210 | 199 |
211 EXPECT_EQ(640, constraints.layoutSize.width()); | 200 EXPECT_EQ(640, constraints.layoutSize.width()); |
212 EXPECT_EQ(704, constraints.layoutSize.height()); | 201 EXPECT_EQ(704, constraints.layoutSize.height()); |
213 EXPECT_NEAR(0.5f, constraints.initialScale, 0.01f); | 202 EXPECT_NEAR(0.5f, constraints.initialScale, 0.01f); |
214 EXPECT_NEAR(0.5f, constraints.minimumScale, 0.01f); | 203 EXPECT_NEAR(0.5f, constraints.minimumScale, 0.01f); |
215 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 204 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
216 EXPECT_TRUE(page->viewportDescription().userZoom); | 205 EXPECT_TRUE(page->viewportDescription().userZoom); |
217 } | 206 } |
218 | 207 |
219 TEST_F(ViewportTest, viewport6) | 208 TEST_F(LegacyViewportTest, viewport6) |
220 { | 209 { |
221 UseMockScrollbarSettings mockScrollbarSettings; | |
222 registerMockedHttpURLLoad("viewport/viewport-6.html"); | 210 registerMockedHttpURLLoad("viewport/viewport-6.html"); |
223 | 211 |
224 FrameTestHelpers::WebViewHelper webViewHelper; | 212 FrameTestHelpers::WebViewHelper webViewHelper; |
225 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-6.html", true , 0, 0, setViewportSettings); | 213 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-6.html", true , 0, 0, setViewportSettings); |
226 | 214 |
227 Page* page = webViewHelper.webViewImpl()->page(); | 215 Page* page = webViewHelper.webViewImpl()->page(); |
228 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 216 PageScaleConstraints constraints = runTest(page, 320, 352); |
229 | 217 |
230 EXPECT_EQ(200, constraints.layoutSize.width()); | 218 EXPECT_EQ(200, constraints.layoutSize.width()); |
231 EXPECT_EQ(220, constraints.layoutSize.height()); | 219 EXPECT_EQ(220, constraints.layoutSize.height()); |
232 EXPECT_NEAR(1.6f, constraints.initialScale, 0.01f); | 220 EXPECT_NEAR(1.6f, constraints.initialScale, 0.01f); |
233 EXPECT_NEAR(1.6f, constraints.minimumScale, 0.01f); | 221 EXPECT_NEAR(1.6f, constraints.minimumScale, 0.01f); |
234 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 222 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
235 EXPECT_TRUE(page->viewportDescription().userZoom); | 223 EXPECT_TRUE(page->viewportDescription().userZoom); |
236 } | 224 } |
237 | 225 |
238 TEST_F(ViewportTest, viewport7) | 226 TEST_F(LegacyViewportTest, viewport7) |
239 { | 227 { |
240 UseMockScrollbarSettings mockScrollbarSettings; | |
241 registerMockedHttpURLLoad("viewport/viewport-7.html"); | 228 registerMockedHttpURLLoad("viewport/viewport-7.html"); |
242 | 229 |
243 FrameTestHelpers::WebViewHelper webViewHelper; | 230 FrameTestHelpers::WebViewHelper webViewHelper; |
244 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-7.html", true , 0, 0, setViewportSettings); | 231 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-7.html", true , 0, 0, setViewportSettings); |
245 | 232 |
246 Page* page = webViewHelper.webViewImpl()->page(); | 233 Page* page = webViewHelper.webViewImpl()->page(); |
247 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 234 PageScaleConstraints constraints = runTest(page, 320, 352); |
248 | 235 |
249 EXPECT_EQ(1280, constraints.layoutSize.width()); | 236 EXPECT_EQ(1280, constraints.layoutSize.width()); |
250 EXPECT_EQ(1408, constraints.layoutSize.height()); | 237 EXPECT_EQ(1408, constraints.layoutSize.height()); |
251 EXPECT_NEAR(0.25f, constraints.initialScale, 0.01f); | 238 EXPECT_NEAR(0.25f, constraints.initialScale, 0.01f); |
252 EXPECT_NEAR(0.25f, constraints.minimumScale, 0.01f); | 239 EXPECT_NEAR(0.25f, constraints.minimumScale, 0.01f); |
253 EXPECT_NEAR(0.25f, constraints.maximumScale, 0.01f); | 240 EXPECT_NEAR(0.25f, constraints.maximumScale, 0.01f); |
254 EXPECT_TRUE(page->viewportDescription().userZoom); | 241 EXPECT_TRUE(page->viewportDescription().userZoom); |
255 } | 242 } |
256 | 243 |
257 TEST_F(ViewportTest, viewport8) | 244 TEST_F(LegacyViewportTest, viewport8) |
258 { | 245 { |
259 UseMockScrollbarSettings mockScrollbarSettings; | |
260 registerMockedHttpURLLoad("viewport/viewport-8.html"); | 246 registerMockedHttpURLLoad("viewport/viewport-8.html"); |
261 | 247 |
262 FrameTestHelpers::WebViewHelper webViewHelper; | 248 FrameTestHelpers::WebViewHelper webViewHelper; |
263 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-8.html", true , 0, 0, setViewportSettings); | 249 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-8.html", true , 0, 0, setViewportSettings); |
264 | 250 |
265 Page* page = webViewHelper.webViewImpl()->page(); | 251 Page* page = webViewHelper.webViewImpl()->page(); |
266 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 252 PageScaleConstraints constraints = runTest(page, 320, 352); |
267 | 253 |
268 EXPECT_EQ(1280, constraints.layoutSize.width()); | 254 EXPECT_EQ(1280, constraints.layoutSize.width()); |
269 EXPECT_EQ(1408, constraints.layoutSize.height()); | 255 EXPECT_EQ(1408, constraints.layoutSize.height()); |
270 EXPECT_NEAR(0.25f, constraints.initialScale, 0.01f); | 256 EXPECT_NEAR(0.25f, constraints.initialScale, 0.01f); |
271 EXPECT_NEAR(0.25f, constraints.minimumScale, 0.01f); | 257 EXPECT_NEAR(0.25f, constraints.minimumScale, 0.01f); |
272 EXPECT_NEAR(0.25f, constraints.maximumScale, 0.01f); | 258 EXPECT_NEAR(0.25f, constraints.maximumScale, 0.01f); |
273 EXPECT_TRUE(page->viewportDescription().userZoom); | 259 EXPECT_TRUE(page->viewportDescription().userZoom); |
274 } | 260 } |
275 | 261 |
276 TEST_F(ViewportTest, viewport9) | 262 TEST_F(LegacyViewportTest, viewport9) |
277 { | 263 { |
278 UseMockScrollbarSettings mockScrollbarSettings; | |
279 registerMockedHttpURLLoad("viewport/viewport-9.html"); | 264 registerMockedHttpURLLoad("viewport/viewport-9.html"); |
280 | 265 |
281 FrameTestHelpers::WebViewHelper webViewHelper; | 266 FrameTestHelpers::WebViewHelper webViewHelper; |
282 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-9.html", true , 0, 0, setViewportSettings); | 267 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-9.html", true , 0, 0, setViewportSettings); |
283 | 268 |
284 Page* page = webViewHelper.webViewImpl()->page(); | 269 Page* page = webViewHelper.webViewImpl()->page(); |
285 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 270 PageScaleConstraints constraints = runTest(page, 320, 352); |
286 | 271 |
287 EXPECT_EQ(1280, constraints.layoutSize.width()); | 272 EXPECT_EQ(1280, constraints.layoutSize.width()); |
288 EXPECT_EQ(1408, constraints.layoutSize.height()); | 273 EXPECT_EQ(1408, constraints.layoutSize.height()); |
289 EXPECT_NEAR(0.25f, constraints.initialScale, 0.01f); | 274 EXPECT_NEAR(0.25f, constraints.initialScale, 0.01f); |
290 EXPECT_NEAR(0.25f, constraints.minimumScale, 0.01f); | 275 EXPECT_NEAR(0.25f, constraints.minimumScale, 0.01f); |
291 EXPECT_NEAR(0.25f, constraints.maximumScale, 0.01f); | 276 EXPECT_NEAR(0.25f, constraints.maximumScale, 0.01f); |
292 EXPECT_TRUE(page->viewportDescription().userZoom); | 277 EXPECT_TRUE(page->viewportDescription().userZoom); |
293 } | 278 } |
294 | 279 |
295 TEST_F(ViewportTest, viewport10) | 280 TEST_F(LegacyViewportTest, viewport10) |
296 { | 281 { |
297 UseMockScrollbarSettings mockScrollbarSettings; | |
298 registerMockedHttpURLLoad("viewport/viewport-10.html"); | 282 registerMockedHttpURLLoad("viewport/viewport-10.html"); |
299 | 283 |
300 FrameTestHelpers::WebViewHelper webViewHelper; | 284 FrameTestHelpers::WebViewHelper webViewHelper; |
301 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-10.html", tru e, 0, 0, setViewportSettings); | 285 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-10.html", tru e, 0, 0, setViewportSettings); |
302 | 286 |
303 Page* page = webViewHelper.webViewImpl()->page(); | 287 Page* page = webViewHelper.webViewImpl()->page(); |
304 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 288 PageScaleConstraints constraints = runTest(page, 320, 352); |
305 | 289 |
306 EXPECT_EQ(1280, constraints.layoutSize.width()); | 290 EXPECT_EQ(1280, constraints.layoutSize.width()); |
307 EXPECT_EQ(1408, constraints.layoutSize.height()); | 291 EXPECT_EQ(1408, constraints.layoutSize.height()); |
308 EXPECT_NEAR(0.25f, constraints.initialScale, 0.01f); | 292 EXPECT_NEAR(0.25f, constraints.initialScale, 0.01f); |
309 EXPECT_NEAR(0.25f, constraints.minimumScale, 0.01f); | 293 EXPECT_NEAR(0.25f, constraints.minimumScale, 0.01f); |
310 EXPECT_NEAR(0.25f, constraints.maximumScale, 0.01f); | 294 EXPECT_NEAR(0.25f, constraints.maximumScale, 0.01f); |
311 EXPECT_TRUE(page->viewportDescription().userZoom); | 295 EXPECT_TRUE(page->viewportDescription().userZoom); |
312 } | 296 } |
313 | 297 |
314 TEST_F(ViewportTest, viewport11) | 298 TEST_F(LegacyViewportTest, viewport11) |
315 { | 299 { |
316 UseMockScrollbarSettings mockScrollbarSettings; | |
317 registerMockedHttpURLLoad("viewport/viewport-11.html"); | 300 registerMockedHttpURLLoad("viewport/viewport-11.html"); |
318 | 301 |
319 FrameTestHelpers::WebViewHelper webViewHelper; | 302 FrameTestHelpers::WebViewHelper webViewHelper; |
320 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-11.html", tru e, 0, 0, setViewportSettings); | 303 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-11.html", tru e, 0, 0, setViewportSettings); |
321 | 304 |
322 Page* page = webViewHelper.webViewImpl()->page(); | 305 Page* page = webViewHelper.webViewImpl()->page(); |
323 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 306 PageScaleConstraints constraints = runTest(page, 320, 352); |
324 | 307 |
325 EXPECT_EQ(980, constraints.layoutSize.width()); | 308 EXPECT_EQ(980, constraints.layoutSize.width()); |
326 EXPECT_EQ(1078, constraints.layoutSize.height()); | 309 EXPECT_EQ(1078, constraints.layoutSize.height()); |
327 EXPECT_NEAR(0.32f, constraints.initialScale, 0.01f); | 310 EXPECT_NEAR(0.32f, constraints.initialScale, 0.01f); |
328 EXPECT_NEAR(0.32f, constraints.minimumScale, 0.01f); | 311 EXPECT_NEAR(0.32f, constraints.minimumScale, 0.01f); |
329 EXPECT_NEAR(0.5f, constraints.maximumScale, 0.01f); | 312 EXPECT_NEAR(0.5f, constraints.maximumScale, 0.01f); |
330 EXPECT_TRUE(page->viewportDescription().userZoom); | 313 EXPECT_TRUE(page->viewportDescription().userZoom); |
331 } | 314 } |
332 | 315 |
333 TEST_F(ViewportTest, viewport12) | 316 TEST_F(LegacyViewportTest, viewport12) |
334 { | 317 { |
335 UseMockScrollbarSettings mockScrollbarSettings; | |
336 registerMockedHttpURLLoad("viewport/viewport-12.html"); | 318 registerMockedHttpURLLoad("viewport/viewport-12.html"); |
337 | 319 |
338 FrameTestHelpers::WebViewHelper webViewHelper; | 320 FrameTestHelpers::WebViewHelper webViewHelper; |
339 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-12.html", tru e, 0, 0, setViewportSettings); | 321 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-12.html", tru e, 0, 0, setViewportSettings); |
340 | 322 |
341 Page* page = webViewHelper.webViewImpl()->page(); | 323 Page* page = webViewHelper.webViewImpl()->page(); |
342 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 324 PageScaleConstraints constraints = runTest(page, 320, 352); |
343 | 325 |
344 EXPECT_EQ(640, constraints.layoutSize.width()); | 326 EXPECT_EQ(640, constraints.layoutSize.width()); |
345 EXPECT_EQ(704, constraints.layoutSize.height()); | 327 EXPECT_EQ(704, constraints.layoutSize.height()); |
346 EXPECT_NEAR(0.5f, constraints.initialScale, 0.01f); | 328 EXPECT_NEAR(0.5f, constraints.initialScale, 0.01f); |
347 EXPECT_NEAR(0.5f, constraints.minimumScale, 0.01f); | 329 EXPECT_NEAR(0.5f, constraints.minimumScale, 0.01f); |
348 EXPECT_NEAR(0.5f, constraints.maximumScale, 0.01f); | 330 EXPECT_NEAR(0.5f, constraints.maximumScale, 0.01f); |
349 EXPECT_TRUE(page->viewportDescription().userZoom); | 331 EXPECT_TRUE(page->viewportDescription().userZoom); |
350 } | 332 } |
351 | 333 |
352 TEST_F(ViewportTest, viewport13) | 334 TEST_F(LegacyViewportTest, viewport13) |
353 { | 335 { |
354 UseMockScrollbarSettings mockScrollbarSettings; | |
355 registerMockedHttpURLLoad("viewport/viewport-13.html"); | 336 registerMockedHttpURLLoad("viewport/viewport-13.html"); |
356 | 337 |
357 FrameTestHelpers::WebViewHelper webViewHelper; | 338 FrameTestHelpers::WebViewHelper webViewHelper; |
358 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-13.html", tru e, 0, 0, setViewportSettings); | 339 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-13.html", tru e, 0, 0, setViewportSettings); |
359 | 340 |
360 Page* page = webViewHelper.webViewImpl()->page(); | 341 Page* page = webViewHelper.webViewImpl()->page(); |
361 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 342 PageScaleConstraints constraints = runTest(page, 320, 352); |
362 | 343 |
363 EXPECT_EQ(1280, constraints.layoutSize.width()); | 344 EXPECT_EQ(1280, constraints.layoutSize.width()); |
364 EXPECT_EQ(1408, constraints.layoutSize.height()); | 345 EXPECT_EQ(1408, constraints.layoutSize.height()); |
365 EXPECT_NEAR(0.25f, constraints.initialScale, 0.01f); | 346 EXPECT_NEAR(0.25f, constraints.initialScale, 0.01f); |
366 EXPECT_NEAR(0.25f, constraints.minimumScale, 0.01f); | 347 EXPECT_NEAR(0.25f, constraints.minimumScale, 0.01f); |
367 EXPECT_NEAR(0.5f, constraints.maximumScale, 0.01f); | 348 EXPECT_NEAR(0.5f, constraints.maximumScale, 0.01f); |
368 EXPECT_TRUE(page->viewportDescription().userZoom); | 349 EXPECT_TRUE(page->viewportDescription().userZoom); |
369 } | 350 } |
370 | 351 |
371 TEST_F(ViewportTest, viewport14) | 352 TEST_F(LegacyViewportTest, viewport14) |
372 { | 353 { |
373 UseMockScrollbarSettings mockScrollbarSettings; | |
374 registerMockedHttpURLLoad("viewport/viewport-14.html"); | 354 registerMockedHttpURLLoad("viewport/viewport-14.html"); |
375 | 355 |
376 FrameTestHelpers::WebViewHelper webViewHelper; | 356 FrameTestHelpers::WebViewHelper webViewHelper; |
377 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-14.html", tru e, 0, 0, setViewportSettings); | 357 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-14.html", tru e, 0, 0, setViewportSettings); |
378 | 358 |
379 Page* page = webViewHelper.webViewImpl()->page(); | 359 Page* page = webViewHelper.webViewImpl()->page(); |
380 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 360 PageScaleConstraints constraints = runTest(page, 320, 352); |
381 | 361 |
382 EXPECT_EQ(320, constraints.layoutSize.width()); | 362 EXPECT_EQ(320, constraints.layoutSize.width()); |
383 EXPECT_EQ(352, constraints.layoutSize.height()); | 363 EXPECT_EQ(352, constraints.layoutSize.height()); |
384 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); | 364 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); |
385 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); | 365 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); |
386 EXPECT_NEAR(1.0f, constraints.maximumScale, 0.01f); | 366 EXPECT_NEAR(1.0f, constraints.maximumScale, 0.01f); |
387 EXPECT_TRUE(page->viewportDescription().userZoom); | 367 EXPECT_TRUE(page->viewportDescription().userZoom); |
388 } | 368 } |
389 | 369 |
390 TEST_F(ViewportTest, viewport15) | 370 TEST_F(LegacyViewportTest, viewport15) |
391 { | 371 { |
392 UseMockScrollbarSettings mockScrollbarSettings; | |
393 registerMockedHttpURLLoad("viewport/viewport-15.html"); | 372 registerMockedHttpURLLoad("viewport/viewport-15.html"); |
394 | 373 |
395 FrameTestHelpers::WebViewHelper webViewHelper; | 374 FrameTestHelpers::WebViewHelper webViewHelper; |
396 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-15.html", tru e, 0, 0, setViewportSettings); | 375 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-15.html", tru e, 0, 0, setViewportSettings); |
397 | 376 |
398 Page* page = webViewHelper.webViewImpl()->page(); | 377 Page* page = webViewHelper.webViewImpl()->page(); |
399 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 378 PageScaleConstraints constraints = runTest(page, 320, 352); |
400 | 379 |
401 EXPECT_EQ(980, constraints.layoutSize.width()); | 380 EXPECT_EQ(980, constraints.layoutSize.width()); |
402 EXPECT_EQ(1078, constraints.layoutSize.height()); | 381 EXPECT_EQ(1078, constraints.layoutSize.height()); |
403 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); | 382 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); |
404 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); | 383 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); |
405 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 384 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
406 EXPECT_TRUE(page->viewportDescription().userZoom); | 385 EXPECT_TRUE(page->viewportDescription().userZoom); |
407 } | 386 } |
408 | 387 |
409 TEST_F(ViewportTest, viewport16) | 388 TEST_F(LegacyViewportTest, viewport16) |
410 { | 389 { |
411 UseMockScrollbarSettings mockScrollbarSettings; | |
412 registerMockedHttpURLLoad("viewport/viewport-16.html"); | 390 registerMockedHttpURLLoad("viewport/viewport-16.html"); |
413 | 391 |
414 FrameTestHelpers::WebViewHelper webViewHelper; | 392 FrameTestHelpers::WebViewHelper webViewHelper; |
415 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-16.html", tru e, 0, 0, setViewportSettings); | 393 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-16.html", tru e, 0, 0, setViewportSettings); |
416 | 394 |
417 Page* page = webViewHelper.webViewImpl()->page(); | 395 Page* page = webViewHelper.webViewImpl()->page(); |
418 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 396 PageScaleConstraints constraints = runTest(page, 320, 352); |
419 | 397 |
420 EXPECT_EQ(980, constraints.layoutSize.width()); | 398 EXPECT_EQ(980, constraints.layoutSize.width()); |
421 EXPECT_EQ(1078, constraints.layoutSize.height()); | 399 EXPECT_EQ(1078, constraints.layoutSize.height()); |
422 EXPECT_NEAR(5.0f, constraints.initialScale, 0.01f); | 400 EXPECT_NEAR(5.0f, constraints.initialScale, 0.01f); |
423 EXPECT_NEAR(5.0f, constraints.minimumScale, 0.01f); | 401 EXPECT_NEAR(5.0f, constraints.minimumScale, 0.01f); |
424 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 402 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
425 EXPECT_TRUE(page->viewportDescription().userZoom); | 403 EXPECT_TRUE(page->viewportDescription().userZoom); |
426 } | 404 } |
427 | 405 |
428 TEST_F(ViewportTest, viewport17) | 406 TEST_F(LegacyViewportTest, viewport17) |
429 { | 407 { |
430 UseMockScrollbarSettings mockScrollbarSettings; | |
431 registerMockedHttpURLLoad("viewport/viewport-17.html"); | 408 registerMockedHttpURLLoad("viewport/viewport-17.html"); |
432 | 409 |
433 FrameTestHelpers::WebViewHelper webViewHelper; | 410 FrameTestHelpers::WebViewHelper webViewHelper; |
434 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-17.html", tru e, 0, 0, setViewportSettings); | 411 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-17.html", tru e, 0, 0, setViewportSettings); |
435 | 412 |
436 Page* page = webViewHelper.webViewImpl()->page(); | 413 Page* page = webViewHelper.webViewImpl()->page(); |
437 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 414 PageScaleConstraints constraints = runTest(page, 320, 352); |
438 | 415 |
439 EXPECT_EQ(980, constraints.layoutSize.width()); | 416 EXPECT_EQ(980, constraints.layoutSize.width()); |
440 EXPECT_EQ(1078, constraints.layoutSize.height()); | 417 EXPECT_EQ(1078, constraints.layoutSize.height()); |
441 EXPECT_NEAR(5.0f, constraints.initialScale, 0.01f); | 418 EXPECT_NEAR(5.0f, constraints.initialScale, 0.01f); |
442 EXPECT_NEAR(5.0f, constraints.minimumScale, 0.01f); | 419 EXPECT_NEAR(5.0f, constraints.minimumScale, 0.01f); |
443 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 420 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
444 EXPECT_TRUE(page->viewportDescription().userZoom); | 421 EXPECT_TRUE(page->viewportDescription().userZoom); |
445 } | 422 } |
446 | 423 |
447 TEST_F(ViewportTest, viewport18) | 424 TEST_F(LegacyViewportTest, viewport18) |
448 { | 425 { |
449 UseMockScrollbarSettings mockScrollbarSettings; | |
450 registerMockedHttpURLLoad("viewport/viewport-18.html"); | 426 registerMockedHttpURLLoad("viewport/viewport-18.html"); |
451 | 427 |
452 FrameTestHelpers::WebViewHelper webViewHelper; | 428 FrameTestHelpers::WebViewHelper webViewHelper; |
453 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-18.html", tru e, 0, 0, setViewportSettings); | 429 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-18.html", tru e, 0, 0, setViewportSettings); |
454 | 430 |
455 Page* page = webViewHelper.webViewImpl()->page(); | 431 Page* page = webViewHelper.webViewImpl()->page(); |
456 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 432 PageScaleConstraints constraints = runTest(page, 320, 352); |
457 | 433 |
458 EXPECT_EQ(64, constraints.layoutSize.width()); | 434 EXPECT_EQ(64, constraints.layoutSize.width()); |
459 EXPECT_NEAR(70.4, constraints.layoutSize.height(), 0.01f); | 435 EXPECT_NEAR(70.4, constraints.layoutSize.height(), 0.01f); |
460 EXPECT_NEAR(5.0f, constraints.initialScale, 0.01f); | 436 EXPECT_NEAR(5.0f, constraints.initialScale, 0.01f); |
461 EXPECT_NEAR(5.0f, constraints.minimumScale, 0.01f); | 437 EXPECT_NEAR(5.0f, constraints.minimumScale, 0.01f); |
462 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 438 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
463 EXPECT_TRUE(page->viewportDescription().userZoom); | 439 EXPECT_TRUE(page->viewportDescription().userZoom); |
464 } | 440 } |
465 | 441 |
466 TEST_F(ViewportTest, viewport19) | 442 TEST_F(LegacyViewportTest, viewport19) |
467 { | 443 { |
468 UseMockScrollbarSettings mockScrollbarSettings; | |
469 registerMockedHttpURLLoad("viewport/viewport-19.html"); | 444 registerMockedHttpURLLoad("viewport/viewport-19.html"); |
470 | 445 |
471 FrameTestHelpers::WebViewHelper webViewHelper; | 446 FrameTestHelpers::WebViewHelper webViewHelper; |
472 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-19.html", tru e, 0, 0, setViewportSettings); | 447 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-19.html", tru e, 0, 0, setViewportSettings); |
473 | 448 |
474 Page* page = webViewHelper.webViewImpl()->page(); | 449 Page* page = webViewHelper.webViewImpl()->page(); |
475 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 450 PageScaleConstraints constraints = runTest(page, 320, 352); |
476 | 451 |
477 EXPECT_EQ(160, constraints.layoutSize.width()); | 452 EXPECT_EQ(160, constraints.layoutSize.width()); |
478 EXPECT_EQ(176, constraints.layoutSize.height()); | 453 EXPECT_EQ(176, constraints.layoutSize.height()); |
479 EXPECT_NEAR(2.0f, constraints.initialScale, 0.01f); | 454 EXPECT_NEAR(2.0f, constraints.initialScale, 0.01f); |
480 EXPECT_NEAR(2.0f, constraints.minimumScale, 0.01f); | 455 EXPECT_NEAR(2.0f, constraints.minimumScale, 0.01f); |
481 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 456 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
482 EXPECT_TRUE(page->viewportDescription().userZoom); | 457 EXPECT_TRUE(page->viewportDescription().userZoom); |
483 } | 458 } |
484 | 459 |
485 TEST_F(ViewportTest, viewport20) | 460 TEST_F(LegacyViewportTest, viewport20) |
486 { | 461 { |
487 UseMockScrollbarSettings mockScrollbarSettings; | |
488 registerMockedHttpURLLoad("viewport/viewport-20.html"); | 462 registerMockedHttpURLLoad("viewport/viewport-20.html"); |
489 | 463 |
490 FrameTestHelpers::WebViewHelper webViewHelper; | 464 FrameTestHelpers::WebViewHelper webViewHelper; |
491 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-20.html", tru e, 0, 0, setViewportSettings); | 465 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-20.html", tru e, 0, 0, setViewportSettings); |
492 | 466 |
493 Page* page = webViewHelper.webViewImpl()->page(); | 467 Page* page = webViewHelper.webViewImpl()->page(); |
494 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 468 PageScaleConstraints constraints = runTest(page, 320, 352); |
495 | 469 |
496 EXPECT_EQ(980, constraints.layoutSize.width()); | 470 EXPECT_EQ(980, constraints.layoutSize.width()); |
497 EXPECT_EQ(1078, constraints.layoutSize.height()); | 471 EXPECT_EQ(1078, constraints.layoutSize.height()); |
498 EXPECT_NEAR(10.0f, constraints.initialScale, 0.01f); | 472 EXPECT_NEAR(10.0f, constraints.initialScale, 0.01f); |
499 EXPECT_NEAR(10.0f, constraints.minimumScale, 0.01f); | 473 EXPECT_NEAR(10.0f, constraints.minimumScale, 0.01f); |
500 EXPECT_NEAR(10.0f, constraints.maximumScale, 0.01f); | 474 EXPECT_NEAR(10.0f, constraints.maximumScale, 0.01f); |
501 EXPECT_TRUE(page->viewportDescription().userZoom); | 475 EXPECT_TRUE(page->viewportDescription().userZoom); |
502 } | 476 } |
503 | 477 |
504 TEST_F(ViewportTest, viewport21) | 478 TEST_F(LegacyViewportTest, viewport21) |
505 { | 479 { |
506 UseMockScrollbarSettings mockScrollbarSettings; | |
507 registerMockedHttpURLLoad("viewport/viewport-21.html"); | 480 registerMockedHttpURLLoad("viewport/viewport-21.html"); |
508 | 481 |
509 FrameTestHelpers::WebViewHelper webViewHelper; | 482 FrameTestHelpers::WebViewHelper webViewHelper; |
510 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-21.html", tru e, 0, 0, setViewportSettings); | 483 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-21.html", tru e, 0, 0, setViewportSettings); |
511 | 484 |
512 Page* page = webViewHelper.webViewImpl()->page(); | 485 Page* page = webViewHelper.webViewImpl()->page(); |
513 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 486 PageScaleConstraints constraints = runTest(page, 320, 352); |
514 | 487 |
515 EXPECT_EQ(980, constraints.layoutSize.width()); | 488 EXPECT_EQ(980, constraints.layoutSize.width()); |
516 EXPECT_EQ(1078, constraints.layoutSize.height()); | 489 EXPECT_EQ(1078, constraints.layoutSize.height()); |
517 EXPECT_NEAR(10.0f, constraints.initialScale, 0.01f); | 490 EXPECT_NEAR(10.0f, constraints.initialScale, 0.01f); |
518 EXPECT_NEAR(10.0f, constraints.minimumScale, 0.01f); | 491 EXPECT_NEAR(10.0f, constraints.minimumScale, 0.01f); |
519 EXPECT_NEAR(10.0f, constraints.maximumScale, 0.01f); | 492 EXPECT_NEAR(10.0f, constraints.maximumScale, 0.01f); |
520 EXPECT_TRUE(page->viewportDescription().userZoom); | 493 EXPECT_TRUE(page->viewportDescription().userZoom); |
521 } | 494 } |
522 | 495 |
523 TEST_F(ViewportTest, viewport22) | 496 TEST_F(LegacyViewportTest, viewport22) |
524 { | 497 { |
525 UseMockScrollbarSettings mockScrollbarSettings; | |
526 registerMockedHttpURLLoad("viewport/viewport-22.html"); | 498 registerMockedHttpURLLoad("viewport/viewport-22.html"); |
527 | 499 |
528 FrameTestHelpers::WebViewHelper webViewHelper; | 500 FrameTestHelpers::WebViewHelper webViewHelper; |
529 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-22.html", tru e, 0, 0, setViewportSettings); | 501 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-22.html", tru e, 0, 0, setViewportSettings); |
530 | 502 |
531 Page* page = webViewHelper.webViewImpl()->page(); | 503 Page* page = webViewHelper.webViewImpl()->page(); |
532 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 504 PageScaleConstraints constraints = runTest(page, 320, 352); |
533 | 505 |
534 EXPECT_EQ(980, constraints.layoutSize.width()); | 506 EXPECT_EQ(980, constraints.layoutSize.width()); |
535 EXPECT_EQ(1078, constraints.layoutSize.height()); | 507 EXPECT_EQ(1078, constraints.layoutSize.height()); |
536 EXPECT_NEAR(10.0f, constraints.initialScale, 0.01f); | 508 EXPECT_NEAR(10.0f, constraints.initialScale, 0.01f); |
537 EXPECT_NEAR(10.0f, constraints.minimumScale, 0.01f); | 509 EXPECT_NEAR(10.0f, constraints.minimumScale, 0.01f); |
538 EXPECT_NEAR(10.0f, constraints.maximumScale, 0.01f); | 510 EXPECT_NEAR(10.0f, constraints.maximumScale, 0.01f); |
539 EXPECT_TRUE(page->viewportDescription().userZoom); | 511 EXPECT_TRUE(page->viewportDescription().userZoom); |
540 } | 512 } |
541 | 513 |
542 TEST_F(ViewportTest, viewport23) | 514 TEST_F(LegacyViewportTest, viewport23) |
543 { | 515 { |
544 UseMockScrollbarSettings mockScrollbarSettings; | |
545 registerMockedHttpURLLoad("viewport/viewport-23.html"); | 516 registerMockedHttpURLLoad("viewport/viewport-23.html"); |
546 | 517 |
547 FrameTestHelpers::WebViewHelper webViewHelper; | 518 FrameTestHelpers::WebViewHelper webViewHelper; |
548 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-23.html", tru e, 0, 0, setViewportSettings); | 519 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-23.html", tru e, 0, 0, setViewportSettings); |
549 | 520 |
550 Page* page = webViewHelper.webViewImpl()->page(); | 521 Page* page = webViewHelper.webViewImpl()->page(); |
551 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 522 PageScaleConstraints constraints = runTest(page, 320, 352); |
552 | 523 |
553 EXPECT_EQ(980, constraints.layoutSize.width()); | 524 EXPECT_EQ(980, constraints.layoutSize.width()); |
554 EXPECT_EQ(1078, constraints.layoutSize.height()); | 525 EXPECT_EQ(1078, constraints.layoutSize.height()); |
555 EXPECT_NEAR(3.0f, constraints.initialScale, 0.01f); | 526 EXPECT_NEAR(3.0f, constraints.initialScale, 0.01f); |
556 EXPECT_NEAR(3.0f, constraints.minimumScale, 0.01f); | 527 EXPECT_NEAR(3.0f, constraints.minimumScale, 0.01f); |
557 EXPECT_NEAR(3.0f, constraints.maximumScale, 0.01f); | 528 EXPECT_NEAR(3.0f, constraints.maximumScale, 0.01f); |
558 EXPECT_TRUE(page->viewportDescription().userZoom); | 529 EXPECT_TRUE(page->viewportDescription().userZoom); |
559 } | 530 } |
560 | 531 |
561 TEST_F(ViewportTest, viewport24) | 532 TEST_F(LegacyViewportTest, viewport24) |
562 { | 533 { |
563 UseMockScrollbarSettings mockScrollbarSettings; | |
564 registerMockedHttpURLLoad("viewport/viewport-24.html"); | 534 registerMockedHttpURLLoad("viewport/viewport-24.html"); |
565 | 535 |
566 FrameTestHelpers::WebViewHelper webViewHelper; | 536 FrameTestHelpers::WebViewHelper webViewHelper; |
567 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-24.html", tru e, 0, 0, setViewportSettings); | 537 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-24.html", tru e, 0, 0, setViewportSettings); |
568 | 538 |
569 Page* page = webViewHelper.webViewImpl()->page(); | 539 Page* page = webViewHelper.webViewImpl()->page(); |
570 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 540 PageScaleConstraints constraints = runTest(page, 320, 352); |
571 | 541 |
572 EXPECT_EQ(980, constraints.layoutSize.width()); | 542 EXPECT_EQ(980, constraints.layoutSize.width()); |
573 EXPECT_EQ(1078, constraints.layoutSize.height()); | 543 EXPECT_EQ(1078, constraints.layoutSize.height()); |
574 EXPECT_NEAR(4.0f, constraints.initialScale, 0.01f); | 544 EXPECT_NEAR(4.0f, constraints.initialScale, 0.01f); |
575 EXPECT_NEAR(4.0f, constraints.minimumScale, 0.01f); | 545 EXPECT_NEAR(4.0f, constraints.minimumScale, 0.01f); |
576 EXPECT_NEAR(4.0f, constraints.maximumScale, 0.01f); | 546 EXPECT_NEAR(4.0f, constraints.maximumScale, 0.01f); |
577 EXPECT_TRUE(page->viewportDescription().userZoom); | 547 EXPECT_TRUE(page->viewportDescription().userZoom); |
578 } | 548 } |
579 | 549 |
580 TEST_F(ViewportTest, viewport25) | 550 TEST_F(LegacyViewportTest, viewport25) |
581 { | 551 { |
582 UseMockScrollbarSettings mockScrollbarSettings; | |
583 registerMockedHttpURLLoad("viewport/viewport-25.html"); | 552 registerMockedHttpURLLoad("viewport/viewport-25.html"); |
584 | 553 |
585 FrameTestHelpers::WebViewHelper webViewHelper; | 554 FrameTestHelpers::WebViewHelper webViewHelper; |
586 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-25.html", tru e, 0, 0, setViewportSettings); | 555 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-25.html", tru e, 0, 0, setViewportSettings); |
587 | 556 |
588 Page* page = webViewHelper.webViewImpl()->page(); | 557 Page* page = webViewHelper.webViewImpl()->page(); |
589 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 558 PageScaleConstraints constraints = runTest(page, 320, 352); |
590 | 559 |
591 EXPECT_EQ(980, constraints.layoutSize.width()); | 560 EXPECT_EQ(980, constraints.layoutSize.width()); |
592 EXPECT_EQ(1078, constraints.layoutSize.height()); | 561 EXPECT_EQ(1078, constraints.layoutSize.height()); |
593 EXPECT_NEAR(10.0f, constraints.initialScale, 0.01f); | 562 EXPECT_NEAR(10.0f, constraints.initialScale, 0.01f); |
594 EXPECT_NEAR(10.0f, constraints.minimumScale, 0.01f); | 563 EXPECT_NEAR(10.0f, constraints.minimumScale, 0.01f); |
595 EXPECT_NEAR(10.0f, constraints.maximumScale, 0.01f); | 564 EXPECT_NEAR(10.0f, constraints.maximumScale, 0.01f); |
596 EXPECT_TRUE(page->viewportDescription().userZoom); | 565 EXPECT_TRUE(page->viewportDescription().userZoom); |
597 } | 566 } |
598 | 567 |
599 TEST_F(ViewportTest, viewport26) | 568 TEST_F(LegacyViewportTest, viewport26) |
600 { | 569 { |
601 UseMockScrollbarSettings mockScrollbarSettings; | |
602 registerMockedHttpURLLoad("viewport/viewport-26.html"); | 570 registerMockedHttpURLLoad("viewport/viewport-26.html"); |
603 | 571 |
604 FrameTestHelpers::WebViewHelper webViewHelper; | 572 FrameTestHelpers::WebViewHelper webViewHelper; |
605 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-26.html", tru e, 0, 0, setViewportSettings); | 573 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-26.html", tru e, 0, 0, setViewportSettings); |
606 | 574 |
607 Page* page = webViewHelper.webViewImpl()->page(); | 575 Page* page = webViewHelper.webViewImpl()->page(); |
608 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 576 PageScaleConstraints constraints = runTest(page, 320, 352); |
609 | 577 |
610 EXPECT_EQ(980, constraints.layoutSize.width()); | 578 EXPECT_EQ(980, constraints.layoutSize.width()); |
611 EXPECT_EQ(1078, constraints.layoutSize.height()); | 579 EXPECT_EQ(1078, constraints.layoutSize.height()); |
612 EXPECT_NEAR(8.0f, constraints.initialScale, 0.01f); | 580 EXPECT_NEAR(8.0f, constraints.initialScale, 0.01f); |
613 EXPECT_NEAR(8.0f, constraints.minimumScale, 0.01f); | 581 EXPECT_NEAR(8.0f, constraints.minimumScale, 0.01f); |
614 EXPECT_NEAR(9.0f, constraints.maximumScale, 0.01f); | 582 EXPECT_NEAR(9.0f, constraints.maximumScale, 0.01f); |
615 EXPECT_TRUE(page->viewportDescription().userZoom); | 583 EXPECT_TRUE(page->viewportDescription().userZoom); |
616 } | 584 } |
617 | 585 |
618 TEST_F(ViewportTest, viewport27) | 586 TEST_F(LegacyViewportTest, viewport27) |
619 { | 587 { |
620 UseMockScrollbarSettings mockScrollbarSettings; | |
621 registerMockedHttpURLLoad("viewport/viewport-27.html"); | 588 registerMockedHttpURLLoad("viewport/viewport-27.html"); |
622 | 589 |
623 FrameTestHelpers::WebViewHelper webViewHelper; | 590 FrameTestHelpers::WebViewHelper webViewHelper; |
624 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-27.html", tru e, 0, 0, setViewportSettings); | 591 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-27.html", tru e, 0, 0, setViewportSettings); |
625 | 592 |
626 Page* page = webViewHelper.webViewImpl()->page(); | 593 Page* page = webViewHelper.webViewImpl()->page(); |
627 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 594 PageScaleConstraints constraints = runTest(page, 320, 352); |
628 | 595 |
629 EXPECT_EQ(980, constraints.layoutSize.width()); | 596 EXPECT_EQ(980, constraints.layoutSize.width()); |
630 EXPECT_EQ(1078, constraints.layoutSize.height()); | 597 EXPECT_EQ(1078, constraints.layoutSize.height()); |
631 EXPECT_NEAR(0.32f, constraints.initialScale, 0.01f); | 598 EXPECT_NEAR(0.32f, constraints.initialScale, 0.01f); |
632 EXPECT_NEAR(0.32f, constraints.minimumScale, 0.01f); | 599 EXPECT_NEAR(0.32f, constraints.minimumScale, 0.01f); |
633 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 600 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
634 EXPECT_TRUE(page->viewportDescription().userZoom); | 601 EXPECT_TRUE(page->viewportDescription().userZoom); |
635 } | 602 } |
636 | 603 |
637 TEST_F(ViewportTest, viewport28) | 604 TEST_F(LegacyViewportTest, viewport28) |
638 { | 605 { |
639 UseMockScrollbarSettings mockScrollbarSettings; | |
640 registerMockedHttpURLLoad("viewport/viewport-28.html"); | 606 registerMockedHttpURLLoad("viewport/viewport-28.html"); |
641 | 607 |
642 FrameTestHelpers::WebViewHelper webViewHelper; | 608 FrameTestHelpers::WebViewHelper webViewHelper; |
643 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-28.html", tru e, 0, 0, setViewportSettings); | 609 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-28.html", tru e, 0, 0, setViewportSettings); |
644 | 610 |
645 Page* page = webViewHelper.webViewImpl()->page(); | 611 Page* page = webViewHelper.webViewImpl()->page(); |
646 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 612 PageScaleConstraints constraints = runTest(page, 320, 352); |
647 | 613 |
648 EXPECT_EQ(352, constraints.layoutSize.width()); | 614 EXPECT_EQ(352, constraints.layoutSize.width()); |
649 EXPECT_NEAR(387.2, constraints.layoutSize.height(), 0.01); | 615 EXPECT_NEAR(387.2, constraints.layoutSize.height(), 0.01); |
650 EXPECT_NEAR(0.91f, constraints.initialScale, 0.01f); | 616 EXPECT_NEAR(0.91f, constraints.initialScale, 0.01f); |
651 EXPECT_NEAR(0.91f, constraints.minimumScale, 0.01f); | 617 EXPECT_NEAR(0.91f, constraints.minimumScale, 0.01f); |
652 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 618 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
653 EXPECT_TRUE(page->viewportDescription().userZoom); | 619 EXPECT_TRUE(page->viewportDescription().userZoom); |
654 } | 620 } |
655 | 621 |
656 TEST_F(ViewportTest, viewport29) | 622 TEST_F(LegacyViewportTest, viewport29) |
657 { | 623 { |
658 UseMockScrollbarSettings mockScrollbarSettings; | |
659 registerMockedHttpURLLoad("viewport/viewport-29.html"); | 624 registerMockedHttpURLLoad("viewport/viewport-29.html"); |
660 | 625 |
661 FrameTestHelpers::WebViewHelper webViewHelper; | 626 FrameTestHelpers::WebViewHelper webViewHelper; |
662 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-29.html", tru e, 0, 0, setViewportSettings); | 627 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-29.html", tru e, 0, 0, setViewportSettings); |
663 | 628 |
664 Page* page = webViewHelper.webViewImpl()->page(); | 629 Page* page = webViewHelper.webViewImpl()->page(); |
665 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 630 PageScaleConstraints constraints = runTest(page, 320, 352); |
666 | 631 |
667 EXPECT_EQ(700, constraints.layoutSize.width()); | 632 EXPECT_EQ(700, constraints.layoutSize.width()); |
668 EXPECT_EQ(770, constraints.layoutSize.height()); | 633 EXPECT_EQ(770, constraints.layoutSize.height()); |
669 EXPECT_NEAR(0.46f, constraints.initialScale, 0.01f); | 634 EXPECT_NEAR(0.46f, constraints.initialScale, 0.01f); |
670 EXPECT_NEAR(0.46f, constraints.minimumScale, 0.01f); | 635 EXPECT_NEAR(0.46f, constraints.minimumScale, 0.01f); |
671 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 636 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
672 EXPECT_TRUE(page->viewportDescription().userZoom); | 637 EXPECT_TRUE(page->viewportDescription().userZoom); |
673 } | 638 } |
674 | 639 |
675 TEST_F(ViewportTest, viewport30) | 640 TEST_F(LegacyViewportTest, viewport30) |
676 { | 641 { |
677 UseMockScrollbarSettings mockScrollbarSettings; | |
678 registerMockedHttpURLLoad("viewport/viewport-30.html"); | 642 registerMockedHttpURLLoad("viewport/viewport-30.html"); |
679 | 643 |
680 FrameTestHelpers::WebViewHelper webViewHelper; | 644 FrameTestHelpers::WebViewHelper webViewHelper; |
681 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-30.html", tru e, 0, 0, setViewportSettings); | 645 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-30.html", tru e, 0, 0, setViewportSettings); |
682 | 646 |
683 Page* page = webViewHelper.webViewImpl()->page(); | 647 Page* page = webViewHelper.webViewImpl()->page(); |
684 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 648 PageScaleConstraints constraints = runTest(page, 320, 352); |
685 | 649 |
686 EXPECT_EQ(200, constraints.layoutSize.width()); | 650 EXPECT_EQ(200, constraints.layoutSize.width()); |
687 EXPECT_EQ(220, constraints.layoutSize.height()); | 651 EXPECT_EQ(220, constraints.layoutSize.height()); |
688 EXPECT_NEAR(1.6f, constraints.initialScale, 0.01f); | 652 EXPECT_NEAR(1.6f, constraints.initialScale, 0.01f); |
689 EXPECT_NEAR(1.6f, constraints.minimumScale, 0.01f); | 653 EXPECT_NEAR(1.6f, constraints.minimumScale, 0.01f); |
690 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 654 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
691 EXPECT_TRUE(page->viewportDescription().userZoom); | 655 EXPECT_TRUE(page->viewportDescription().userZoom); |
692 } | 656 } |
693 | 657 |
694 TEST_F(ViewportTest, viewport31) | 658 TEST_F(LegacyViewportTest, viewport31) |
695 { | 659 { |
696 UseMockScrollbarSettings mockScrollbarSettings; | |
697 registerMockedHttpURLLoad("viewport/viewport-31.html"); | 660 registerMockedHttpURLLoad("viewport/viewport-31.html"); |
698 | 661 |
699 FrameTestHelpers::WebViewHelper webViewHelper; | 662 FrameTestHelpers::WebViewHelper webViewHelper; |
700 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-31.html", tru e, 0, 0, setViewportSettings); | 663 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-31.html", tru e, 0, 0, setViewportSettings); |
701 | 664 |
702 Page* page = webViewHelper.webViewImpl()->page(); | 665 Page* page = webViewHelper.webViewImpl()->page(); |
703 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 666 PageScaleConstraints constraints = runTest(page, 320, 352); |
704 | 667 |
705 EXPECT_EQ(980, constraints.layoutSize.width()); | 668 EXPECT_EQ(980, constraints.layoutSize.width()); |
706 EXPECT_EQ(700, constraints.layoutSize.height()); | 669 EXPECT_EQ(700, constraints.layoutSize.height()); |
707 EXPECT_NEAR(0.33f, constraints.initialScale, 0.01f); | 670 EXPECT_NEAR(0.33f, constraints.initialScale, 0.01f); |
708 EXPECT_NEAR(0.33f, constraints.minimumScale, 0.01f); | 671 EXPECT_NEAR(0.33f, constraints.minimumScale, 0.01f); |
709 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 672 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
710 EXPECT_TRUE(page->viewportDescription().userZoom); | 673 EXPECT_TRUE(page->viewportDescription().userZoom); |
711 } | 674 } |
712 | 675 |
713 TEST_F(ViewportTest, viewport32) | 676 TEST_F(LegacyViewportTest, viewport32) |
714 { | 677 { |
715 UseMockScrollbarSettings mockScrollbarSettings; | |
716 registerMockedHttpURLLoad("viewport/viewport-32.html"); | 678 registerMockedHttpURLLoad("viewport/viewport-32.html"); |
717 | 679 |
718 FrameTestHelpers::WebViewHelper webViewHelper; | 680 FrameTestHelpers::WebViewHelper webViewHelper; |
719 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-32.html", tru e, 0, 0, setViewportSettings); | 681 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-32.html", tru e, 0, 0, setViewportSettings); |
720 | 682 |
721 Page* page = webViewHelper.webViewImpl()->page(); | 683 Page* page = webViewHelper.webViewImpl()->page(); |
722 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 684 PageScaleConstraints constraints = runTest(page, 320, 352); |
723 | 685 |
724 EXPECT_EQ(980, constraints.layoutSize.width()); | 686 EXPECT_EQ(980, constraints.layoutSize.width()); |
725 EXPECT_EQ(200, constraints.layoutSize.height()); | 687 EXPECT_EQ(200, constraints.layoutSize.height()); |
726 EXPECT_NEAR(0.33f, constraints.initialScale, 0.01f); | 688 EXPECT_NEAR(0.33f, constraints.initialScale, 0.01f); |
727 EXPECT_NEAR(0.33f, constraints.minimumScale, 0.01f); | 689 EXPECT_NEAR(0.33f, constraints.minimumScale, 0.01f); |
728 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 690 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
729 EXPECT_TRUE(page->viewportDescription().userZoom); | 691 EXPECT_TRUE(page->viewportDescription().userZoom); |
730 } | 692 } |
731 | 693 |
732 TEST_F(ViewportTest, viewport33) | 694 TEST_F(LegacyViewportTest, viewport33) |
733 { | 695 { |
734 UseMockScrollbarSettings mockScrollbarSettings; | |
735 registerMockedHttpURLLoad("viewport/viewport-33.html"); | 696 registerMockedHttpURLLoad("viewport/viewport-33.html"); |
736 | 697 |
737 FrameTestHelpers::WebViewHelper webViewHelper; | 698 FrameTestHelpers::WebViewHelper webViewHelper; |
738 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-33.html", tru e, 0, 0, setViewportSettings); | 699 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-33.html", tru e, 0, 0, setViewportSettings); |
739 | 700 |
740 Page* page = webViewHelper.webViewImpl()->page(); | 701 Page* page = webViewHelper.webViewImpl()->page(); |
741 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 702 PageScaleConstraints constraints = runTest(page, 320, 352); |
742 | 703 |
743 EXPECT_EQ(320, constraints.layoutSize.width()); | 704 EXPECT_EQ(320, constraints.layoutSize.width()); |
744 EXPECT_EQ(352, constraints.layoutSize.height()); | 705 EXPECT_EQ(352, constraints.layoutSize.height()); |
745 EXPECT_NEAR(2.0f, constraints.initialScale, 0.01f); | 706 EXPECT_NEAR(2.0f, constraints.initialScale, 0.01f); |
746 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); | 707 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); |
747 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 708 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
748 EXPECT_TRUE(page->viewportDescription().userZoom); | 709 EXPECT_TRUE(page->viewportDescription().userZoom); |
749 } | 710 } |
750 | 711 |
751 TEST_F(ViewportTest, viewport34) | 712 TEST_F(LegacyViewportTest, viewport34) |
752 { | 713 { |
753 UseMockScrollbarSettings mockScrollbarSettings; | |
754 registerMockedHttpURLLoad("viewport/viewport-34.html"); | 714 registerMockedHttpURLLoad("viewport/viewport-34.html"); |
755 | 715 |
756 FrameTestHelpers::WebViewHelper webViewHelper; | 716 FrameTestHelpers::WebViewHelper webViewHelper; |
757 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-34.html", tru e, 0, 0, setViewportSettings); | 717 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-34.html", tru e, 0, 0, setViewportSettings); |
758 | 718 |
759 Page* page = webViewHelper.webViewImpl()->page(); | 719 Page* page = webViewHelper.webViewImpl()->page(); |
760 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 720 PageScaleConstraints constraints = runTest(page, 320, 352); |
761 | 721 |
762 EXPECT_EQ(640, constraints.layoutSize.width()); | 722 EXPECT_EQ(640, constraints.layoutSize.width()); |
763 EXPECT_EQ(704, constraints.layoutSize.height()); | 723 EXPECT_EQ(704, constraints.layoutSize.height()); |
764 EXPECT_NEAR(0.5f, constraints.initialScale, 0.01f); | 724 EXPECT_NEAR(0.5f, constraints.initialScale, 0.01f); |
765 EXPECT_NEAR(0.5f, constraints.minimumScale, 0.01f); | 725 EXPECT_NEAR(0.5f, constraints.minimumScale, 0.01f); |
766 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 726 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
767 EXPECT_TRUE(page->viewportDescription().userZoom); | 727 EXPECT_TRUE(page->viewportDescription().userZoom); |
768 } | 728 } |
769 | 729 |
770 TEST_F(ViewportTest, viewport35) | 730 TEST_F(LegacyViewportTest, viewport35) |
771 { | 731 { |
772 UseMockScrollbarSettings mockScrollbarSettings; | |
773 registerMockedHttpURLLoad("viewport/viewport-35.html"); | 732 registerMockedHttpURLLoad("viewport/viewport-35.html"); |
774 | 733 |
775 FrameTestHelpers::WebViewHelper webViewHelper; | 734 FrameTestHelpers::WebViewHelper webViewHelper; |
776 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-35.html", tru e, 0, 0, setViewportSettings); | 735 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-35.html", tru e, 0, 0, setViewportSettings); |
777 | 736 |
778 Page* page = webViewHelper.webViewImpl()->page(); | 737 Page* page = webViewHelper.webViewImpl()->page(); |
779 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 738 PageScaleConstraints constraints = runTest(page, 320, 352); |
780 | 739 |
781 EXPECT_EQ(1280, constraints.layoutSize.width()); | 740 EXPECT_EQ(1280, constraints.layoutSize.width()); |
782 EXPECT_EQ(1408, constraints.layoutSize.height()); | 741 EXPECT_EQ(1408, constraints.layoutSize.height()); |
783 EXPECT_NEAR(0.25f, constraints.initialScale, 0.01f); | 742 EXPECT_NEAR(0.25f, constraints.initialScale, 0.01f); |
784 EXPECT_NEAR(0.25f, constraints.minimumScale, 0.01f); | 743 EXPECT_NEAR(0.25f, constraints.minimumScale, 0.01f); |
785 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 744 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
786 EXPECT_TRUE(page->viewportDescription().userZoom); | 745 EXPECT_TRUE(page->viewportDescription().userZoom); |
787 } | 746 } |
788 | 747 |
789 TEST_F(ViewportTest, viewport36) | 748 TEST_F(LegacyViewportTest, viewport36) |
790 { | 749 { |
791 UseMockScrollbarSettings mockScrollbarSettings; | |
792 registerMockedHttpURLLoad("viewport/viewport-36.html"); | 750 registerMockedHttpURLLoad("viewport/viewport-36.html"); |
793 | 751 |
794 FrameTestHelpers::WebViewHelper webViewHelper; | 752 FrameTestHelpers::WebViewHelper webViewHelper; |
795 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-36.html", tru e, 0, 0, setViewportSettings); | 753 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-36.html", tru e, 0, 0, setViewportSettings); |
796 | 754 |
797 Page* page = webViewHelper.webViewImpl()->page(); | 755 Page* page = webViewHelper.webViewImpl()->page(); |
798 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 756 PageScaleConstraints constraints = runTest(page, 320, 352); |
799 | 757 |
800 EXPECT_NEAR(636.36, constraints.layoutSize.width(), 0.01f); | 758 EXPECT_NEAR(636.36, constraints.layoutSize.width(), 0.01f); |
801 EXPECT_EQ(700, constraints.layoutSize.height()); | 759 EXPECT_EQ(700, constraints.layoutSize.height()); |
802 EXPECT_NEAR(1.6f, constraints.initialScale, 0.01f); | 760 EXPECT_NEAR(1.6f, constraints.initialScale, 0.01f); |
803 EXPECT_NEAR(0.50f, constraints.minimumScale, 0.01f); | 761 EXPECT_NEAR(0.50f, constraints.minimumScale, 0.01f); |
804 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 762 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
805 EXPECT_TRUE(page->viewportDescription().userZoom); | 763 EXPECT_TRUE(page->viewportDescription().userZoom); |
806 } | 764 } |
807 | 765 |
808 TEST_F(ViewportTest, viewport37) | 766 TEST_F(LegacyViewportTest, viewport37) |
809 { | 767 { |
810 UseMockScrollbarSettings mockScrollbarSettings; | |
811 registerMockedHttpURLLoad("viewport/viewport-37.html"); | 768 registerMockedHttpURLLoad("viewport/viewport-37.html"); |
812 | 769 |
813 FrameTestHelpers::WebViewHelper webViewHelper; | 770 FrameTestHelpers::WebViewHelper webViewHelper; |
814 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-37.html", tru e, 0, 0, setViewportSettings); | 771 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-37.html", tru e, 0, 0, setViewportSettings); |
815 | 772 |
816 Page* page = webViewHelper.webViewImpl()->page(); | 773 Page* page = webViewHelper.webViewImpl()->page(); |
817 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 774 PageScaleConstraints constraints = runTest(page, 320, 352); |
818 | 775 |
819 EXPECT_EQ(320, constraints.layoutSize.width()); | 776 EXPECT_EQ(320, constraints.layoutSize.width()); |
820 EXPECT_EQ(352, constraints.layoutSize.height()); | 777 EXPECT_EQ(352, constraints.layoutSize.height()); |
821 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); | 778 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); |
822 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); | 779 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); |
823 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 780 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
824 EXPECT_TRUE(page->viewportDescription().userZoom); | 781 EXPECT_TRUE(page->viewportDescription().userZoom); |
825 } | 782 } |
826 | 783 |
827 TEST_F(ViewportTest, viewport38) | 784 TEST_F(LegacyViewportTest, viewport38) |
828 { | 785 { |
829 UseMockScrollbarSettings mockScrollbarSettings; | |
830 registerMockedHttpURLLoad("viewport/viewport-38.html"); | 786 registerMockedHttpURLLoad("viewport/viewport-38.html"); |
831 | 787 |
832 FrameTestHelpers::WebViewHelper webViewHelper; | 788 FrameTestHelpers::WebViewHelper webViewHelper; |
833 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-38.html", tru e, 0, 0, setViewportSettings); | 789 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-38.html", tru e, 0, 0, setViewportSettings); |
834 | 790 |
835 Page* page = webViewHelper.webViewImpl()->page(); | 791 Page* page = webViewHelper.webViewImpl()->page(); |
836 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 792 PageScaleConstraints constraints = runTest(page, 320, 352); |
837 | 793 |
838 EXPECT_EQ(640, constraints.layoutSize.width()); | 794 EXPECT_EQ(640, constraints.layoutSize.width()); |
839 EXPECT_EQ(704, constraints.layoutSize.height()); | 795 EXPECT_EQ(704, constraints.layoutSize.height()); |
840 EXPECT_NEAR(0.5f, constraints.initialScale, 0.01f); | 796 EXPECT_NEAR(0.5f, constraints.initialScale, 0.01f); |
841 EXPECT_NEAR(0.5f, constraints.minimumScale, 0.01f); | 797 EXPECT_NEAR(0.5f, constraints.minimumScale, 0.01f); |
842 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 798 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
843 EXPECT_TRUE(page->viewportDescription().userZoom); | 799 EXPECT_TRUE(page->viewportDescription().userZoom); |
844 } | 800 } |
845 | 801 |
846 TEST_F(ViewportTest, viewport39) | 802 TEST_F(LegacyViewportTest, viewport39) |
847 { | 803 { |
848 UseMockScrollbarSettings mockScrollbarSettings; | |
849 registerMockedHttpURLLoad("viewport/viewport-39.html"); | 804 registerMockedHttpURLLoad("viewport/viewport-39.html"); |
850 | 805 |
851 FrameTestHelpers::WebViewHelper webViewHelper; | 806 FrameTestHelpers::WebViewHelper webViewHelper; |
852 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-39.html", tru e, 0, 0, setViewportSettings); | 807 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-39.html", tru e, 0, 0, setViewportSettings); |
853 | 808 |
854 Page* page = webViewHelper.webViewImpl()->page(); | 809 Page* page = webViewHelper.webViewImpl()->page(); |
855 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 810 PageScaleConstraints constraints = runTest(page, 320, 352); |
856 | 811 |
857 EXPECT_EQ(200, constraints.layoutSize.width()); | 812 EXPECT_EQ(200, constraints.layoutSize.width()); |
858 EXPECT_EQ(700, constraints.layoutSize.height()); | 813 EXPECT_EQ(700, constraints.layoutSize.height()); |
859 EXPECT_NEAR(1.6f, constraints.initialScale, 0.01f); | 814 EXPECT_NEAR(1.6f, constraints.initialScale, 0.01f); |
860 EXPECT_NEAR(1.6f, constraints.minimumScale, 0.01f); | 815 EXPECT_NEAR(1.6f, constraints.minimumScale, 0.01f); |
861 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 816 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
862 EXPECT_TRUE(page->viewportDescription().userZoom); | 817 EXPECT_TRUE(page->viewportDescription().userZoom); |
863 } | 818 } |
864 | 819 |
865 TEST_F(ViewportTest, viewport40) | 820 TEST_F(LegacyViewportTest, viewport40) |
866 { | 821 { |
867 UseMockScrollbarSettings mockScrollbarSettings; | |
868 registerMockedHttpURLLoad("viewport/viewport-40.html"); | 822 registerMockedHttpURLLoad("viewport/viewport-40.html"); |
869 | 823 |
870 FrameTestHelpers::WebViewHelper webViewHelper; | 824 FrameTestHelpers::WebViewHelper webViewHelper; |
871 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-40.html", tru e, 0, 0, setViewportSettings); | 825 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-40.html", tru e, 0, 0, setViewportSettings); |
872 | 826 |
873 Page* page = webViewHelper.webViewImpl()->page(); | 827 Page* page = webViewHelper.webViewImpl()->page(); |
874 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 828 PageScaleConstraints constraints = runTest(page, 320, 352); |
875 | 829 |
876 EXPECT_EQ(700, constraints.layoutSize.width()); | 830 EXPECT_EQ(700, constraints.layoutSize.width()); |
877 EXPECT_EQ(352, constraints.layoutSize.height()); | 831 EXPECT_EQ(352, constraints.layoutSize.height()); |
878 EXPECT_NEAR(0.46f, constraints.initialScale, 0.01f); | 832 EXPECT_NEAR(0.46f, constraints.initialScale, 0.01f); |
879 EXPECT_NEAR(0.46f, constraints.minimumScale, 0.01f); | 833 EXPECT_NEAR(0.46f, constraints.minimumScale, 0.01f); |
880 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 834 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
881 EXPECT_TRUE(page->viewportDescription().userZoom); | 835 EXPECT_TRUE(page->viewportDescription().userZoom); |
882 } | 836 } |
883 | 837 |
884 TEST_F(ViewportTest, viewport41) | 838 TEST_F(LegacyViewportTest, viewport41) |
885 { | 839 { |
886 UseMockScrollbarSettings mockScrollbarSettings; | |
887 registerMockedHttpURLLoad("viewport/viewport-41.html"); | 840 registerMockedHttpURLLoad("viewport/viewport-41.html"); |
888 | 841 |
889 FrameTestHelpers::WebViewHelper webViewHelper; | 842 FrameTestHelpers::WebViewHelper webViewHelper; |
890 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-41.html", tru e, 0, 0, setViewportSettings); | 843 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-41.html", tru e, 0, 0, setViewportSettings); |
891 | 844 |
892 Page* page = webViewHelper.webViewImpl()->page(); | 845 Page* page = webViewHelper.webViewImpl()->page(); |
893 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 846 PageScaleConstraints constraints = runTest(page, 320, 352); |
894 | 847 |
895 EXPECT_EQ(1000, constraints.layoutSize.width()); | 848 EXPECT_EQ(1000, constraints.layoutSize.width()); |
896 EXPECT_EQ(704, constraints.layoutSize.height()); | 849 EXPECT_EQ(704, constraints.layoutSize.height()); |
897 EXPECT_NEAR(0.5f, constraints.initialScale, 0.01f); | 850 EXPECT_NEAR(0.5f, constraints.initialScale, 0.01f); |
898 EXPECT_NEAR(0.32f, constraints.minimumScale, 0.01f); | 851 EXPECT_NEAR(0.32f, constraints.minimumScale, 0.01f); |
899 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 852 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
900 EXPECT_TRUE(page->viewportDescription().userZoom); | 853 EXPECT_TRUE(page->viewportDescription().userZoom); |
901 } | 854 } |
902 | 855 |
903 TEST_F(ViewportTest, viewport42) | 856 TEST_F(LegacyViewportTest, viewport42) |
904 { | 857 { |
905 UseMockScrollbarSettings mockScrollbarSettings; | |
906 registerMockedHttpURLLoad("viewport/viewport-42.html"); | 858 registerMockedHttpURLLoad("viewport/viewport-42.html"); |
907 | 859 |
908 FrameTestHelpers::WebViewHelper webViewHelper; | 860 FrameTestHelpers::WebViewHelper webViewHelper; |
909 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-42.html", tru e, 0, 0, setViewportSettings); | 861 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-42.html", tru e, 0, 0, setViewportSettings); |
910 | 862 |
911 Page* page = webViewHelper.webViewImpl()->page(); | 863 Page* page = webViewHelper.webViewImpl()->page(); |
912 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 864 PageScaleConstraints constraints = runTest(page, 320, 352); |
913 | 865 |
914 EXPECT_EQ(320, constraints.layoutSize.width()); | 866 EXPECT_EQ(320, constraints.layoutSize.width()); |
915 EXPECT_EQ(1000, constraints.layoutSize.height()); | 867 EXPECT_EQ(1000, constraints.layoutSize.height()); |
916 EXPECT_NEAR(2.0f, constraints.initialScale, 0.01f); | 868 EXPECT_NEAR(2.0f, constraints.initialScale, 0.01f); |
917 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); | 869 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); |
918 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 870 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
919 EXPECT_TRUE(page->viewportDescription().userZoom); | 871 EXPECT_TRUE(page->viewportDescription().userZoom); |
920 } | 872 } |
921 | 873 |
922 TEST_F(ViewportTest, viewport43) | 874 TEST_F(LegacyViewportTest, viewport43) |
923 { | 875 { |
924 UseMockScrollbarSettings mockScrollbarSettings; | |
925 registerMockedHttpURLLoad("viewport/viewport-43.html"); | 876 registerMockedHttpURLLoad("viewport/viewport-43.html"); |
926 | 877 |
927 FrameTestHelpers::WebViewHelper webViewHelper; | 878 FrameTestHelpers::WebViewHelper webViewHelper; |
928 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-43.html", tru e, 0, 0, setViewportSettings); | 879 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-43.html", tru e, 0, 0, setViewportSettings); |
929 | 880 |
930 Page* page = webViewHelper.webViewImpl()->page(); | 881 Page* page = webViewHelper.webViewImpl()->page(); |
931 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 882 PageScaleConstraints constraints = runTest(page, 320, 352); |
932 | 883 |
933 EXPECT_EQ(64, constraints.layoutSize.width()); | 884 EXPECT_EQ(64, constraints.layoutSize.width()); |
934 EXPECT_NEAR(70.4, constraints.layoutSize.height(), 0.01f); | 885 EXPECT_NEAR(70.4, constraints.layoutSize.height(), 0.01f); |
935 EXPECT_NEAR(5.0f, constraints.initialScale, 0.01f); | 886 EXPECT_NEAR(5.0f, constraints.initialScale, 0.01f); |
936 EXPECT_NEAR(5.0f, constraints.minimumScale, 0.01f); | 887 EXPECT_NEAR(5.0f, constraints.minimumScale, 0.01f); |
937 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 888 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
938 EXPECT_TRUE(page->viewportDescription().userZoom); | 889 EXPECT_TRUE(page->viewportDescription().userZoom); |
939 } | 890 } |
940 | 891 |
941 TEST_F(ViewportTest, viewport44) | 892 TEST_F(LegacyViewportTest, viewport44) |
942 { | 893 { |
943 UseMockScrollbarSettings mockScrollbarSettings; | |
944 registerMockedHttpURLLoad("viewport/viewport-44.html"); | 894 registerMockedHttpURLLoad("viewport/viewport-44.html"); |
945 | 895 |
946 FrameTestHelpers::WebViewHelper webViewHelper; | 896 FrameTestHelpers::WebViewHelper webViewHelper; |
947 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-44.html", tru e, 0, 0, setViewportSettings); | 897 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-44.html", tru e, 0, 0, setViewportSettings); |
948 | 898 |
949 Page* page = webViewHelper.webViewImpl()->page(); | 899 Page* page = webViewHelper.webViewImpl()->page(); |
950 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 900 PageScaleConstraints constraints = runTest(page, 320, 352); |
951 | 901 |
952 EXPECT_EQ(10000, constraints.layoutSize.width()); | 902 EXPECT_EQ(10000, constraints.layoutSize.width()); |
953 EXPECT_EQ(10000, constraints.layoutSize.height()); | 903 EXPECT_EQ(10000, constraints.layoutSize.height()); |
954 EXPECT_NEAR(0.25f, constraints.initialScale, 0.01f); | 904 EXPECT_NEAR(0.25f, constraints.initialScale, 0.01f); |
955 EXPECT_NEAR(0.25f, constraints.minimumScale, 0.01f); | 905 EXPECT_NEAR(0.25f, constraints.minimumScale, 0.01f); |
956 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 906 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
957 EXPECT_TRUE(page->viewportDescription().userZoom); | 907 EXPECT_TRUE(page->viewportDescription().userZoom); |
958 } | 908 } |
959 | 909 |
960 TEST_F(ViewportTest, viewport45) | 910 TEST_F(LegacyViewportTest, viewport45) |
961 { | 911 { |
962 UseMockScrollbarSettings mockScrollbarSettings; | |
963 registerMockedHttpURLLoad("viewport/viewport-45.html"); | 912 registerMockedHttpURLLoad("viewport/viewport-45.html"); |
964 | 913 |
965 FrameTestHelpers::WebViewHelper webViewHelper; | 914 FrameTestHelpers::WebViewHelper webViewHelper; |
966 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-45.html", tru e, 0, 0, setViewportSettings); | 915 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-45.html", tru e, 0, 0, setViewportSettings); |
967 | 916 |
968 Page* page = webViewHelper.webViewImpl()->page(); | 917 Page* page = webViewHelper.webViewImpl()->page(); |
969 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 918 PageScaleConstraints constraints = runTest(page, 320, 352); |
970 | 919 |
971 EXPECT_EQ(3200, constraints.layoutSize.width()); | 920 EXPECT_EQ(3200, constraints.layoutSize.width()); |
972 EXPECT_EQ(3520, constraints.layoutSize.height()); | 921 EXPECT_EQ(3520, constraints.layoutSize.height()); |
973 EXPECT_NEAR(0.1f, constraints.initialScale, 0.01f); | 922 EXPECT_NEAR(0.1f, constraints.initialScale, 0.01f); |
974 EXPECT_NEAR(0.1f, constraints.minimumScale, 0.01f); | 923 EXPECT_NEAR(0.1f, constraints.minimumScale, 0.01f); |
975 EXPECT_NEAR(0.1f, constraints.maximumScale, 0.01f); | 924 EXPECT_NEAR(0.1f, constraints.maximumScale, 0.01f); |
976 EXPECT_TRUE(page->viewportDescription().userZoom); | 925 EXPECT_TRUE(page->viewportDescription().userZoom); |
977 } | 926 } |
978 | 927 |
979 TEST_F(ViewportTest, viewport46) | 928 TEST_F(LegacyViewportTest, viewport46) |
980 { | 929 { |
981 UseMockScrollbarSettings mockScrollbarSettings; | |
982 registerMockedHttpURLLoad("viewport/viewport-46.html"); | 930 registerMockedHttpURLLoad("viewport/viewport-46.html"); |
983 | 931 |
984 FrameTestHelpers::WebViewHelper webViewHelper; | 932 FrameTestHelpers::WebViewHelper webViewHelper; |
985 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-46.html", tru e, 0, 0, setViewportSettings); | 933 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-46.html", tru e, 0, 0, setViewportSettings); |
986 | 934 |
987 Page* page = webViewHelper.webViewImpl()->page(); | 935 Page* page = webViewHelper.webViewImpl()->page(); |
988 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 936 PageScaleConstraints constraints = runTest(page, 320, 352); |
989 | 937 |
990 EXPECT_EQ(32, constraints.layoutSize.width()); | 938 EXPECT_EQ(32, constraints.layoutSize.width()); |
991 EXPECT_NEAR(35.2, constraints.layoutSize.height(), 0.01f); | 939 EXPECT_NEAR(35.2, constraints.layoutSize.height(), 0.01f); |
992 EXPECT_NEAR(10.0f, constraints.initialScale, 0.01f); | 940 EXPECT_NEAR(10.0f, constraints.initialScale, 0.01f); |
993 EXPECT_NEAR(10.0f, constraints.minimumScale, 0.01f); | 941 EXPECT_NEAR(10.0f, constraints.minimumScale, 0.01f); |
994 EXPECT_NEAR(10.0f, constraints.maximumScale, 0.01f); | 942 EXPECT_NEAR(10.0f, constraints.maximumScale, 0.01f); |
995 EXPECT_TRUE(page->viewportDescription().userZoom); | 943 EXPECT_TRUE(page->viewportDescription().userZoom); |
996 } | 944 } |
997 | 945 |
998 TEST_F(ViewportTest, viewport47) | 946 TEST_F(LegacyViewportTest, viewport47) |
999 { | 947 { |
1000 UseMockScrollbarSettings mockScrollbarSettings; | |
1001 registerMockedHttpURLLoad("viewport/viewport-47.html"); | 948 registerMockedHttpURLLoad("viewport/viewport-47.html"); |
1002 | 949 |
1003 FrameTestHelpers::WebViewHelper webViewHelper; | 950 FrameTestHelpers::WebViewHelper webViewHelper; |
1004 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-47.html", tru e, 0, 0, setViewportSettings); | 951 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-47.html", tru e, 0, 0, setViewportSettings); |
1005 | 952 |
1006 Page* page = webViewHelper.webViewImpl()->page(); | 953 Page* page = webViewHelper.webViewImpl()->page(); |
1007 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 954 PageScaleConstraints constraints = runTest(page, 320, 352); |
1008 | 955 |
1009 EXPECT_EQ(320, constraints.layoutSize.width()); | 956 EXPECT_EQ(320, constraints.layoutSize.width()); |
1010 EXPECT_EQ(3000, constraints.layoutSize.height()); | 957 EXPECT_EQ(3000, constraints.layoutSize.height()); |
1011 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); | 958 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); |
1012 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); | 959 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); |
1013 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 960 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
1014 EXPECT_TRUE(page->viewportDescription().userZoom); | 961 EXPECT_TRUE(page->viewportDescription().userZoom); |
1015 } | 962 } |
1016 | 963 |
1017 TEST_F(ViewportTest, viewport48) | 964 TEST_F(LegacyViewportTest, viewport48) |
1018 { | 965 { |
1019 UseMockScrollbarSettings mockScrollbarSettings; | |
1020 registerMockedHttpURLLoad("viewport/viewport-48.html"); | 966 registerMockedHttpURLLoad("viewport/viewport-48.html"); |
1021 | 967 |
1022 FrameTestHelpers::WebViewHelper webViewHelper; | 968 FrameTestHelpers::WebViewHelper webViewHelper; |
1023 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-48.html", tru e, 0, 0, setViewportSettings); | 969 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-48.html", tru e, 0, 0, setViewportSettings); |
1024 | 970 |
1025 Page* page = webViewHelper.webViewImpl()->page(); | 971 Page* page = webViewHelper.webViewImpl()->page(); |
1026 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 972 PageScaleConstraints constraints = runTest(page, 320, 352); |
1027 | 973 |
1028 EXPECT_EQ(3000, constraints.layoutSize.width()); | 974 EXPECT_EQ(3000, constraints.layoutSize.width()); |
1029 EXPECT_EQ(352, constraints.layoutSize.height()); | 975 EXPECT_EQ(352, constraints.layoutSize.height()); |
1030 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); | 976 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); |
1031 EXPECT_NEAR(0.25f, constraints.minimumScale, 0.01f); | 977 EXPECT_NEAR(0.25f, constraints.minimumScale, 0.01f); |
1032 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 978 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
1033 EXPECT_TRUE(page->viewportDescription().userZoom); | 979 EXPECT_TRUE(page->viewportDescription().userZoom); |
1034 } | 980 } |
1035 | 981 |
1036 TEST_F(ViewportTest, viewport49) | 982 TEST_F(LegacyViewportTest, viewport49) |
1037 { | 983 { |
1038 UseMockScrollbarSettings mockScrollbarSettings; | |
1039 registerMockedHttpURLLoad("viewport/viewport-49.html"); | 984 registerMockedHttpURLLoad("viewport/viewport-49.html"); |
1040 | 985 |
1041 FrameTestHelpers::WebViewHelper webViewHelper; | 986 FrameTestHelpers::WebViewHelper webViewHelper; |
1042 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-49.html", tru e, 0, 0, setViewportSettings); | 987 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-49.html", tru e, 0, 0, setViewportSettings); |
1043 | 988 |
1044 Page* page = webViewHelper.webViewImpl()->page(); | 989 Page* page = webViewHelper.webViewImpl()->page(); |
1045 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 990 PageScaleConstraints constraints = runTest(page, 320, 352); |
1046 | 991 |
1047 EXPECT_EQ(320, constraints.layoutSize.width()); | 992 EXPECT_EQ(320, constraints.layoutSize.width()); |
1048 EXPECT_EQ(352, constraints.layoutSize.height()); | 993 EXPECT_EQ(352, constraints.layoutSize.height()); |
1049 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); | 994 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); |
1050 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); | 995 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); |
1051 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 996 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
1052 EXPECT_TRUE(page->viewportDescription().userZoom); | 997 EXPECT_TRUE(page->viewportDescription().userZoom); |
1053 } | 998 } |
1054 | 999 |
1055 TEST_F(ViewportTest, viewport50) | 1000 TEST_F(LegacyViewportTest, viewport50) |
1056 { | 1001 { |
1057 UseMockScrollbarSettings mockScrollbarSettings; | |
1058 registerMockedHttpURLLoad("viewport/viewport-50.html"); | 1002 registerMockedHttpURLLoad("viewport/viewport-50.html"); |
1059 | 1003 |
1060 FrameTestHelpers::WebViewHelper webViewHelper; | 1004 FrameTestHelpers::WebViewHelper webViewHelper; |
1061 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-50.html", tru e, 0, 0, setViewportSettings); | 1005 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-50.html", tru e, 0, 0, setViewportSettings); |
1062 | 1006 |
1063 Page* page = webViewHelper.webViewImpl()->page(); | 1007 Page* page = webViewHelper.webViewImpl()->page(); |
1064 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 1008 PageScaleConstraints constraints = runTest(page, 320, 352); |
1065 | 1009 |
1066 EXPECT_EQ(980, constraints.layoutSize.width()); | 1010 EXPECT_EQ(980, constraints.layoutSize.width()); |
1067 EXPECT_EQ(1078, constraints.layoutSize.height()); | 1011 EXPECT_EQ(1078, constraints.layoutSize.height()); |
1068 EXPECT_NEAR(0.33f, constraints.initialScale, 0.01f); | 1012 EXPECT_NEAR(0.33f, constraints.initialScale, 0.01f); |
1069 EXPECT_NEAR(0.33f, constraints.minimumScale, 0.01f); | 1013 EXPECT_NEAR(0.33f, constraints.minimumScale, 0.01f); |
1070 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 1014 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
1071 EXPECT_TRUE(page->viewportDescription().userZoom); | 1015 EXPECT_TRUE(page->viewportDescription().userZoom); |
1072 } | 1016 } |
1073 | 1017 |
1074 TEST_F(ViewportTest, viewport51) | 1018 TEST_F(LegacyViewportTest, viewport51) |
1075 { | 1019 { |
1076 UseMockScrollbarSettings mockScrollbarSettings; | |
1077 registerMockedHttpURLLoad("viewport/viewport-51.html"); | 1020 registerMockedHttpURLLoad("viewport/viewport-51.html"); |
1078 | 1021 |
1079 FrameTestHelpers::WebViewHelper webViewHelper; | 1022 FrameTestHelpers::WebViewHelper webViewHelper; |
1080 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-51.html", tru e, 0, 0, setViewportSettings); | 1023 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-51.html", tru e, 0, 0, setViewportSettings); |
1081 | 1024 |
1082 Page* page = webViewHelper.webViewImpl()->page(); | 1025 Page* page = webViewHelper.webViewImpl()->page(); |
1083 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 1026 PageScaleConstraints constraints = runTest(page, 320, 352); |
1084 | 1027 |
1085 EXPECT_EQ(980, constraints.layoutSize.width()); | 1028 EXPECT_EQ(980, constraints.layoutSize.width()); |
1086 EXPECT_EQ(1078, constraints.layoutSize.height()); | 1029 EXPECT_EQ(1078, constraints.layoutSize.height()); |
1087 EXPECT_NEAR(0.33f, constraints.initialScale, 0.01f); | 1030 EXPECT_NEAR(0.33f, constraints.initialScale, 0.01f); |
1088 EXPECT_NEAR(0.33f, constraints.minimumScale, 0.01f); | 1031 EXPECT_NEAR(0.33f, constraints.minimumScale, 0.01f); |
1089 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 1032 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
1090 EXPECT_TRUE(page->viewportDescription().userZoom); | 1033 EXPECT_TRUE(page->viewportDescription().userZoom); |
1091 } | 1034 } |
1092 | 1035 |
1093 TEST_F(ViewportTest, viewport52) | 1036 TEST_F(LegacyViewportTest, viewport52) |
1094 { | 1037 { |
1095 UseMockScrollbarSettings mockScrollbarSettings; | |
1096 registerMockedHttpURLLoad("viewport/viewport-52.html"); | 1038 registerMockedHttpURLLoad("viewport/viewport-52.html"); |
1097 | 1039 |
1098 FrameTestHelpers::WebViewHelper webViewHelper; | 1040 FrameTestHelpers::WebViewHelper webViewHelper; |
1099 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-52.html", tru e, 0, 0, setViewportSettings); | 1041 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-52.html", tru e, 0, 0, setViewportSettings); |
1100 | 1042 |
1101 Page* page = webViewHelper.webViewImpl()->page(); | 1043 Page* page = webViewHelper.webViewImpl()->page(); |
1102 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 1044 PageScaleConstraints constraints = runTest(page, 320, 352); |
1103 | 1045 |
1104 EXPECT_EQ(64, constraints.layoutSize.width()); | 1046 EXPECT_EQ(64, constraints.layoutSize.width()); |
1105 EXPECT_NEAR(70.4, constraints.layoutSize.height(), 0.01f); | 1047 EXPECT_NEAR(70.4, constraints.layoutSize.height(), 0.01f); |
1106 EXPECT_NEAR(5.0f, constraints.initialScale, 0.01f); | 1048 EXPECT_NEAR(5.0f, constraints.initialScale, 0.01f); |
1107 EXPECT_NEAR(5.0f, constraints.minimumScale, 0.01f); | 1049 EXPECT_NEAR(5.0f, constraints.minimumScale, 0.01f); |
1108 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 1050 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
1109 EXPECT_TRUE(page->viewportDescription().userZoom); | 1051 EXPECT_TRUE(page->viewportDescription().userZoom); |
1110 } | 1052 } |
1111 | 1053 |
1112 TEST_F(ViewportTest, viewport53) | 1054 TEST_F(LegacyViewportTest, viewport53) |
1113 { | 1055 { |
1114 UseMockScrollbarSettings mockScrollbarSettings; | |
1115 registerMockedHttpURLLoad("viewport/viewport-53.html"); | 1056 registerMockedHttpURLLoad("viewport/viewport-53.html"); |
1116 | 1057 |
1117 FrameTestHelpers::WebViewHelper webViewHelper; | 1058 FrameTestHelpers::WebViewHelper webViewHelper; |
1118 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-53.html", tru e, 0, 0, setViewportSettings); | 1059 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-53.html", tru e, 0, 0, setViewportSettings); |
1119 | 1060 |
1120 Page* page = webViewHelper.webViewImpl()->page(); | 1061 Page* page = webViewHelper.webViewImpl()->page(); |
1121 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 1062 PageScaleConstraints constraints = runTest(page, 320, 352); |
1122 | 1063 |
1123 EXPECT_EQ(980, constraints.layoutSize.width()); | 1064 EXPECT_EQ(980, constraints.layoutSize.width()); |
1124 EXPECT_NEAR(70.4, constraints.layoutSize.height(), 0.01f); | 1065 EXPECT_NEAR(70.4, constraints.layoutSize.height(), 0.01f); |
1125 EXPECT_NEAR(0.33f, constraints.initialScale, 0.01f); | 1066 EXPECT_NEAR(0.33f, constraints.initialScale, 0.01f); |
1126 EXPECT_NEAR(0.33f, constraints.minimumScale, 0.01f); | 1067 EXPECT_NEAR(0.33f, constraints.minimumScale, 0.01f); |
1127 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 1068 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
1128 EXPECT_TRUE(page->viewportDescription().userZoom); | 1069 EXPECT_TRUE(page->viewportDescription().userZoom); |
1129 } | 1070 } |
1130 | 1071 |
1131 TEST_F(ViewportTest, viewport54) | 1072 TEST_F(LegacyViewportTest, viewport54) |
1132 { | 1073 { |
1133 UseMockScrollbarSettings mockScrollbarSettings; | |
1134 registerMockedHttpURLLoad("viewport/viewport-54.html"); | 1074 registerMockedHttpURLLoad("viewport/viewport-54.html"); |
1135 | 1075 |
1136 FrameTestHelpers::WebViewHelper webViewHelper; | 1076 FrameTestHelpers::WebViewHelper webViewHelper; |
1137 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-54.html", tru e, 0, 0, setViewportSettings); | 1077 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-54.html", tru e, 0, 0, setViewportSettings); |
1138 | 1078 |
1139 Page* page = webViewHelper.webViewImpl()->page(); | 1079 Page* page = webViewHelper.webViewImpl()->page(); |
1140 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 1080 PageScaleConstraints constraints = runTest(page, 320, 352); |
1141 | 1081 |
1142 EXPECT_EQ(64, constraints.layoutSize.width()); | 1082 EXPECT_EQ(64, constraints.layoutSize.width()); |
1143 EXPECT_NEAR(70.4, constraints.layoutSize.height(), 0.01f); | 1083 EXPECT_NEAR(70.4, constraints.layoutSize.height(), 0.01f); |
1144 EXPECT_NEAR(5.0f, constraints.initialScale, 0.01f); | 1084 EXPECT_NEAR(5.0f, constraints.initialScale, 0.01f); |
1145 EXPECT_NEAR(5.0f, constraints.minimumScale, 0.01f); | 1085 EXPECT_NEAR(5.0f, constraints.minimumScale, 0.01f); |
1146 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 1086 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
1147 EXPECT_TRUE(page->viewportDescription().userZoom); | 1087 EXPECT_TRUE(page->viewportDescription().userZoom); |
1148 } | 1088 } |
1149 | 1089 |
1150 TEST_F(ViewportTest, viewport55) | 1090 TEST_F(LegacyViewportTest, viewport55) |
1151 { | 1091 { |
1152 UseMockScrollbarSettings mockScrollbarSettings; | |
1153 registerMockedHttpURLLoad("viewport/viewport-55.html"); | 1092 registerMockedHttpURLLoad("viewport/viewport-55.html"); |
1154 | 1093 |
1155 FrameTestHelpers::WebViewHelper webViewHelper; | 1094 FrameTestHelpers::WebViewHelper webViewHelper; |
1156 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-55.html", tru e, 0, 0, setViewportSettings); | 1095 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-55.html", tru e, 0, 0, setViewportSettings); |
1157 | 1096 |
1158 Page* page = webViewHelper.webViewImpl()->page(); | 1097 Page* page = webViewHelper.webViewImpl()->page(); |
1159 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 1098 PageScaleConstraints constraints = runTest(page, 320, 352); |
1160 | 1099 |
1161 EXPECT_EQ(64, constraints.layoutSize.width()); | 1100 EXPECT_EQ(64, constraints.layoutSize.width()); |
1162 EXPECT_NEAR(70.4, constraints.layoutSize.height(), 0.01f); | 1101 EXPECT_NEAR(70.4, constraints.layoutSize.height(), 0.01f); |
1163 EXPECT_NEAR(5.0f, constraints.initialScale, 0.01f); | 1102 EXPECT_NEAR(5.0f, constraints.initialScale, 0.01f); |
1164 EXPECT_NEAR(5.0f, constraints.minimumScale, 0.01f); | 1103 EXPECT_NEAR(5.0f, constraints.minimumScale, 0.01f); |
1165 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 1104 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
1166 EXPECT_TRUE(page->viewportDescription().userZoom); | 1105 EXPECT_TRUE(page->viewportDescription().userZoom); |
1167 } | 1106 } |
1168 | 1107 |
1169 TEST_F(ViewportTest, viewport56) | 1108 TEST_F(LegacyViewportTest, viewport56) |
1170 { | 1109 { |
1171 UseMockScrollbarSettings mockScrollbarSettings; | |
1172 registerMockedHttpURLLoad("viewport/viewport-56.html"); | 1110 registerMockedHttpURLLoad("viewport/viewport-56.html"); |
1173 | 1111 |
1174 FrameTestHelpers::WebViewHelper webViewHelper; | 1112 FrameTestHelpers::WebViewHelper webViewHelper; |
1175 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-56.html", tru e, 0, 0, setViewportSettings); | 1113 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-56.html", tru e, 0, 0, setViewportSettings); |
1176 | 1114 |
1177 Page* page = webViewHelper.webViewImpl()->page(); | 1115 Page* page = webViewHelper.webViewImpl()->page(); |
1178 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 1116 PageScaleConstraints constraints = runTest(page, 320, 352); |
1179 | 1117 |
1180 EXPECT_EQ(980, constraints.layoutSize.width()); | 1118 EXPECT_EQ(980, constraints.layoutSize.width()); |
1181 EXPECT_EQ(1078, constraints.layoutSize.height()); | 1119 EXPECT_EQ(1078, constraints.layoutSize.height()); |
1182 EXPECT_NEAR(0.33f, constraints.initialScale, 0.01f); | 1120 EXPECT_NEAR(0.33f, constraints.initialScale, 0.01f); |
1183 EXPECT_NEAR(0.33f, constraints.minimumScale, 0.01f); | 1121 EXPECT_NEAR(0.33f, constraints.minimumScale, 0.01f); |
1184 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 1122 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
1185 EXPECT_TRUE(page->viewportDescription().userZoom); | 1123 EXPECT_TRUE(page->viewportDescription().userZoom); |
1186 } | 1124 } |
1187 | 1125 |
1188 TEST_F(ViewportTest, viewport57) | 1126 TEST_F(LegacyViewportTest, viewport57) |
1189 { | 1127 { |
1190 UseMockScrollbarSettings mockScrollbarSettings; | |
1191 registerMockedHttpURLLoad("viewport/viewport-57.html"); | 1128 registerMockedHttpURLLoad("viewport/viewport-57.html"); |
1192 | 1129 |
1193 FrameTestHelpers::WebViewHelper webViewHelper; | 1130 FrameTestHelpers::WebViewHelper webViewHelper; |
1194 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-57.html", tru e, 0, 0, setViewportSettings); | 1131 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-57.html", tru e, 0, 0, setViewportSettings); |
1195 | 1132 |
1196 Page* page = webViewHelper.webViewImpl()->page(); | 1133 Page* page = webViewHelper.webViewImpl()->page(); |
1197 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 1134 PageScaleConstraints constraints = runTest(page, 320, 352); |
1198 | 1135 |
1199 EXPECT_EQ(320, constraints.layoutSize.width()); | 1136 EXPECT_EQ(320, constraints.layoutSize.width()); |
1200 EXPECT_EQ(352, constraints.layoutSize.height()); | 1137 EXPECT_EQ(352, constraints.layoutSize.height()); |
1201 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); | 1138 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); |
1202 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); | 1139 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); |
1203 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 1140 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
1204 EXPECT_TRUE(page->viewportDescription().userZoom); | 1141 EXPECT_TRUE(page->viewportDescription().userZoom); |
1205 } | 1142 } |
1206 | 1143 |
1207 TEST_F(ViewportTest, viewport58) | 1144 TEST_F(LegacyViewportTest, viewport58) |
1208 { | 1145 { |
1209 UseMockScrollbarSettings mockScrollbarSettings; | |
1210 registerMockedHttpURLLoad("viewport/viewport-58.html"); | 1146 registerMockedHttpURLLoad("viewport/viewport-58.html"); |
1211 | 1147 |
1212 FrameTestHelpers::WebViewHelper webViewHelper; | 1148 FrameTestHelpers::WebViewHelper webViewHelper; |
1213 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-58.html", tru e, 0, 0, setViewportSettings); | 1149 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-58.html", tru e, 0, 0, setViewportSettings); |
1214 | 1150 |
1215 Page* page = webViewHelper.webViewImpl()->page(); | 1151 Page* page = webViewHelper.webViewImpl()->page(); |
1216 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 1152 PageScaleConstraints constraints = runTest(page, 320, 352); |
1217 | 1153 |
1218 EXPECT_EQ(3200, constraints.layoutSize.width()); | 1154 EXPECT_EQ(3200, constraints.layoutSize.width()); |
1219 EXPECT_EQ(3520, constraints.layoutSize.height()); | 1155 EXPECT_EQ(3520, constraints.layoutSize.height()); |
1220 EXPECT_NEAR(0.1f, constraints.initialScale, 0.01f); | 1156 EXPECT_NEAR(0.1f, constraints.initialScale, 0.01f); |
1221 EXPECT_NEAR(0.1f, constraints.minimumScale, 0.01f); | 1157 EXPECT_NEAR(0.1f, constraints.minimumScale, 0.01f); |
1222 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 1158 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
1223 EXPECT_TRUE(page->viewportDescription().userZoom); | 1159 EXPECT_TRUE(page->viewportDescription().userZoom); |
1224 } | 1160 } |
1225 | 1161 |
1226 TEST_F(ViewportTest, viewport59) | 1162 TEST_F(LegacyViewportTest, viewport59) |
1227 { | 1163 { |
1228 UseMockScrollbarSettings mockScrollbarSettings; | |
1229 registerMockedHttpURLLoad("viewport/viewport-59.html"); | 1164 registerMockedHttpURLLoad("viewport/viewport-59.html"); |
1230 | 1165 |
1231 FrameTestHelpers::WebViewHelper webViewHelper; | 1166 FrameTestHelpers::WebViewHelper webViewHelper; |
1232 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-59.html", tru e, 0, 0, setViewportSettings); | 1167 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-59.html", tru e, 0, 0, setViewportSettings); |
1233 | 1168 |
1234 Page* page = webViewHelper.webViewImpl()->page(); | 1169 Page* page = webViewHelper.webViewImpl()->page(); |
1235 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 1170 PageScaleConstraints constraints = runTest(page, 320, 352); |
1236 | 1171 |
1237 EXPECT_EQ(320, constraints.layoutSize.width()); | 1172 EXPECT_EQ(320, constraints.layoutSize.width()); |
1238 EXPECT_EQ(352, constraints.layoutSize.height()); | 1173 EXPECT_EQ(352, constraints.layoutSize.height()); |
1239 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); | 1174 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); |
1240 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); | 1175 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); |
1241 EXPECT_NEAR(1.0f, constraints.maximumScale, 0.01f); | 1176 EXPECT_NEAR(1.0f, constraints.maximumScale, 0.01f); |
1242 EXPECT_TRUE(page->viewportDescription().userZoom); | 1177 EXPECT_TRUE(page->viewportDescription().userZoom); |
1243 } | 1178 } |
1244 | 1179 |
1245 TEST_F(ViewportTest, viewport60) | 1180 TEST_F(LegacyViewportTest, viewport60) |
1246 { | 1181 { |
1247 UseMockScrollbarSettings mockScrollbarSettings; | |
1248 registerMockedHttpURLLoad("viewport/viewport-60.html"); | 1182 registerMockedHttpURLLoad("viewport/viewport-60.html"); |
1249 | 1183 |
1250 FrameTestHelpers::WebViewHelper webViewHelper; | 1184 FrameTestHelpers::WebViewHelper webViewHelper; |
1251 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-60.html", tru e, 0, 0, setViewportSettings); | 1185 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-60.html", tru e, 0, 0, setViewportSettings); |
1252 | 1186 |
1253 Page* page = webViewHelper.webViewImpl()->page(); | 1187 Page* page = webViewHelper.webViewImpl()->page(); |
1254 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 1188 PageScaleConstraints constraints = runTest(page, 320, 352); |
1255 | 1189 |
1256 EXPECT_EQ(32, constraints.layoutSize.width()); | 1190 EXPECT_EQ(32, constraints.layoutSize.width()); |
1257 EXPECT_NEAR(35.2, constraints.layoutSize.height(), 0.01f); | 1191 EXPECT_NEAR(35.2, constraints.layoutSize.height(), 0.01f); |
1258 EXPECT_NEAR(10.0f, constraints.initialScale, 0.01f); | 1192 EXPECT_NEAR(10.0f, constraints.initialScale, 0.01f); |
1259 EXPECT_NEAR(10.0f, constraints.minimumScale, 0.01f); | 1193 EXPECT_NEAR(10.0f, constraints.minimumScale, 0.01f); |
1260 EXPECT_NEAR(10.0f, constraints.maximumScale, 0.01f); | 1194 EXPECT_NEAR(10.0f, constraints.maximumScale, 0.01f); |
1261 EXPECT_TRUE(page->viewportDescription().userZoom); | 1195 EXPECT_TRUE(page->viewportDescription().userZoom); |
1262 } | 1196 } |
1263 | 1197 |
1264 TEST_F(ViewportTest, viewport61) | 1198 TEST_F(LegacyViewportTest, viewport61) |
1265 { | 1199 { |
1266 UseMockScrollbarSettings mockScrollbarSettings; | |
1267 registerMockedHttpURLLoad("viewport/viewport-61.html"); | 1200 registerMockedHttpURLLoad("viewport/viewport-61.html"); |
1268 | 1201 |
1269 FrameTestHelpers::WebViewHelper webViewHelper; | 1202 FrameTestHelpers::WebViewHelper webViewHelper; |
1270 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-61.html", tru e, 0, 0, setViewportSettings); | 1203 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-61.html", tru e, 0, 0, setViewportSettings); |
1271 | 1204 |
1272 Page* page = webViewHelper.webViewImpl()->page(); | 1205 Page* page = webViewHelper.webViewImpl()->page(); |
1273 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 1206 PageScaleConstraints constraints = runTest(page, 320, 352); |
1274 | 1207 |
1275 EXPECT_EQ(320, constraints.layoutSize.width()); | 1208 EXPECT_EQ(320, constraints.layoutSize.width()); |
1276 EXPECT_EQ(352, constraints.layoutSize.height()); | 1209 EXPECT_EQ(352, constraints.layoutSize.height()); |
1277 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); | 1210 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); |
1278 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); | 1211 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); |
1279 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 1212 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
1280 EXPECT_TRUE(page->viewportDescription().userZoom); | 1213 EXPECT_TRUE(page->viewportDescription().userZoom); |
1281 } | 1214 } |
1282 | 1215 |
1283 TEST_F(ViewportTest, viewport62) | 1216 TEST_F(LegacyViewportTest, viewport62) |
1284 { | 1217 { |
1285 UseMockScrollbarSettings mockScrollbarSettings; | |
1286 registerMockedHttpURLLoad("viewport/viewport-62.html"); | 1218 registerMockedHttpURLLoad("viewport/viewport-62.html"); |
1287 | 1219 |
1288 FrameTestHelpers::WebViewHelper webViewHelper; | 1220 FrameTestHelpers::WebViewHelper webViewHelper; |
1289 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-62.html", tru e, 0, 0, setViewportSettings); | 1221 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-62.html", tru e, 0, 0, setViewportSettings); |
1290 | 1222 |
1291 Page* page = webViewHelper.webViewImpl()->page(); | 1223 Page* page = webViewHelper.webViewImpl()->page(); |
1292 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 1224 PageScaleConstraints constraints = runTest(page, 320, 352); |
1293 | 1225 |
1294 EXPECT_EQ(320, constraints.layoutSize.width()); | 1226 EXPECT_EQ(320, constraints.layoutSize.width()); |
1295 EXPECT_EQ(352, constraints.layoutSize.height()); | 1227 EXPECT_EQ(352, constraints.layoutSize.height()); |
1296 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); | 1228 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); |
1297 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); | 1229 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); |
1298 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 1230 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
1299 EXPECT_TRUE(page->viewportDescription().userZoom); | 1231 EXPECT_TRUE(page->viewportDescription().userZoom); |
1300 } | 1232 } |
1301 | 1233 |
1302 TEST_F(ViewportTest, viewport63) | 1234 TEST_F(LegacyViewportTest, viewport63) |
1303 { | 1235 { |
1304 UseMockScrollbarSettings mockScrollbarSettings; | |
1305 registerMockedHttpURLLoad("viewport/viewport-63.html"); | 1236 registerMockedHttpURLLoad("viewport/viewport-63.html"); |
1306 | 1237 |
1307 FrameTestHelpers::WebViewHelper webViewHelper; | 1238 FrameTestHelpers::WebViewHelper webViewHelper; |
1308 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-63.html", tru e, 0, 0, setViewportSettings); | 1239 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-63.html", tru e, 0, 0, setViewportSettings); |
1309 | 1240 |
1310 Page* page = webViewHelper.webViewImpl()->page(); | 1241 Page* page = webViewHelper.webViewImpl()->page(); |
1311 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 1242 PageScaleConstraints constraints = runTest(page, 320, 352); |
1312 | 1243 |
1313 EXPECT_EQ(320, constraints.layoutSize.width()); | 1244 EXPECT_EQ(320, constraints.layoutSize.width()); |
1314 EXPECT_EQ(352, constraints.layoutSize.height()); | 1245 EXPECT_EQ(352, constraints.layoutSize.height()); |
1315 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); | 1246 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); |
1316 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); | 1247 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); |
1317 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 1248 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
1318 EXPECT_TRUE(page->viewportDescription().userZoom); | 1249 EXPECT_TRUE(page->viewportDescription().userZoom); |
1319 } | 1250 } |
1320 | 1251 |
1321 TEST_F(ViewportTest, viewport64) | 1252 TEST_F(LegacyViewportTest, viewport64) |
1322 { | 1253 { |
1323 UseMockScrollbarSettings mockScrollbarSettings; | |
1324 registerMockedHttpURLLoad("viewport/viewport-64.html"); | 1254 registerMockedHttpURLLoad("viewport/viewport-64.html"); |
1325 | 1255 |
1326 FrameTestHelpers::WebViewHelper webViewHelper; | 1256 FrameTestHelpers::WebViewHelper webViewHelper; |
1327 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-64.html", tru e, 0, 0, setViewportSettings); | 1257 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-64.html", tru e, 0, 0, setViewportSettings); |
1328 | 1258 |
1329 Page* page = webViewHelper.webViewImpl()->page(); | 1259 Page* page = webViewHelper.webViewImpl()->page(); |
1330 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 1260 PageScaleConstraints constraints = runTest(page, 320, 352); |
1331 | 1261 |
1332 EXPECT_EQ(320, constraints.layoutSize.width()); | 1262 EXPECT_EQ(320, constraints.layoutSize.width()); |
1333 EXPECT_EQ(352, constraints.layoutSize.height()); | 1263 EXPECT_EQ(352, constraints.layoutSize.height()); |
1334 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); | 1264 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); |
1335 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); | 1265 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); |
1336 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 1266 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
1337 EXPECT_TRUE(page->viewportDescription().userZoom); | 1267 EXPECT_TRUE(page->viewportDescription().userZoom); |
1338 } | 1268 } |
1339 | 1269 |
1340 TEST_F(ViewportTest, viewport65) | 1270 TEST_F(LegacyViewportTest, viewport65) |
1341 { | 1271 { |
1342 UseMockScrollbarSettings mockScrollbarSettings; | |
1343 registerMockedHttpURLLoad("viewport/viewport-65.html"); | 1272 registerMockedHttpURLLoad("viewport/viewport-65.html"); |
1344 | 1273 |
1345 FrameTestHelpers::WebViewHelper webViewHelper; | 1274 FrameTestHelpers::WebViewHelper webViewHelper; |
1346 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-65.html", tru e, 0, 0, setViewportSettings); | 1275 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-65.html", tru e, 0, 0, setViewportSettings); |
1347 | 1276 |
1348 Page* page = webViewHelper.webViewImpl()->page(); | 1277 Page* page = webViewHelper.webViewImpl()->page(); |
1349 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 1278 PageScaleConstraints constraints = runTest(page, 320, 352); |
1350 | 1279 |
1351 EXPECT_EQ(100, constraints.layoutSize.width()); | 1280 EXPECT_EQ(100, constraints.layoutSize.width()); |
1352 EXPECT_EQ(110, constraints.layoutSize.height()); | 1281 EXPECT_EQ(110, constraints.layoutSize.height()); |
1353 EXPECT_NEAR(3.2f, constraints.initialScale, 0.01f); | 1282 EXPECT_NEAR(3.2f, constraints.initialScale, 0.01f); |
1354 EXPECT_NEAR(3.2f, constraints.minimumScale, 0.01f); | 1283 EXPECT_NEAR(3.2f, constraints.minimumScale, 0.01f); |
1355 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 1284 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
1356 EXPECT_TRUE(page->viewportDescription().userZoom); | 1285 EXPECT_TRUE(page->viewportDescription().userZoom); |
1357 } | 1286 } |
1358 | 1287 |
1359 TEST_F(ViewportTest, viewport66) | 1288 TEST_F(LegacyViewportTest, viewport66) |
1360 { | 1289 { |
1361 UseMockScrollbarSettings mockScrollbarSettings; | |
1362 registerMockedHttpURLLoad("viewport/viewport-66.html"); | 1290 registerMockedHttpURLLoad("viewport/viewport-66.html"); |
1363 | 1291 |
1364 FrameTestHelpers::WebViewHelper webViewHelper; | 1292 FrameTestHelpers::WebViewHelper webViewHelper; |
1365 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-66.html", tru e, 0, 0, setViewportSettings); | 1293 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-66.html", tru e, 0, 0, setViewportSettings); |
1366 | 1294 |
1367 Page* page = webViewHelper.webViewImpl()->page(); | 1295 Page* page = webViewHelper.webViewImpl()->page(); |
1368 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 1296 PageScaleConstraints constraints = runTest(page, 320, 352); |
1369 | 1297 |
1370 EXPECT_EQ(100, constraints.layoutSize.width()); | 1298 EXPECT_EQ(100, constraints.layoutSize.width()); |
1371 EXPECT_EQ(110, constraints.layoutSize.height()); | 1299 EXPECT_EQ(110, constraints.layoutSize.height()); |
1372 EXPECT_NEAR(3.2f, constraints.initialScale, 0.01f); | 1300 EXPECT_NEAR(3.2f, constraints.initialScale, 0.01f); |
1373 EXPECT_NEAR(3.2f, constraints.minimumScale, 0.01f); | 1301 EXPECT_NEAR(3.2f, constraints.minimumScale, 0.01f); |
1374 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 1302 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
1375 EXPECT_TRUE(page->viewportDescription().userZoom); | 1303 EXPECT_TRUE(page->viewportDescription().userZoom); |
1376 } | 1304 } |
1377 | 1305 |
1378 TEST_F(ViewportTest, viewport67) | 1306 TEST_F(LegacyViewportTest, viewport67) |
1379 { | 1307 { |
1380 UseMockScrollbarSettings mockScrollbarSettings; | |
1381 registerMockedHttpURLLoad("viewport/viewport-67.html"); | 1308 registerMockedHttpURLLoad("viewport/viewport-67.html"); |
1382 | 1309 |
1383 FrameTestHelpers::WebViewHelper webViewHelper; | 1310 FrameTestHelpers::WebViewHelper webViewHelper; |
1384 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-67.html", tru e, 0, 0, setViewportSettings); | 1311 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-67.html", tru e, 0, 0, setViewportSettings); |
1385 | 1312 |
1386 Page* page = webViewHelper.webViewImpl()->page(); | 1313 Page* page = webViewHelper.webViewImpl()->page(); |
1387 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 1314 PageScaleConstraints constraints = runTest(page, 320, 352); |
1388 | 1315 |
1389 EXPECT_EQ(320, constraints.layoutSize.width()); | 1316 EXPECT_EQ(320, constraints.layoutSize.width()); |
1390 EXPECT_EQ(352, constraints.layoutSize.height()); | 1317 EXPECT_EQ(352, constraints.layoutSize.height()); |
1391 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); | 1318 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); |
1392 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); | 1319 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); |
1393 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 1320 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
1394 EXPECT_TRUE(page->viewportDescription().userZoom); | 1321 EXPECT_TRUE(page->viewportDescription().userZoom); |
1395 } | 1322 } |
1396 | 1323 |
1397 TEST_F(ViewportTest, viewport68) | 1324 TEST_F(LegacyViewportTest, viewport68) |
1398 { | 1325 { |
1399 UseMockScrollbarSettings mockScrollbarSettings; | |
1400 registerMockedHttpURLLoad("viewport/viewport-68.html"); | 1326 registerMockedHttpURLLoad("viewport/viewport-68.html"); |
1401 | 1327 |
1402 FrameTestHelpers::WebViewHelper webViewHelper; | 1328 FrameTestHelpers::WebViewHelper webViewHelper; |
1403 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-68.html", tru e, 0, 0, setViewportSettings); | 1329 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-68.html", tru e, 0, 0, setViewportSettings); |
1404 | 1330 |
1405 Page* page = webViewHelper.webViewImpl()->page(); | 1331 Page* page = webViewHelper.webViewImpl()->page(); |
1406 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 1332 PageScaleConstraints constraints = runTest(page, 320, 352); |
1407 | 1333 |
1408 EXPECT_EQ(320, constraints.layoutSize.width()); | 1334 EXPECT_EQ(320, constraints.layoutSize.width()); |
1409 EXPECT_EQ(352, constraints.layoutSize.height()); | 1335 EXPECT_EQ(352, constraints.layoutSize.height()); |
1410 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); | 1336 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); |
1411 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); | 1337 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); |
1412 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 1338 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
1413 EXPECT_TRUE(page->viewportDescription().userZoom); | 1339 EXPECT_TRUE(page->viewportDescription().userZoom); |
1414 } | 1340 } |
1415 | 1341 |
1416 TEST_F(ViewportTest, viewport69) | 1342 TEST_F(LegacyViewportTest, viewport69) |
1417 { | 1343 { |
1418 UseMockScrollbarSettings mockScrollbarSettings; | |
1419 registerMockedHttpURLLoad("viewport/viewport-69.html"); | 1344 registerMockedHttpURLLoad("viewport/viewport-69.html"); |
1420 | 1345 |
1421 FrameTestHelpers::WebViewHelper webViewHelper; | 1346 FrameTestHelpers::WebViewHelper webViewHelper; |
1422 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-69.html", tru e, 0, 0, setViewportSettings); | 1347 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-69.html", tru e, 0, 0, setViewportSettings); |
1423 | 1348 |
1424 Page* page = webViewHelper.webViewImpl()->page(); | 1349 Page* page = webViewHelper.webViewImpl()->page(); |
1425 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 1350 PageScaleConstraints constraints = runTest(page, 320, 352); |
1426 | 1351 |
1427 EXPECT_EQ(100, constraints.layoutSize.width()); | 1352 EXPECT_EQ(100, constraints.layoutSize.width()); |
1428 EXPECT_EQ(110, constraints.layoutSize.height()); | 1353 EXPECT_EQ(110, constraints.layoutSize.height()); |
1429 EXPECT_NEAR(3.2f, constraints.initialScale, 0.01f); | 1354 EXPECT_NEAR(3.2f, constraints.initialScale, 0.01f); |
1430 EXPECT_NEAR(3.2f, constraints.minimumScale, 0.01f); | 1355 EXPECT_NEAR(3.2f, constraints.minimumScale, 0.01f); |
1431 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 1356 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
1432 EXPECT_TRUE(page->viewportDescription().userZoom); | 1357 EXPECT_TRUE(page->viewportDescription().userZoom); |
1433 } | 1358 } |
1434 | 1359 |
1435 TEST_F(ViewportTest, viewport70) | 1360 TEST_F(LegacyViewportTest, viewport70) |
1436 { | 1361 { |
1437 UseMockScrollbarSettings mockScrollbarSettings; | |
1438 registerMockedHttpURLLoad("viewport/viewport-70.html"); | 1362 registerMockedHttpURLLoad("viewport/viewport-70.html"); |
1439 | 1363 |
1440 FrameTestHelpers::WebViewHelper webViewHelper; | 1364 FrameTestHelpers::WebViewHelper webViewHelper; |
1441 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-70.html", tru e, 0, 0, setViewportSettings); | 1365 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-70.html", tru e, 0, 0, setViewportSettings); |
1442 | 1366 |
1443 Page* page = webViewHelper.webViewImpl()->page(); | 1367 Page* page = webViewHelper.webViewImpl()->page(); |
1444 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 1368 PageScaleConstraints constraints = runTest(page, 320, 352); |
1445 | 1369 |
1446 EXPECT_EQ(100, constraints.layoutSize.width()); | 1370 EXPECT_EQ(100, constraints.layoutSize.width()); |
1447 EXPECT_EQ(110, constraints.layoutSize.height()); | 1371 EXPECT_EQ(110, constraints.layoutSize.height()); |
1448 EXPECT_NEAR(3.2f, constraints.initialScale, 0.01f); | 1372 EXPECT_NEAR(3.2f, constraints.initialScale, 0.01f); |
1449 EXPECT_NEAR(3.2f, constraints.minimumScale, 0.01f); | 1373 EXPECT_NEAR(3.2f, constraints.minimumScale, 0.01f); |
1450 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 1374 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
1451 EXPECT_TRUE(page->viewportDescription().userZoom); | 1375 EXPECT_TRUE(page->viewportDescription().userZoom); |
1452 } | 1376 } |
1453 | 1377 |
1454 TEST_F(ViewportTest, viewport71) | 1378 TEST_F(LegacyViewportTest, viewport71) |
1455 { | 1379 { |
1456 UseMockScrollbarSettings mockScrollbarSettings; | |
1457 registerMockedHttpURLLoad("viewport/viewport-71.html"); | 1380 registerMockedHttpURLLoad("viewport/viewport-71.html"); |
1458 | 1381 |
1459 FrameTestHelpers::WebViewHelper webViewHelper; | 1382 FrameTestHelpers::WebViewHelper webViewHelper; |
1460 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-71.html", tru e, 0, 0, setViewportSettings); | 1383 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-71.html", tru e, 0, 0, setViewportSettings); |
1461 | 1384 |
1462 Page* page = webViewHelper.webViewImpl()->page(); | 1385 Page* page = webViewHelper.webViewImpl()->page(); |
1463 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 1386 PageScaleConstraints constraints = runTest(page, 320, 352); |
1464 | 1387 |
1465 EXPECT_EQ(320, constraints.layoutSize.width()); | 1388 EXPECT_EQ(320, constraints.layoutSize.width()); |
1466 EXPECT_EQ(352, constraints.layoutSize.height()); | 1389 EXPECT_EQ(352, constraints.layoutSize.height()); |
1467 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); | 1390 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); |
1468 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); | 1391 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); |
1469 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 1392 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
1470 EXPECT_TRUE(page->viewportDescription().userZoom); | 1393 EXPECT_TRUE(page->viewportDescription().userZoom); |
1471 } | 1394 } |
1472 | 1395 |
1473 TEST_F(ViewportTest, viewport72) | 1396 TEST_F(LegacyViewportTest, viewport72) |
1474 { | 1397 { |
1475 UseMockScrollbarSettings mockScrollbarSettings; | |
1476 registerMockedHttpURLLoad("viewport/viewport-72.html"); | 1398 registerMockedHttpURLLoad("viewport/viewport-72.html"); |
1477 | 1399 |
1478 FrameTestHelpers::WebViewHelper webViewHelper; | 1400 FrameTestHelpers::WebViewHelper webViewHelper; |
1479 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-72.html", tru e, 0, 0, setViewportSettings); | 1401 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-72.html", tru e, 0, 0, setViewportSettings); |
1480 | 1402 |
1481 Page* page = webViewHelper.webViewImpl()->page(); | 1403 Page* page = webViewHelper.webViewImpl()->page(); |
1482 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 1404 PageScaleConstraints constraints = runTest(page, 320, 352); |
1483 | 1405 |
1484 EXPECT_EQ(100, constraints.layoutSize.width()); | 1406 EXPECT_EQ(100, constraints.layoutSize.width()); |
1485 EXPECT_EQ(110, constraints.layoutSize.height()); | 1407 EXPECT_EQ(110, constraints.layoutSize.height()); |
1486 EXPECT_NEAR(3.2f, constraints.initialScale, 0.01f); | 1408 EXPECT_NEAR(3.2f, constraints.initialScale, 0.01f); |
1487 EXPECT_NEAR(3.2f, constraints.minimumScale, 0.01f); | 1409 EXPECT_NEAR(3.2f, constraints.minimumScale, 0.01f); |
1488 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 1410 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
1489 EXPECT_TRUE(page->viewportDescription().userZoom); | 1411 EXPECT_TRUE(page->viewportDescription().userZoom); |
1490 } | 1412 } |
1491 | 1413 |
1492 TEST_F(ViewportTest, viewport73) | 1414 TEST_F(LegacyViewportTest, viewport73) |
1493 { | 1415 { |
1494 UseMockScrollbarSettings mockScrollbarSettings; | |
1495 registerMockedHttpURLLoad("viewport/viewport-73.html"); | 1416 registerMockedHttpURLLoad("viewport/viewport-73.html"); |
1496 | 1417 |
1497 FrameTestHelpers::WebViewHelper webViewHelper; | 1418 FrameTestHelpers::WebViewHelper webViewHelper; |
1498 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-73.html", tru e, 0, 0, setViewportSettings); | 1419 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-73.html", tru e, 0, 0, setViewportSettings); |
1499 | 1420 |
1500 Page* page = webViewHelper.webViewImpl()->page(); | 1421 Page* page = webViewHelper.webViewImpl()->page(); |
1501 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 1422 PageScaleConstraints constraints = runTest(page, 320, 352); |
1502 | 1423 |
1503 EXPECT_EQ(100, constraints.layoutSize.width()); | 1424 EXPECT_EQ(100, constraints.layoutSize.width()); |
1504 EXPECT_EQ(110, constraints.layoutSize.height()); | 1425 EXPECT_EQ(110, constraints.layoutSize.height()); |
1505 EXPECT_NEAR(3.2f, constraints.initialScale, 0.01f); | 1426 EXPECT_NEAR(3.2f, constraints.initialScale, 0.01f); |
1506 EXPECT_NEAR(3.2f, constraints.minimumScale, 0.01f); | 1427 EXPECT_NEAR(3.2f, constraints.minimumScale, 0.01f); |
1507 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 1428 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
1508 EXPECT_TRUE(page->viewportDescription().userZoom); | 1429 EXPECT_TRUE(page->viewportDescription().userZoom); |
1509 } | 1430 } |
1510 | 1431 |
1511 TEST_F(ViewportTest, viewport74) | 1432 TEST_F(LegacyViewportTest, viewport74) |
1512 { | 1433 { |
1513 UseMockScrollbarSettings mockScrollbarSettings; | |
1514 registerMockedHttpURLLoad("viewport/viewport-74.html"); | 1434 registerMockedHttpURLLoad("viewport/viewport-74.html"); |
1515 | 1435 |
1516 FrameTestHelpers::WebViewHelper webViewHelper; | 1436 FrameTestHelpers::WebViewHelper webViewHelper; |
1517 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-74.html", tru e, 0, 0, setViewportSettings); | 1437 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-74.html", tru e, 0, 0, setViewportSettings); |
1518 | 1438 |
1519 Page* page = webViewHelper.webViewImpl()->page(); | 1439 Page* page = webViewHelper.webViewImpl()->page(); |
1520 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 1440 PageScaleConstraints constraints = runTest(page, 320, 352); |
1521 | 1441 |
1522 EXPECT_EQ(100, constraints.layoutSize.width()); | 1442 EXPECT_EQ(100, constraints.layoutSize.width()); |
1523 EXPECT_EQ(110, constraints.layoutSize.height()); | 1443 EXPECT_EQ(110, constraints.layoutSize.height()); |
1524 EXPECT_NEAR(3.2f, constraints.initialScale, 0.01f); | 1444 EXPECT_NEAR(3.2f, constraints.initialScale, 0.01f); |
1525 EXPECT_NEAR(3.2f, constraints.minimumScale, 0.01f); | 1445 EXPECT_NEAR(3.2f, constraints.minimumScale, 0.01f); |
1526 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 1446 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
1527 EXPECT_TRUE(page->viewportDescription().userZoom); | 1447 EXPECT_TRUE(page->viewportDescription().userZoom); |
1528 } | 1448 } |
1529 | 1449 |
1530 TEST_F(ViewportTest, viewport75) | 1450 TEST_F(LegacyViewportTest, viewport75) |
1531 { | 1451 { |
1532 UseMockScrollbarSettings mockScrollbarSettings; | |
1533 registerMockedHttpURLLoad("viewport/viewport-75.html"); | 1452 registerMockedHttpURLLoad("viewport/viewport-75.html"); |
1534 | 1453 |
1535 FrameTestHelpers::WebViewHelper webViewHelper; | 1454 FrameTestHelpers::WebViewHelper webViewHelper; |
1536 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-75.html", tru e, 0, 0, setViewportSettings); | 1455 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-75.html", tru e, 0, 0, setViewportSettings); |
1537 | 1456 |
1538 Page* page = webViewHelper.webViewImpl()->page(); | 1457 Page* page = webViewHelper.webViewImpl()->page(); |
1539 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 1458 PageScaleConstraints constraints = runTest(page, 320, 352); |
1540 | 1459 |
1541 EXPECT_EQ(64, constraints.layoutSize.width()); | 1460 EXPECT_EQ(64, constraints.layoutSize.width()); |
1542 EXPECT_NEAR(70.4, constraints.layoutSize.height(), 0.01f); | 1461 EXPECT_NEAR(70.4, constraints.layoutSize.height(), 0.01f); |
1543 EXPECT_NEAR(5.0f, constraints.initialScale, 0.01f); | 1462 EXPECT_NEAR(5.0f, constraints.initialScale, 0.01f); |
1544 EXPECT_NEAR(5.0f, constraints.minimumScale, 0.01f); | 1463 EXPECT_NEAR(5.0f, constraints.minimumScale, 0.01f); |
1545 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 1464 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
1546 EXPECT_TRUE(page->viewportDescription().userZoom); | 1465 EXPECT_TRUE(page->viewportDescription().userZoom); |
1547 } | 1466 } |
1548 | 1467 |
1549 TEST_F(ViewportTest, viewport76) | 1468 TEST_F(LegacyViewportTest, viewport76) |
1550 { | 1469 { |
1551 UseMockScrollbarSettings mockScrollbarSettings; | |
1552 registerMockedHttpURLLoad("viewport/viewport-76.html"); | 1470 registerMockedHttpURLLoad("viewport/viewport-76.html"); |
1553 | 1471 |
1554 FrameTestHelpers::WebViewHelper webViewHelper; | 1472 FrameTestHelpers::WebViewHelper webViewHelper; |
1555 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-76.html", tru e, 0, 0, setViewportSettings); | 1473 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-76.html", tru e, 0, 0, setViewportSettings); |
1556 | 1474 |
1557 Page* page = webViewHelper.webViewImpl()->page(); | 1475 Page* page = webViewHelper.webViewImpl()->page(); |
1558 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 1476 PageScaleConstraints constraints = runTest(page, 320, 352); |
1559 | 1477 |
1560 EXPECT_EQ(32, constraints.layoutSize.width()); | 1478 EXPECT_EQ(32, constraints.layoutSize.width()); |
1561 EXPECT_NEAR(35.2, constraints.layoutSize.height(), 0.01); | 1479 EXPECT_NEAR(35.2, constraints.layoutSize.height(), 0.01); |
1562 EXPECT_NEAR(10.0f, constraints.initialScale, 0.01f); | 1480 EXPECT_NEAR(10.0f, constraints.initialScale, 0.01f); |
1563 EXPECT_NEAR(10.0f, constraints.minimumScale, 0.01f); | 1481 EXPECT_NEAR(10.0f, constraints.minimumScale, 0.01f); |
1564 EXPECT_NEAR(10.0f, constraints.maximumScale, 0.01f); | 1482 EXPECT_NEAR(10.0f, constraints.maximumScale, 0.01f); |
1565 EXPECT_TRUE(page->viewportDescription().userZoom); | 1483 EXPECT_TRUE(page->viewportDescription().userZoom); |
1566 } | 1484 } |
1567 | 1485 |
1568 TEST_F(ViewportTest, viewport77) | 1486 TEST_F(LegacyViewportTest, viewport77) |
1569 { | 1487 { |
1570 UseMockScrollbarSettings mockScrollbarSettings; | |
1571 registerMockedHttpURLLoad("viewport/viewport-77.html"); | 1488 registerMockedHttpURLLoad("viewport/viewport-77.html"); |
1572 | 1489 |
1573 FrameTestHelpers::WebViewHelper webViewHelper; | 1490 FrameTestHelpers::WebViewHelper webViewHelper; |
1574 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-77.html", tru e, 0, 0, setViewportSettings); | 1491 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-77.html", tru e, 0, 0, setViewportSettings); |
1575 | 1492 |
1576 Page* page = webViewHelper.webViewImpl()->page(); | 1493 Page* page = webViewHelper.webViewImpl()->page(); |
1577 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 1494 PageScaleConstraints constraints = runTest(page, 320, 352); |
1578 | 1495 |
1579 EXPECT_EQ(1280, constraints.layoutSize.width()); | 1496 EXPECT_EQ(1280, constraints.layoutSize.width()); |
1580 EXPECT_EQ(1408, constraints.layoutSize.height()); | 1497 EXPECT_EQ(1408, constraints.layoutSize.height()); |
1581 EXPECT_NEAR(0.25f, constraints.initialScale, 0.01f); | 1498 EXPECT_NEAR(0.25f, constraints.initialScale, 0.01f); |
1582 EXPECT_NEAR(0.25f, constraints.minimumScale, 0.01f); | 1499 EXPECT_NEAR(0.25f, constraints.minimumScale, 0.01f); |
1583 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 1500 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
1584 EXPECT_TRUE(page->viewportDescription().userZoom); | 1501 EXPECT_TRUE(page->viewportDescription().userZoom); |
1585 } | 1502 } |
1586 | 1503 |
1587 TEST_F(ViewportTest, viewport78) | 1504 TEST_F(LegacyViewportTest, viewport78) |
1588 { | 1505 { |
1589 UseMockScrollbarSettings mockScrollbarSettings; | |
1590 registerMockedHttpURLLoad("viewport/viewport-78.html"); | 1506 registerMockedHttpURLLoad("viewport/viewport-78.html"); |
1591 | 1507 |
1592 FrameTestHelpers::WebViewHelper webViewHelper; | 1508 FrameTestHelpers::WebViewHelper webViewHelper; |
1593 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-78.html", tru e, 0, 0, setViewportSettings); | 1509 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-78.html", tru e, 0, 0, setViewportSettings); |
1594 | 1510 |
1595 Page* page = webViewHelper.webViewImpl()->page(); | 1511 Page* page = webViewHelper.webViewImpl()->page(); |
1596 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 1512 PageScaleConstraints constraints = runTest(page, 320, 352); |
1597 | 1513 |
1598 EXPECT_EQ(100, constraints.layoutSize.width()); | 1514 EXPECT_EQ(100, constraints.layoutSize.width()); |
1599 EXPECT_EQ(110, constraints.layoutSize.height()); | 1515 EXPECT_EQ(110, constraints.layoutSize.height()); |
1600 EXPECT_NEAR(3.2f, constraints.initialScale, 0.01f); | 1516 EXPECT_NEAR(3.2f, constraints.initialScale, 0.01f); |
1601 EXPECT_NEAR(3.2f, constraints.minimumScale, 0.01f); | 1517 EXPECT_NEAR(3.2f, constraints.minimumScale, 0.01f); |
1602 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 1518 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
1603 EXPECT_TRUE(page->viewportDescription().userZoom); | 1519 EXPECT_TRUE(page->viewportDescription().userZoom); |
1604 } | 1520 } |
1605 | 1521 |
1606 TEST_F(ViewportTest, viewport79) | 1522 TEST_F(LegacyViewportTest, viewport79) |
1607 { | 1523 { |
1608 UseMockScrollbarSettings mockScrollbarSettings; | |
1609 registerMockedHttpURLLoad("viewport/viewport-79.html"); | 1524 registerMockedHttpURLLoad("viewport/viewport-79.html"); |
1610 | 1525 |
1611 FrameTestHelpers::WebViewHelper webViewHelper; | 1526 FrameTestHelpers::WebViewHelper webViewHelper; |
1612 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-79.html", tru e, 0, 0, setViewportSettings); | 1527 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-79.html", tru e, 0, 0, setViewportSettings); |
1613 | 1528 |
1614 Page* page = webViewHelper.webViewImpl()->page(); | 1529 Page* page = webViewHelper.webViewImpl()->page(); |
1615 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 1530 PageScaleConstraints constraints = runTest(page, 320, 352); |
1616 | 1531 |
1617 EXPECT_EQ(320, constraints.layoutSize.width()); | 1532 EXPECT_EQ(320, constraints.layoutSize.width()); |
1618 EXPECT_EQ(352, constraints.layoutSize.height()); | 1533 EXPECT_EQ(352, constraints.layoutSize.height()); |
1619 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); | 1534 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); |
1620 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); | 1535 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); |
1621 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 1536 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
1622 EXPECT_TRUE(page->viewportDescription().userZoom); | 1537 EXPECT_TRUE(page->viewportDescription().userZoom); |
1623 } | 1538 } |
1624 | 1539 |
1625 TEST_F(ViewportTest, viewport80) | 1540 TEST_F(LegacyViewportTest, viewport80) |
1626 { | 1541 { |
1627 UseMockScrollbarSettings mockScrollbarSettings; | |
1628 registerMockedHttpURLLoad("viewport/viewport-80.html"); | 1542 registerMockedHttpURLLoad("viewport/viewport-80.html"); |
1629 | 1543 |
1630 FrameTestHelpers::WebViewHelper webViewHelper; | 1544 FrameTestHelpers::WebViewHelper webViewHelper; |
1631 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-80.html", tru e, 0, 0, setViewportSettings); | 1545 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-80.html", tru e, 0, 0, setViewportSettings); |
1632 | 1546 |
1633 Page* page = webViewHelper.webViewImpl()->page(); | 1547 Page* page = webViewHelper.webViewImpl()->page(); |
1634 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 1548 PageScaleConstraints constraints = runTest(page, 320, 352); |
1635 | 1549 |
1636 EXPECT_EQ(320, constraints.layoutSize.width()); | 1550 EXPECT_EQ(320, constraints.layoutSize.width()); |
1637 EXPECT_EQ(352, constraints.layoutSize.height()); | 1551 EXPECT_EQ(352, constraints.layoutSize.height()); |
1638 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); | 1552 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); |
1639 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); | 1553 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); |
1640 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 1554 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
1641 EXPECT_TRUE(page->viewportDescription().userZoom); | 1555 EXPECT_TRUE(page->viewportDescription().userZoom); |
1642 } | 1556 } |
1643 | 1557 |
1644 TEST_F(ViewportTest, viewport81) | 1558 TEST_F(LegacyViewportTest, viewport81) |
1645 { | 1559 { |
1646 UseMockScrollbarSettings mockScrollbarSettings; | |
1647 registerMockedHttpURLLoad("viewport/viewport-81.html"); | 1560 registerMockedHttpURLLoad("viewport/viewport-81.html"); |
1648 | 1561 |
1649 FrameTestHelpers::WebViewHelper webViewHelper; | 1562 FrameTestHelpers::WebViewHelper webViewHelper; |
1650 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-81.html", tru e, 0, 0, setViewportSettings); | 1563 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-81.html", tru e, 0, 0, setViewportSettings); |
1651 | 1564 |
1652 Page* page = webViewHelper.webViewImpl()->page(); | 1565 Page* page = webViewHelper.webViewImpl()->page(); |
1653 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 1566 PageScaleConstraints constraints = runTest(page, 320, 352); |
1654 | 1567 |
1655 EXPECT_EQ(3000, constraints.layoutSize.width()); | 1568 EXPECT_EQ(3000, constraints.layoutSize.width()); |
1656 EXPECT_EQ(3300, constraints.layoutSize.height()); | 1569 EXPECT_EQ(3300, constraints.layoutSize.height()); |
1657 EXPECT_NEAR(0.25f, constraints.initialScale, 0.01f); | 1570 EXPECT_NEAR(0.25f, constraints.initialScale, 0.01f); |
1658 EXPECT_NEAR(0.25f, constraints.minimumScale, 0.01f); | 1571 EXPECT_NEAR(0.25f, constraints.minimumScale, 0.01f); |
1659 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 1572 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
1660 EXPECT_TRUE(page->viewportDescription().userZoom); | 1573 EXPECT_TRUE(page->viewportDescription().userZoom); |
1661 } | 1574 } |
1662 | 1575 |
1663 TEST_F(ViewportTest, viewport82) | 1576 TEST_F(LegacyViewportTest, viewport82) |
1664 { | 1577 { |
1665 UseMockScrollbarSettings mockScrollbarSettings; | |
1666 registerMockedHttpURLLoad("viewport/viewport-82.html"); | 1578 registerMockedHttpURLLoad("viewport/viewport-82.html"); |
1667 | 1579 |
1668 FrameTestHelpers::WebViewHelper webViewHelper; | 1580 FrameTestHelpers::WebViewHelper webViewHelper; |
1669 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-82.html", tru e, 0, 0, setViewportSettings); | 1581 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-82.html", tru e, 0, 0, setViewportSettings); |
1670 | 1582 |
1671 Page* page = webViewHelper.webViewImpl()->page(); | 1583 Page* page = webViewHelper.webViewImpl()->page(); |
1672 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 1584 PageScaleConstraints constraints = runTest(page, 320, 352); |
1673 | 1585 |
1674 EXPECT_EQ(400, constraints.layoutSize.width()); | 1586 EXPECT_EQ(400, constraints.layoutSize.width()); |
1675 EXPECT_EQ(440, constraints.layoutSize.height()); | 1587 EXPECT_EQ(440, constraints.layoutSize.height()); |
1676 EXPECT_NEAR(0.8f, constraints.initialScale, 0.01f); | 1588 EXPECT_NEAR(0.8f, constraints.initialScale, 0.01f); |
1677 EXPECT_NEAR(0.8f, constraints.minimumScale, 0.01f); | 1589 EXPECT_NEAR(0.8f, constraints.minimumScale, 0.01f); |
1678 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 1590 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
1679 EXPECT_TRUE(page->viewportDescription().userZoom); | 1591 EXPECT_TRUE(page->viewportDescription().userZoom); |
1680 } | 1592 } |
1681 | 1593 |
1682 TEST_F(ViewportTest, viewport83) | 1594 TEST_F(LegacyViewportTest, viewport83) |
1683 { | 1595 { |
1684 UseMockScrollbarSettings mockScrollbarSettings; | |
1685 registerMockedHttpURLLoad("viewport/viewport-83.html"); | 1596 registerMockedHttpURLLoad("viewport/viewport-83.html"); |
1686 | 1597 |
1687 FrameTestHelpers::WebViewHelper webViewHelper; | 1598 FrameTestHelpers::WebViewHelper webViewHelper; |
1688 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-83.html", tru e, 0, 0, setViewportSettings); | 1599 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-83.html", tru e, 0, 0, setViewportSettings); |
1689 | 1600 |
1690 Page* page = webViewHelper.webViewImpl()->page(); | 1601 Page* page = webViewHelper.webViewImpl()->page(); |
1691 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 1602 PageScaleConstraints constraints = runTest(page, 320, 352); |
1692 | 1603 |
1693 EXPECT_EQ(64, constraints.layoutSize.width()); | 1604 EXPECT_EQ(64, constraints.layoutSize.width()); |
1694 EXPECT_NEAR(70.4, constraints.layoutSize.height(), 0.01f); | 1605 EXPECT_NEAR(70.4, constraints.layoutSize.height(), 0.01f); |
1695 EXPECT_NEAR(5.0f, constraints.initialScale, 0.01f); | 1606 EXPECT_NEAR(5.0f, constraints.initialScale, 0.01f); |
1696 EXPECT_NEAR(5.0f, constraints.minimumScale, 0.01f); | 1607 EXPECT_NEAR(5.0f, constraints.minimumScale, 0.01f); |
1697 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 1608 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
1698 EXPECT_TRUE(page->viewportDescription().userZoom); | 1609 EXPECT_TRUE(page->viewportDescription().userZoom); |
1699 } | 1610 } |
1700 | 1611 |
1701 TEST_F(ViewportTest, viewport84) | 1612 TEST_F(LegacyViewportTest, viewport84) |
1702 { | 1613 { |
1703 UseMockScrollbarSettings mockScrollbarSettings; | |
1704 registerMockedHttpURLLoad("viewport/viewport-84.html"); | 1614 registerMockedHttpURLLoad("viewport/viewport-84.html"); |
1705 | 1615 |
1706 FrameTestHelpers::WebViewHelper webViewHelper; | 1616 FrameTestHelpers::WebViewHelper webViewHelper; |
1707 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-84.html", tru e, 0, 0, setViewportSettings); | 1617 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-84.html", tru e, 0, 0, setViewportSettings); |
1708 | 1618 |
1709 Page* page = webViewHelper.webViewImpl()->page(); | 1619 Page* page = webViewHelper.webViewImpl()->page(); |
1710 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 1620 PageScaleConstraints constraints = runTest(page, 320, 352); |
1711 | 1621 |
1712 EXPECT_EQ(64, constraints.layoutSize.width()); | 1622 EXPECT_EQ(64, constraints.layoutSize.width()); |
1713 EXPECT_EQ(480, constraints.layoutSize.height()); | 1623 EXPECT_EQ(480, constraints.layoutSize.height()); |
1714 EXPECT_NEAR(5.0f, constraints.initialScale, 0.01f); | 1624 EXPECT_NEAR(5.0f, constraints.initialScale, 0.01f); |
1715 EXPECT_NEAR(5.0f, constraints.minimumScale, 0.01f); | 1625 EXPECT_NEAR(5.0f, constraints.minimumScale, 0.01f); |
1716 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 1626 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
1717 EXPECT_TRUE(page->viewportDescription().userZoom); | 1627 EXPECT_TRUE(page->viewportDescription().userZoom); |
1718 } | 1628 } |
1719 | 1629 |
1720 TEST_F(ViewportTest, viewport85) | 1630 TEST_F(LegacyViewportTest, viewport85) |
1721 { | 1631 { |
1722 UseMockScrollbarSettings mockScrollbarSettings; | |
1723 registerMockedHttpURLLoad("viewport/viewport-85.html"); | 1632 registerMockedHttpURLLoad("viewport/viewport-85.html"); |
1724 | 1633 |
1725 FrameTestHelpers::WebViewHelper webViewHelper; | 1634 FrameTestHelpers::WebViewHelper webViewHelper; |
1726 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-85.html", tru e, 0, 0, setViewportSettings); | 1635 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-85.html", tru e, 0, 0, setViewportSettings); |
1727 | 1636 |
1728 Page* page = webViewHelper.webViewImpl()->page(); | 1637 Page* page = webViewHelper.webViewImpl()->page(); |
1729 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 1638 PageScaleConstraints constraints = runTest(page, 320, 352); |
1730 | 1639 |
1731 EXPECT_EQ(540, constraints.layoutSize.width()); | 1640 EXPECT_EQ(540, constraints.layoutSize.width()); |
1732 EXPECT_EQ(594, constraints.layoutSize.height()); | 1641 EXPECT_EQ(594, constraints.layoutSize.height()); |
1733 EXPECT_NEAR(0.59f, constraints.initialScale, 0.01f); | 1642 EXPECT_NEAR(0.59f, constraints.initialScale, 0.01f); |
1734 EXPECT_NEAR(0.59f, constraints.minimumScale, 0.01f); | 1643 EXPECT_NEAR(0.59f, constraints.minimumScale, 0.01f); |
1735 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 1644 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
1736 EXPECT_TRUE(page->viewportDescription().userZoom); | 1645 EXPECT_TRUE(page->viewportDescription().userZoom); |
1737 } | 1646 } |
1738 | 1647 |
1739 TEST_F(ViewportTest, viewport86) | 1648 TEST_F(LegacyViewportTest, viewport86) |
1740 { | 1649 { |
1741 UseMockScrollbarSettings mockScrollbarSettings; | |
1742 registerMockedHttpURLLoad("viewport/viewport-86.html"); | 1650 registerMockedHttpURLLoad("viewport/viewport-86.html"); |
1743 | 1651 |
1744 FrameTestHelpers::WebViewHelper webViewHelper; | 1652 FrameTestHelpers::WebViewHelper webViewHelper; |
1745 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-86.html", tru e, 0, 0, setViewportSettings); | 1653 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-86.html", tru e, 0, 0, setViewportSettings); |
1746 | 1654 |
1747 Page* page = webViewHelper.webViewImpl()->page(); | 1655 Page* page = webViewHelper.webViewImpl()->page(); |
1748 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 1656 PageScaleConstraints constraints = runTest(page, 320, 352); |
1749 | 1657 |
1750 EXPECT_NEAR(457.14, constraints.layoutSize.width(), 0.01f); | 1658 EXPECT_NEAR(457.14, constraints.layoutSize.width(), 0.01f); |
1751 EXPECT_NEAR(502.86, constraints.layoutSize.height(), 0.01f); | 1659 EXPECT_NEAR(502.86, constraints.layoutSize.height(), 0.01f); |
1752 EXPECT_NEAR(0.7f, constraints.initialScale, 0.01f); | 1660 EXPECT_NEAR(0.7f, constraints.initialScale, 0.01f); |
1753 EXPECT_NEAR(0.7f, constraints.minimumScale, 0.01f); | 1661 EXPECT_NEAR(0.7f, constraints.minimumScale, 0.01f); |
1754 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 1662 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
1755 EXPECT_TRUE(page->viewportDescription().userZoom); | 1663 EXPECT_TRUE(page->viewportDescription().userZoom); |
1756 } | 1664 } |
1757 | 1665 |
1758 TEST_F(ViewportTest, viewport87) | 1666 TEST_F(LegacyViewportTest, viewport87) |
1759 { | 1667 { |
1760 UseMockScrollbarSettings mockScrollbarSettings; | |
1761 registerMockedHttpURLLoad("viewport/viewport-87.html"); | 1668 registerMockedHttpURLLoad("viewport/viewport-87.html"); |
1762 | 1669 |
1763 FrameTestHelpers::WebViewHelper webViewHelper; | 1670 FrameTestHelpers::WebViewHelper webViewHelper; |
1764 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-87.html", tru e, 0, 0, setViewportSettings); | 1671 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-87.html", tru e, 0, 0, setViewportSettings); |
1765 | 1672 |
1766 Page* page = webViewHelper.webViewImpl()->page(); | 1673 Page* page = webViewHelper.webViewImpl()->page(); |
1767 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 1674 PageScaleConstraints constraints = runTest(page, 320, 352); |
1768 | 1675 |
1769 EXPECT_EQ(64, constraints.layoutSize.width()); | 1676 EXPECT_EQ(64, constraints.layoutSize.width()); |
1770 EXPECT_NEAR(70.4, constraints.layoutSize.height(), 0.01f); | 1677 EXPECT_NEAR(70.4, constraints.layoutSize.height(), 0.01f); |
1771 EXPECT_NEAR(5.0f, constraints.initialScale, 0.01f); | 1678 EXPECT_NEAR(5.0f, constraints.initialScale, 0.01f); |
1772 EXPECT_NEAR(5.0f, constraints.minimumScale, 0.01f); | 1679 EXPECT_NEAR(5.0f, constraints.minimumScale, 0.01f); |
1773 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 1680 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
1774 EXPECT_TRUE(page->viewportDescription().userZoom); | 1681 EXPECT_TRUE(page->viewportDescription().userZoom); |
1775 } | 1682 } |
1776 | 1683 |
1777 TEST_F(ViewportTest, viewport88) | 1684 TEST_F(LegacyViewportTest, viewport88) |
1778 { | 1685 { |
1779 UseMockScrollbarSettings mockScrollbarSettings; | |
1780 registerMockedHttpURLLoad("viewport/viewport-88.html"); | 1686 registerMockedHttpURLLoad("viewport/viewport-88.html"); |
1781 | 1687 |
1782 FrameTestHelpers::WebViewHelper webViewHelper; | 1688 FrameTestHelpers::WebViewHelper webViewHelper; |
1783 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-88.html", tru e, 0, 0, setViewportSettings); | 1689 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-88.html", tru e, 0, 0, setViewportSettings); |
1784 | 1690 |
1785 Page* page = webViewHelper.webViewImpl()->page(); | 1691 Page* page = webViewHelper.webViewImpl()->page(); |
1786 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 1692 PageScaleConstraints constraints = runTest(page, 320, 352); |
1787 | 1693 |
1788 EXPECT_EQ(980, constraints.layoutSize.width()); | 1694 EXPECT_EQ(980, constraints.layoutSize.width()); |
1789 EXPECT_EQ(1078, constraints.layoutSize.height()); | 1695 EXPECT_EQ(1078, constraints.layoutSize.height()); |
1790 EXPECT_NEAR(0.33f, constraints.initialScale, 0.01f); | 1696 EXPECT_NEAR(0.33f, constraints.initialScale, 0.01f); |
1791 EXPECT_NEAR(0.33f, constraints.minimumScale, 0.01f); | 1697 EXPECT_NEAR(0.33f, constraints.minimumScale, 0.01f); |
1792 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 1698 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
1793 EXPECT_TRUE(page->viewportDescription().userZoom); | 1699 EXPECT_TRUE(page->viewportDescription().userZoom); |
1794 } | 1700 } |
1795 | 1701 |
1796 TEST_F(ViewportTest, viewport90) | 1702 TEST_F(LegacyViewportTest, viewport90) |
1797 { | 1703 { |
1798 UseMockScrollbarSettings mockScrollbarSettings; | |
1799 registerMockedHttpURLLoad("viewport/viewport-90.html"); | 1704 registerMockedHttpURLLoad("viewport/viewport-90.html"); |
1800 | 1705 |
1801 FrameTestHelpers::WebViewHelper webViewHelper; | 1706 FrameTestHelpers::WebViewHelper webViewHelper; |
1802 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-90.html", tru e, 0, 0, setViewportSettings); | 1707 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-90.html", tru e, 0, 0, setViewportSettings); |
1803 | 1708 |
1804 Page* page = webViewHelper.webViewImpl()->page(); | 1709 Page* page = webViewHelper.webViewImpl()->page(); |
1805 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 1710 PageScaleConstraints constraints = runTest(page, 320, 352); |
1806 | 1711 |
1807 EXPECT_EQ(700, constraints.layoutSize.width()); | 1712 EXPECT_EQ(700, constraints.layoutSize.width()); |
1808 EXPECT_EQ(770, constraints.layoutSize.height()); | 1713 EXPECT_EQ(770, constraints.layoutSize.height()); |
1809 EXPECT_NEAR(0.5f, constraints.initialScale, 0.01f); | 1714 EXPECT_NEAR(0.5f, constraints.initialScale, 0.01f); |
1810 EXPECT_NEAR(0.46f, constraints.minimumScale, 0.01f); | 1715 EXPECT_NEAR(0.46f, constraints.minimumScale, 0.01f); |
1811 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 1716 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
1812 EXPECT_TRUE(page->viewportDescription().userZoom); | 1717 EXPECT_TRUE(page->viewportDescription().userZoom); |
1813 } | 1718 } |
1814 | 1719 |
1815 TEST_F(ViewportTest, viewport100) | 1720 TEST_F(LegacyViewportTest, viewport100) |
1816 { | 1721 { |
1817 UseMockScrollbarSettings mockScrollbarSettings; | |
1818 registerMockedHttpURLLoad("viewport/viewport-100.html"); | 1722 registerMockedHttpURLLoad("viewport/viewport-100.html"); |
1819 | 1723 |
1820 FrameTestHelpers::WebViewHelper webViewHelper; | 1724 FrameTestHelpers::WebViewHelper webViewHelper; |
1821 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-100.html", tr ue, 0, 0, setViewportSettings); | 1725 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-100.html", tr ue, 0, 0, setViewportSettings); |
1822 | 1726 |
1823 Page* page = webViewHelper.webViewImpl()->page(); | 1727 Page* page = webViewHelper.webViewImpl()->page(); |
1824 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 1728 PageScaleConstraints constraints = runTest(page, 320, 352); |
1825 | 1729 |
1826 EXPECT_EQ(400, constraints.layoutSize.width()); | 1730 EXPECT_EQ(400, constraints.layoutSize.width()); |
1827 EXPECT_EQ(440, constraints.layoutSize.height()); | 1731 EXPECT_EQ(440, constraints.layoutSize.height()); |
1828 EXPECT_NEAR(0.8f, constraints.initialScale, 0.01f); | 1732 EXPECT_NEAR(0.8f, constraints.initialScale, 0.01f); |
1829 EXPECT_NEAR(0.8f, constraints.minimumScale, 0.01f); | 1733 EXPECT_NEAR(0.8f, constraints.minimumScale, 0.01f); |
1830 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 1734 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
1831 EXPECT_TRUE(page->viewportDescription().userZoom); | 1735 EXPECT_TRUE(page->viewportDescription().userZoom); |
1832 } | 1736 } |
1833 | 1737 |
1834 TEST_F(ViewportTest, viewport101) | 1738 TEST_F(LegacyViewportTest, viewport101) |
1835 { | 1739 { |
1836 UseMockScrollbarSettings mockScrollbarSettings; | |
1837 registerMockedHttpURLLoad("viewport/viewport-101.html"); | 1740 registerMockedHttpURLLoad("viewport/viewport-101.html"); |
1838 | 1741 |
1839 FrameTestHelpers::WebViewHelper webViewHelper; | 1742 FrameTestHelpers::WebViewHelper webViewHelper; |
1840 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-101.html", tr ue, 0, 0, setViewportSettings); | 1743 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-101.html", tr ue, 0, 0, setViewportSettings); |
1841 | 1744 |
1842 Page* page = webViewHelper.webViewImpl()->page(); | 1745 Page* page = webViewHelper.webViewImpl()->page(); |
1843 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 1746 PageScaleConstraints constraints = runTest(page, 320, 352); |
1844 | 1747 |
1845 EXPECT_EQ(400, constraints.layoutSize.width()); | 1748 EXPECT_EQ(400, constraints.layoutSize.width()); |
1846 EXPECT_EQ(440, constraints.layoutSize.height()); | 1749 EXPECT_EQ(440, constraints.layoutSize.height()); |
1847 EXPECT_NEAR(0.8f, constraints.initialScale, 0.01f); | 1750 EXPECT_NEAR(0.8f, constraints.initialScale, 0.01f); |
1848 EXPECT_NEAR(0.8f, constraints.minimumScale, 0.01f); | 1751 EXPECT_NEAR(0.8f, constraints.minimumScale, 0.01f); |
1849 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 1752 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
1850 EXPECT_TRUE(page->viewportDescription().userZoom); | 1753 EXPECT_TRUE(page->viewportDescription().userZoom); |
1851 } | 1754 } |
1852 | 1755 |
1853 TEST_F(ViewportTest, viewport102) | 1756 TEST_F(LegacyViewportTest, viewport102) |
1854 { | 1757 { |
1855 UseMockScrollbarSettings mockScrollbarSettings; | |
1856 registerMockedHttpURLLoad("viewport/viewport-102.html"); | 1758 registerMockedHttpURLLoad("viewport/viewport-102.html"); |
1857 | 1759 |
1858 FrameTestHelpers::WebViewHelper webViewHelper; | 1760 FrameTestHelpers::WebViewHelper webViewHelper; |
1859 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-102.html", tr ue, 0, 0, setViewportSettings); | 1761 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-102.html", tr ue, 0, 0, setViewportSettings); |
1860 | 1762 |
1861 Page* page = webViewHelper.webViewImpl()->page(); | 1763 Page* page = webViewHelper.webViewImpl()->page(); |
1862 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 1764 PageScaleConstraints constraints = runTest(page, 320, 352); |
1863 | 1765 |
1864 EXPECT_EQ(400, constraints.layoutSize.width()); | 1766 EXPECT_EQ(400, constraints.layoutSize.width()); |
1865 EXPECT_EQ(440, constraints.layoutSize.height()); | 1767 EXPECT_EQ(440, constraints.layoutSize.height()); |
1866 EXPECT_NEAR(0.8f, constraints.initialScale, 0.01f); | 1768 EXPECT_NEAR(0.8f, constraints.initialScale, 0.01f); |
1867 EXPECT_NEAR(0.8f, constraints.minimumScale, 0.01f); | 1769 EXPECT_NEAR(0.8f, constraints.minimumScale, 0.01f); |
1868 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 1770 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
1869 EXPECT_TRUE(page->viewportDescription().userZoom); | 1771 EXPECT_TRUE(page->viewportDescription().userZoom); |
1870 } | 1772 } |
1871 | 1773 |
1872 TEST_F(ViewportTest, viewport103) | 1774 TEST_F(LegacyViewportTest, viewport103) |
1873 { | 1775 { |
1874 UseMockScrollbarSettings mockScrollbarSettings; | |
1875 registerMockedHttpURLLoad("viewport/viewport-103.html"); | 1776 registerMockedHttpURLLoad("viewport/viewport-103.html"); |
1876 | 1777 |
1877 FrameTestHelpers::WebViewHelper webViewHelper; | 1778 FrameTestHelpers::WebViewHelper webViewHelper; |
1878 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-103.html", tr ue, 0, 0, setViewportSettings); | 1779 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-103.html", tr ue, 0, 0, setViewportSettings); |
1879 | 1780 |
1880 Page* page = webViewHelper.webViewImpl()->page(); | 1781 Page* page = webViewHelper.webViewImpl()->page(); |
1881 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 1782 PageScaleConstraints constraints = runTest(page, 320, 352); |
1882 | 1783 |
1883 EXPECT_EQ(400, constraints.layoutSize.width()); | 1784 EXPECT_EQ(400, constraints.layoutSize.width()); |
1884 EXPECT_EQ(440, constraints.layoutSize.height()); | 1785 EXPECT_EQ(440, constraints.layoutSize.height()); |
1885 EXPECT_NEAR(0.8f, constraints.initialScale, 0.01f); | 1786 EXPECT_NEAR(0.8f, constraints.initialScale, 0.01f); |
1886 EXPECT_NEAR(0.8f, constraints.minimumScale, 0.01f); | 1787 EXPECT_NEAR(0.8f, constraints.minimumScale, 0.01f); |
1887 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 1788 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
1888 EXPECT_TRUE(page->viewportDescription().userZoom); | 1789 EXPECT_TRUE(page->viewportDescription().userZoom); |
1889 } | 1790 } |
1890 | 1791 |
1891 TEST_F(ViewportTest, viewport104) | 1792 TEST_F(LegacyViewportTest, viewport104) |
1892 { | 1793 { |
1893 UseMockScrollbarSettings mockScrollbarSettings; | |
1894 registerMockedHttpURLLoad("viewport/viewport-104.html"); | 1794 registerMockedHttpURLLoad("viewport/viewport-104.html"); |
1895 | 1795 |
1896 FrameTestHelpers::WebViewHelper webViewHelper; | 1796 FrameTestHelpers::WebViewHelper webViewHelper; |
1897 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-104.html", tr ue, 0, 0, setViewportSettings); | 1797 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-104.html", tr ue, 0, 0, setViewportSettings); |
1898 | 1798 |
1899 Page* page = webViewHelper.webViewImpl()->page(); | 1799 Page* page = webViewHelper.webViewImpl()->page(); |
1900 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 1800 PageScaleConstraints constraints = runTest(page, 320, 352); |
1901 | 1801 |
1902 EXPECT_EQ(980, constraints.layoutSize.width()); | 1802 EXPECT_EQ(980, constraints.layoutSize.width()); |
1903 EXPECT_EQ(1078, constraints.layoutSize.height()); | 1803 EXPECT_EQ(1078, constraints.layoutSize.height()); |
1904 EXPECT_NEAR(0.33f, constraints.initialScale, 0.01f); | 1804 EXPECT_NEAR(0.33f, constraints.initialScale, 0.01f); |
1905 EXPECT_NEAR(0.33f, constraints.minimumScale, 0.01f); | 1805 EXPECT_NEAR(0.33f, constraints.minimumScale, 0.01f); |
1906 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 1806 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
1907 EXPECT_TRUE(page->viewportDescription().userZoom); | 1807 EXPECT_TRUE(page->viewportDescription().userZoom); |
1908 } | 1808 } |
1909 | 1809 |
1910 TEST_F(ViewportTest, viewport105) | 1810 TEST_F(LegacyViewportTest, viewport105) |
1911 { | 1811 { |
1912 UseMockScrollbarSettings mockScrollbarSettings; | |
1913 registerMockedHttpURLLoad("viewport/viewport-105.html"); | 1812 registerMockedHttpURLLoad("viewport/viewport-105.html"); |
1914 | 1813 |
1915 FrameTestHelpers::WebViewHelper webViewHelper; | 1814 FrameTestHelpers::WebViewHelper webViewHelper; |
1916 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-105.html", tr ue, 0, 0, setViewportSettings); | 1815 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-105.html", tr ue, 0, 0, setViewportSettings); |
1917 | 1816 |
1918 Page* page = webViewHelper.webViewImpl()->page(); | 1817 Page* page = webViewHelper.webViewImpl()->page(); |
1919 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 1818 PageScaleConstraints constraints = runTest(page, 320, 352); |
1920 | 1819 |
1921 EXPECT_EQ(980, constraints.layoutSize.width()); | 1820 EXPECT_EQ(980, constraints.layoutSize.width()); |
1922 EXPECT_EQ(1078, constraints.layoutSize.height()); | 1821 EXPECT_EQ(1078, constraints.layoutSize.height()); |
1923 EXPECT_NEAR(0.33f, constraints.initialScale, 0.01f); | 1822 EXPECT_NEAR(0.33f, constraints.initialScale, 0.01f); |
1924 EXPECT_NEAR(0.33f, constraints.minimumScale, 0.01f); | 1823 EXPECT_NEAR(0.33f, constraints.minimumScale, 0.01f); |
1925 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 1824 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
1926 EXPECT_TRUE(page->viewportDescription().userZoom); | 1825 EXPECT_TRUE(page->viewportDescription().userZoom); |
1927 } | 1826 } |
1928 | 1827 |
1929 TEST_F(ViewportTest, viewport106) | 1828 TEST_F(LegacyViewportTest, viewport106) |
1930 { | 1829 { |
1931 UseMockScrollbarSettings mockScrollbarSettings; | |
1932 registerMockedHttpURLLoad("viewport/viewport-106.html"); | 1830 registerMockedHttpURLLoad("viewport/viewport-106.html"); |
1933 | 1831 |
1934 FrameTestHelpers::WebViewHelper webViewHelper; | 1832 FrameTestHelpers::WebViewHelper webViewHelper; |
1935 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-106.html", tr ue, 0, 0, setViewportSettings); | 1833 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-106.html", tr ue, 0, 0, setViewportSettings); |
1936 | 1834 |
1937 Page* page = webViewHelper.webViewImpl()->page(); | 1835 Page* page = webViewHelper.webViewImpl()->page(); |
1938 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 1836 PageScaleConstraints constraints = runTest(page, 320, 352); |
1939 | 1837 |
1940 EXPECT_EQ(980, constraints.layoutSize.width()); | 1838 EXPECT_EQ(980, constraints.layoutSize.width()); |
1941 EXPECT_EQ(1078, constraints.layoutSize.height()); | 1839 EXPECT_EQ(1078, constraints.layoutSize.height()); |
1942 EXPECT_NEAR(0.33f, constraints.initialScale, 0.01f); | 1840 EXPECT_NEAR(0.33f, constraints.initialScale, 0.01f); |
1943 EXPECT_NEAR(0.33f, constraints.minimumScale, 0.01f); | 1841 EXPECT_NEAR(0.33f, constraints.minimumScale, 0.01f); |
1944 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 1842 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
1945 EXPECT_TRUE(page->viewportDescription().userZoom); | 1843 EXPECT_TRUE(page->viewportDescription().userZoom); |
1946 } | 1844 } |
1947 | 1845 |
1948 TEST_F(ViewportTest, viewport107) | 1846 TEST_F(LegacyViewportTest, viewport107) |
1949 { | 1847 { |
1950 UseMockScrollbarSettings mockScrollbarSettings; | |
1951 registerMockedHttpURLLoad("viewport/viewport-107.html"); | 1848 registerMockedHttpURLLoad("viewport/viewport-107.html"); |
1952 | 1849 |
1953 FrameTestHelpers::WebViewHelper webViewHelper; | 1850 FrameTestHelpers::WebViewHelper webViewHelper; |
1954 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-107.html", tr ue, 0, 0, setViewportSettings); | 1851 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-107.html", tr ue, 0, 0, setViewportSettings); |
1955 | 1852 |
1956 Page* page = webViewHelper.webViewImpl()->page(); | 1853 Page* page = webViewHelper.webViewImpl()->page(); |
1957 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 1854 PageScaleConstraints constraints = runTest(page, 320, 352); |
1958 | 1855 |
1959 EXPECT_EQ(980, constraints.layoutSize.width()); | 1856 EXPECT_EQ(980, constraints.layoutSize.width()); |
1960 EXPECT_EQ(1078, constraints.layoutSize.height()); | 1857 EXPECT_EQ(1078, constraints.layoutSize.height()); |
1961 EXPECT_NEAR(0.33f, constraints.initialScale, 0.01f); | 1858 EXPECT_NEAR(0.33f, constraints.initialScale, 0.01f); |
1962 EXPECT_NEAR(0.33f, constraints.minimumScale, 0.01f); | 1859 EXPECT_NEAR(0.33f, constraints.minimumScale, 0.01f); |
1963 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 1860 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
1964 EXPECT_TRUE(page->viewportDescription().userZoom); | 1861 EXPECT_TRUE(page->viewportDescription().userZoom); |
1965 } | 1862 } |
1966 | 1863 |
1967 TEST_F(ViewportTest, viewport108) | 1864 TEST_F(LegacyViewportTest, viewport108) |
1968 { | 1865 { |
1969 UseMockScrollbarSettings mockScrollbarSettings; | |
1970 registerMockedHttpURLLoad("viewport/viewport-108.html"); | 1866 registerMockedHttpURLLoad("viewport/viewport-108.html"); |
1971 | 1867 |
1972 FrameTestHelpers::WebViewHelper webViewHelper; | 1868 FrameTestHelpers::WebViewHelper webViewHelper; |
1973 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-108.html", tr ue, 0, 0, setViewportSettings); | 1869 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-108.html", tr ue, 0, 0, setViewportSettings); |
1974 | 1870 |
1975 Page* page = webViewHelper.webViewImpl()->page(); | 1871 Page* page = webViewHelper.webViewImpl()->page(); |
1976 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 1872 PageScaleConstraints constraints = runTest(page, 320, 352); |
1977 | 1873 |
1978 EXPECT_EQ(980, constraints.layoutSize.width()); | 1874 EXPECT_EQ(980, constraints.layoutSize.width()); |
1979 EXPECT_EQ(1078, constraints.layoutSize.height()); | 1875 EXPECT_EQ(1078, constraints.layoutSize.height()); |
1980 EXPECT_NEAR(0.33f, constraints.initialScale, 0.01f); | 1876 EXPECT_NEAR(0.33f, constraints.initialScale, 0.01f); |
1981 EXPECT_NEAR(0.33f, constraints.minimumScale, 0.01f); | 1877 EXPECT_NEAR(0.33f, constraints.minimumScale, 0.01f); |
1982 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 1878 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
1983 EXPECT_TRUE(page->viewportDescription().userZoom); | 1879 EXPECT_TRUE(page->viewportDescription().userZoom); |
1984 } | 1880 } |
1985 | 1881 |
1986 TEST_F(ViewportTest, viewport109) | 1882 TEST_F(LegacyViewportTest, viewport109) |
1987 { | 1883 { |
1988 UseMockScrollbarSettings mockScrollbarSettings; | |
1989 registerMockedHttpURLLoad("viewport/viewport-109.html"); | 1884 registerMockedHttpURLLoad("viewport/viewport-109.html"); |
1990 | 1885 |
1991 FrameTestHelpers::WebViewHelper webViewHelper; | 1886 FrameTestHelpers::WebViewHelper webViewHelper; |
1992 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-109.html", tr ue, 0, 0, setViewportSettings); | 1887 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-109.html", tr ue, 0, 0, setViewportSettings); |
1993 | 1888 |
1994 Page* page = webViewHelper.webViewImpl()->page(); | 1889 Page* page = webViewHelper.webViewImpl()->page(); |
1995 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 1890 PageScaleConstraints constraints = runTest(page, 320, 352); |
1996 | 1891 |
1997 EXPECT_EQ(980, constraints.layoutSize.width()); | 1892 EXPECT_EQ(980, constraints.layoutSize.width()); |
1998 EXPECT_EQ(1078, constraints.layoutSize.height()); | 1893 EXPECT_EQ(1078, constraints.layoutSize.height()); |
1999 EXPECT_NEAR(0.33f, constraints.initialScale, 0.01f); | 1894 EXPECT_NEAR(0.33f, constraints.initialScale, 0.01f); |
2000 EXPECT_NEAR(0.33f, constraints.minimumScale, 0.01f); | 1895 EXPECT_NEAR(0.33f, constraints.minimumScale, 0.01f); |
2001 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 1896 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
2002 EXPECT_TRUE(page->viewportDescription().userZoom); | 1897 EXPECT_TRUE(page->viewportDescription().userZoom); |
2003 } | 1898 } |
2004 | 1899 |
2005 TEST_F(ViewportTest, viewport110) | 1900 TEST_F(LegacyViewportTest, viewport110) |
2006 { | 1901 { |
2007 UseMockScrollbarSettings mockScrollbarSettings; | |
2008 registerMockedHttpURLLoad("viewport/viewport-110.html"); | 1902 registerMockedHttpURLLoad("viewport/viewport-110.html"); |
2009 | 1903 |
2010 FrameTestHelpers::WebViewHelper webViewHelper; | 1904 FrameTestHelpers::WebViewHelper webViewHelper; |
2011 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-110.html", tr ue, 0, 0, setViewportSettings); | 1905 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-110.html", tr ue, 0, 0, setViewportSettings); |
2012 | 1906 |
2013 Page* page = webViewHelper.webViewImpl()->page(); | 1907 Page* page = webViewHelper.webViewImpl()->page(); |
2014 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 1908 PageScaleConstraints constraints = runTest(page, 320, 352); |
2015 | 1909 |
2016 EXPECT_EQ(980, constraints.layoutSize.width()); | 1910 EXPECT_EQ(980, constraints.layoutSize.width()); |
2017 EXPECT_EQ(1078, constraints.layoutSize.height()); | 1911 EXPECT_EQ(1078, constraints.layoutSize.height()); |
2018 EXPECT_NEAR(0.33f, constraints.initialScale, 0.01f); | 1912 EXPECT_NEAR(0.33f, constraints.initialScale, 0.01f); |
2019 EXPECT_NEAR(0.33f, constraints.minimumScale, 0.01f); | 1913 EXPECT_NEAR(0.33f, constraints.minimumScale, 0.01f); |
2020 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 1914 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
2021 EXPECT_TRUE(page->viewportDescription().userZoom); | 1915 EXPECT_TRUE(page->viewportDescription().userZoom); |
2022 } | 1916 } |
2023 | 1917 |
2024 TEST_F(ViewportTest, viewport111) | 1918 TEST_F(LegacyViewportTest, viewport111) |
2025 { | 1919 { |
2026 UseMockScrollbarSettings mockScrollbarSettings; | |
2027 registerMockedHttpURLLoad("viewport/viewport-111.html"); | 1920 registerMockedHttpURLLoad("viewport/viewport-111.html"); |
2028 | 1921 |
2029 FrameTestHelpers::WebViewHelper webViewHelper; | 1922 FrameTestHelpers::WebViewHelper webViewHelper; |
2030 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-111.html", tr ue, 0, 0, setViewportSettings); | 1923 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-111.html", tr ue, 0, 0, setViewportSettings); |
2031 | 1924 |
2032 Page* page = webViewHelper.webViewImpl()->page(); | 1925 Page* page = webViewHelper.webViewImpl()->page(); |
2033 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 1926 PageScaleConstraints constraints = runTest(page, 320, 352); |
2034 | 1927 |
2035 EXPECT_EQ(980, constraints.layoutSize.width()); | 1928 EXPECT_EQ(980, constraints.layoutSize.width()); |
2036 EXPECT_EQ(1078, constraints.layoutSize.height()); | 1929 EXPECT_EQ(1078, constraints.layoutSize.height()); |
2037 EXPECT_NEAR(0.33f, constraints.initialScale, 0.01f); | 1930 EXPECT_NEAR(0.33f, constraints.initialScale, 0.01f); |
2038 EXPECT_NEAR(0.33f, constraints.minimumScale, 0.01f); | 1931 EXPECT_NEAR(0.33f, constraints.minimumScale, 0.01f); |
2039 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 1932 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
2040 EXPECT_TRUE(page->viewportDescription().userZoom); | 1933 EXPECT_TRUE(page->viewportDescription().userZoom); |
2041 } | 1934 } |
2042 | 1935 |
2043 TEST_F(ViewportTest, viewport112) | 1936 TEST_F(LegacyViewportTest, viewport112) |
2044 { | 1937 { |
2045 UseMockScrollbarSettings mockScrollbarSettings; | |
2046 registerMockedHttpURLLoad("viewport/viewport-112.html"); | 1938 registerMockedHttpURLLoad("viewport/viewport-112.html"); |
2047 | 1939 |
2048 FrameTestHelpers::WebViewHelper webViewHelper; | 1940 FrameTestHelpers::WebViewHelper webViewHelper; |
2049 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-112.html", tr ue, 0, 0, setViewportSettings); | 1941 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-112.html", tr ue, 0, 0, setViewportSettings); |
2050 | 1942 |
2051 Page* page = webViewHelper.webViewImpl()->page(); | 1943 Page* page = webViewHelper.webViewImpl()->page(); |
2052 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 1944 PageScaleConstraints constraints = runTest(page, 320, 352); |
2053 | 1945 |
2054 EXPECT_EQ(400, constraints.layoutSize.width()); | 1946 EXPECT_EQ(400, constraints.layoutSize.width()); |
2055 EXPECT_EQ(440, constraints.layoutSize.height()); | 1947 EXPECT_EQ(440, constraints.layoutSize.height()); |
2056 EXPECT_NEAR(0.8f, constraints.initialScale, 0.01f); | 1948 EXPECT_NEAR(0.8f, constraints.initialScale, 0.01f); |
2057 EXPECT_NEAR(0.8f, constraints.minimumScale, 0.01f); | 1949 EXPECT_NEAR(0.8f, constraints.minimumScale, 0.01f); |
2058 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 1950 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
2059 EXPECT_TRUE(page->viewportDescription().userZoom); | 1951 EXPECT_TRUE(page->viewportDescription().userZoom); |
2060 } | 1952 } |
2061 | 1953 |
2062 TEST_F(ViewportTest, viewport113) | 1954 TEST_F(LegacyViewportTest, viewport113) |
2063 { | 1955 { |
2064 UseMockScrollbarSettings mockScrollbarSettings; | |
2065 registerMockedHttpURLLoad("viewport/viewport-113.html"); | 1956 registerMockedHttpURLLoad("viewport/viewport-113.html"); |
2066 | 1957 |
2067 FrameTestHelpers::WebViewHelper webViewHelper; | 1958 FrameTestHelpers::WebViewHelper webViewHelper; |
2068 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-113.html", tr ue, 0, 0, setViewportSettings); | 1959 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-113.html", tr ue, 0, 0, setViewportSettings); |
2069 | 1960 |
2070 Page* page = webViewHelper.webViewImpl()->page(); | 1961 Page* page = webViewHelper.webViewImpl()->page(); |
2071 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 1962 PageScaleConstraints constraints = runTest(page, 320, 352); |
2072 | 1963 |
2073 EXPECT_EQ(980, constraints.layoutSize.width()); | 1964 EXPECT_EQ(980, constraints.layoutSize.width()); |
2074 EXPECT_EQ(1078, constraints.layoutSize.height()); | 1965 EXPECT_EQ(1078, constraints.layoutSize.height()); |
2075 EXPECT_NEAR(0.33f, constraints.initialScale, 0.01f); | 1966 EXPECT_NEAR(0.33f, constraints.initialScale, 0.01f); |
2076 EXPECT_NEAR(0.33f, constraints.minimumScale, 0.01f); | 1967 EXPECT_NEAR(0.33f, constraints.minimumScale, 0.01f); |
2077 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 1968 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
2078 EXPECT_TRUE(page->viewportDescription().userZoom); | 1969 EXPECT_TRUE(page->viewportDescription().userZoom); |
2079 } | 1970 } |
2080 | 1971 |
2081 TEST_F(ViewportTest, viewport114) | 1972 TEST_F(LegacyViewportTest, viewport114) |
2082 { | 1973 { |
2083 UseMockScrollbarSettings mockScrollbarSettings; | |
2084 registerMockedHttpURLLoad("viewport/viewport-114.html"); | 1974 registerMockedHttpURLLoad("viewport/viewport-114.html"); |
2085 | 1975 |
2086 FrameTestHelpers::WebViewHelper webViewHelper; | 1976 FrameTestHelpers::WebViewHelper webViewHelper; |
2087 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-114.html", tr ue, 0, 0, setViewportSettings); | 1977 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-114.html", tr ue, 0, 0, setViewportSettings); |
2088 | 1978 |
2089 Page* page = webViewHelper.webViewImpl()->page(); | 1979 Page* page = webViewHelper.webViewImpl()->page(); |
2090 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 1980 PageScaleConstraints constraints = runTest(page, 320, 352); |
2091 | 1981 |
2092 EXPECT_EQ(980, constraints.layoutSize.width()); | 1982 EXPECT_EQ(980, constraints.layoutSize.width()); |
2093 EXPECT_EQ(1078, constraints.layoutSize.height()); | 1983 EXPECT_EQ(1078, constraints.layoutSize.height()); |
2094 EXPECT_NEAR(0.33f, constraints.initialScale, 0.01f); | 1984 EXPECT_NEAR(0.33f, constraints.initialScale, 0.01f); |
2095 EXPECT_NEAR(0.33f, constraints.minimumScale, 0.01f); | 1985 EXPECT_NEAR(0.33f, constraints.minimumScale, 0.01f); |
2096 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 1986 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
2097 EXPECT_TRUE(page->viewportDescription().userZoom); | 1987 EXPECT_TRUE(page->viewportDescription().userZoom); |
2098 } | 1988 } |
2099 | 1989 |
2100 TEST_F(ViewportTest, viewport115) | 1990 TEST_F(LegacyViewportTest, viewport115) |
2101 { | 1991 { |
2102 UseMockScrollbarSettings mockScrollbarSettings; | |
2103 registerMockedHttpURLLoad("viewport/viewport-115.html"); | 1992 registerMockedHttpURLLoad("viewport/viewport-115.html"); |
2104 | 1993 |
2105 FrameTestHelpers::WebViewHelper webViewHelper; | 1994 FrameTestHelpers::WebViewHelper webViewHelper; |
2106 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-115.html", tr ue, 0, 0, setViewportSettings); | 1995 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-115.html", tr ue, 0, 0, setViewportSettings); |
2107 | 1996 |
2108 Page* page = webViewHelper.webViewImpl()->page(); | 1997 Page* page = webViewHelper.webViewImpl()->page(); |
2109 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 1998 PageScaleConstraints constraints = runTest(page, 320, 352); |
2110 | 1999 |
2111 EXPECT_EQ(400, constraints.layoutSize.width()); | 2000 EXPECT_EQ(400, constraints.layoutSize.width()); |
2112 EXPECT_EQ(440, constraints.layoutSize.height()); | 2001 EXPECT_EQ(440, constraints.layoutSize.height()); |
2113 EXPECT_NEAR(0.8f, constraints.initialScale, 0.01f); | 2002 EXPECT_NEAR(0.8f, constraints.initialScale, 0.01f); |
2114 EXPECT_NEAR(0.8f, constraints.minimumScale, 0.01f); | 2003 EXPECT_NEAR(0.8f, constraints.minimumScale, 0.01f); |
2115 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 2004 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
2116 EXPECT_TRUE(page->viewportDescription().userZoom); | 2005 EXPECT_TRUE(page->viewportDescription().userZoom); |
2117 } | 2006 } |
2118 | 2007 |
2119 TEST_F(ViewportTest, viewport116) | 2008 TEST_F(LegacyViewportTest, viewport116) |
2120 { | 2009 { |
2121 UseMockScrollbarSettings mockScrollbarSettings; | |
2122 registerMockedHttpURLLoad("viewport/viewport-116.html"); | 2010 registerMockedHttpURLLoad("viewport/viewport-116.html"); |
2123 | 2011 |
2124 FrameTestHelpers::WebViewHelper webViewHelper; | 2012 FrameTestHelpers::WebViewHelper webViewHelper; |
2125 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-116.html", tr ue, 0, 0, setViewportSettings); | 2013 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-116.html", tr ue, 0, 0, setViewportSettings); |
2126 | 2014 |
2127 Page* page = webViewHelper.webViewImpl()->page(); | 2015 Page* page = webViewHelper.webViewImpl()->page(); |
2128 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 2016 PageScaleConstraints constraints = runTest(page, 320, 352); |
2129 | 2017 |
2130 EXPECT_EQ(400, constraints.layoutSize.width()); | 2018 EXPECT_EQ(400, constraints.layoutSize.width()); |
2131 EXPECT_EQ(440, constraints.layoutSize.height()); | 2019 EXPECT_EQ(440, constraints.layoutSize.height()); |
2132 EXPECT_NEAR(0.8f, constraints.initialScale, 0.01f); | 2020 EXPECT_NEAR(0.8f, constraints.initialScale, 0.01f); |
2133 EXPECT_NEAR(0.8f, constraints.minimumScale, 0.01f); | 2021 EXPECT_NEAR(0.8f, constraints.minimumScale, 0.01f); |
2134 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 2022 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
2135 EXPECT_TRUE(page->viewportDescription().userZoom); | 2023 EXPECT_TRUE(page->viewportDescription().userZoom); |
2136 } | 2024 } |
2137 | 2025 |
2138 TEST_F(ViewportTest, viewport117) | 2026 TEST_F(LegacyViewportTest, viewport117) |
2139 { | 2027 { |
2140 UseMockScrollbarSettings mockScrollbarSettings; | |
2141 registerMockedHttpURLLoad("viewport/viewport-117.html"); | 2028 registerMockedHttpURLLoad("viewport/viewport-117.html"); |
2142 | 2029 |
2143 FrameTestHelpers::WebViewHelper webViewHelper; | 2030 FrameTestHelpers::WebViewHelper webViewHelper; |
2144 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-117.html", tr ue, 0, 0, setViewportSettings); | 2031 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-117.html", tr ue, 0, 0, setViewportSettings); |
2145 | 2032 |
2146 Page* page = webViewHelper.webViewImpl()->page(); | 2033 Page* page = webViewHelper.webViewImpl()->page(); |
2147 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 2034 PageScaleConstraints constraints = runTest(page, 320, 352); |
2148 | 2035 |
2149 EXPECT_EQ(980, constraints.layoutSize.width()); | 2036 EXPECT_EQ(980, constraints.layoutSize.width()); |
2150 EXPECT_EQ(400, constraints.layoutSize.height()); | 2037 EXPECT_EQ(400, constraints.layoutSize.height()); |
2151 EXPECT_NEAR(0.33f, constraints.initialScale, 0.01f); | 2038 EXPECT_NEAR(0.33f, constraints.initialScale, 0.01f); |
2152 EXPECT_NEAR(0.33f, constraints.minimumScale, 0.01f); | 2039 EXPECT_NEAR(0.33f, constraints.minimumScale, 0.01f); |
2153 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 2040 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
2154 EXPECT_TRUE(page->viewportDescription().userZoom); | 2041 EXPECT_TRUE(page->viewportDescription().userZoom); |
2155 } | 2042 } |
2156 | 2043 |
2157 TEST_F(ViewportTest, viewport118) | 2044 TEST_F(LegacyViewportTest, viewport118) |
2158 { | 2045 { |
2159 UseMockScrollbarSettings mockScrollbarSettings; | |
2160 registerMockedHttpURLLoad("viewport/viewport-118.html"); | 2046 registerMockedHttpURLLoad("viewport/viewport-118.html"); |
2161 | 2047 |
2162 FrameTestHelpers::WebViewHelper webViewHelper; | 2048 FrameTestHelpers::WebViewHelper webViewHelper; |
2163 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-118.html", tr ue, 0, 0, setViewportSettings); | 2049 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-118.html", tr ue, 0, 0, setViewportSettings); |
2164 | 2050 |
2165 Page* page = webViewHelper.webViewImpl()->page(); | 2051 Page* page = webViewHelper.webViewImpl()->page(); |
2166 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 2052 PageScaleConstraints constraints = runTest(page, 320, 352); |
2167 | 2053 |
2168 EXPECT_EQ(320, constraints.layoutSize.width()); | 2054 EXPECT_EQ(320, constraints.layoutSize.width()); |
2169 EXPECT_EQ(352, constraints.layoutSize.height()); | 2055 EXPECT_EQ(352, constraints.layoutSize.height()); |
2170 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); | 2056 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); |
2171 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); | 2057 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); |
2172 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 2058 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
2173 EXPECT_TRUE(page->viewportDescription().userZoom); | 2059 EXPECT_TRUE(page->viewportDescription().userZoom); |
2174 } | 2060 } |
2175 | 2061 |
2176 TEST_F(ViewportTest, viewport119) | 2062 TEST_F(LegacyViewportTest, viewport119) |
2177 { | 2063 { |
2178 UseMockScrollbarSettings mockScrollbarSettings; | |
2179 registerMockedHttpURLLoad("viewport/viewport-119.html"); | 2064 registerMockedHttpURLLoad("viewport/viewport-119.html"); |
2180 | 2065 |
2181 FrameTestHelpers::WebViewHelper webViewHelper; | 2066 FrameTestHelpers::WebViewHelper webViewHelper; |
2182 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-119.html", tr ue, 0, 0, setViewportSettings); | 2067 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-119.html", tr ue, 0, 0, setViewportSettings); |
2183 | 2068 |
2184 Page* page = webViewHelper.webViewImpl()->page(); | 2069 Page* page = webViewHelper.webViewImpl()->page(); |
2185 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 2070 PageScaleConstraints constraints = runTest(page, 320, 352); |
2186 | 2071 |
2187 EXPECT_EQ(320, constraints.layoutSize.width()); | 2072 EXPECT_EQ(320, constraints.layoutSize.width()); |
2188 EXPECT_EQ(352, constraints.layoutSize.height()); | 2073 EXPECT_EQ(352, constraints.layoutSize.height()); |
2189 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); | 2074 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); |
2190 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); | 2075 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); |
2191 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 2076 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
2192 EXPECT_TRUE(page->viewportDescription().userZoom); | 2077 EXPECT_TRUE(page->viewportDescription().userZoom); |
2193 } | 2078 } |
2194 | 2079 |
2195 TEST_F(ViewportTest, viewport120) | 2080 TEST_F(LegacyViewportTest, viewport120) |
2196 { | 2081 { |
2197 UseMockScrollbarSettings mockScrollbarSettings; | |
2198 registerMockedHttpURLLoad("viewport/viewport-120.html"); | 2082 registerMockedHttpURLLoad("viewport/viewport-120.html"); |
2199 | 2083 |
2200 FrameTestHelpers::WebViewHelper webViewHelper; | 2084 FrameTestHelpers::WebViewHelper webViewHelper; |
2201 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-120.html", tr ue, 0, 0, setViewportSettings); | 2085 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-120.html", tr ue, 0, 0, setViewportSettings); |
2202 | 2086 |
2203 Page* page = webViewHelper.webViewImpl()->page(); | 2087 Page* page = webViewHelper.webViewImpl()->page(); |
2204 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 2088 PageScaleConstraints constraints = runTest(page, 320, 352); |
2205 | 2089 |
2206 EXPECT_EQ(320, constraints.layoutSize.width()); | 2090 EXPECT_EQ(320, constraints.layoutSize.width()); |
2207 EXPECT_EQ(352, constraints.layoutSize.height()); | 2091 EXPECT_EQ(352, constraints.layoutSize.height()); |
2208 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); | 2092 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); |
2209 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); | 2093 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); |
2210 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 2094 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
2211 EXPECT_TRUE(page->viewportDescription().userZoom); | 2095 EXPECT_TRUE(page->viewportDescription().userZoom); |
2212 } | 2096 } |
2213 | 2097 |
2214 TEST_F(ViewportTest, viewport121) | 2098 TEST_F(LegacyViewportTest, viewport121) |
2215 { | 2099 { |
2216 UseMockScrollbarSettings mockScrollbarSettings; | |
2217 registerMockedHttpURLLoad("viewport/viewport-121.html"); | 2100 registerMockedHttpURLLoad("viewport/viewport-121.html"); |
2218 | 2101 |
2219 FrameTestHelpers::WebViewHelper webViewHelper; | 2102 FrameTestHelpers::WebViewHelper webViewHelper; |
2220 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-121.html", tr ue, 0, 0, setViewportSettings); | 2103 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-121.html", tr ue, 0, 0, setViewportSettings); |
2221 | 2104 |
2222 Page* page = webViewHelper.webViewImpl()->page(); | 2105 Page* page = webViewHelper.webViewImpl()->page(); |
2223 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 2106 PageScaleConstraints constraints = runTest(page, 320, 352); |
2224 | 2107 |
2225 EXPECT_EQ(64, constraints.layoutSize.width()); | 2108 EXPECT_EQ(64, constraints.layoutSize.width()); |
2226 EXPECT_NEAR(70.4, constraints.layoutSize.height(), 0.01f); | 2109 EXPECT_NEAR(70.4, constraints.layoutSize.height(), 0.01f); |
2227 EXPECT_NEAR(5.0f, constraints.initialScale, 0.01f); | 2110 EXPECT_NEAR(5.0f, constraints.initialScale, 0.01f); |
2228 EXPECT_NEAR(5.0f, constraints.minimumScale, 0.01f); | 2111 EXPECT_NEAR(5.0f, constraints.minimumScale, 0.01f); |
2229 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 2112 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
2230 EXPECT_TRUE(page->viewportDescription().userZoom); | 2113 EXPECT_TRUE(page->viewportDescription().userZoom); |
2231 } | 2114 } |
2232 | 2115 |
2233 TEST_F(ViewportTest, viewport122) | 2116 TEST_F(LegacyViewportTest, viewport122) |
2234 { | 2117 { |
2235 UseMockScrollbarSettings mockScrollbarSettings; | |
2236 registerMockedHttpURLLoad("viewport/viewport-122.html"); | 2118 registerMockedHttpURLLoad("viewport/viewport-122.html"); |
2237 | 2119 |
2238 FrameTestHelpers::WebViewHelper webViewHelper; | 2120 FrameTestHelpers::WebViewHelper webViewHelper; |
2239 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-122.html", tr ue, 0, 0, setViewportSettings); | 2121 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-122.html", tr ue, 0, 0, setViewportSettings); |
2240 | 2122 |
2241 Page* page = webViewHelper.webViewImpl()->page(); | 2123 Page* page = webViewHelper.webViewImpl()->page(); |
2242 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 2124 PageScaleConstraints constraints = runTest(page, 320, 352); |
2243 | 2125 |
2244 EXPECT_EQ(64, constraints.layoutSize.width()); | 2126 EXPECT_EQ(64, constraints.layoutSize.width()); |
2245 EXPECT_NEAR(70.4, constraints.layoutSize.height(), 0.01f); | 2127 EXPECT_NEAR(70.4, constraints.layoutSize.height(), 0.01f); |
2246 EXPECT_NEAR(5.0f, constraints.initialScale, 0.01f); | 2128 EXPECT_NEAR(5.0f, constraints.initialScale, 0.01f); |
2247 EXPECT_NEAR(5.0f, constraints.minimumScale, 0.01f); | 2129 EXPECT_NEAR(5.0f, constraints.minimumScale, 0.01f); |
2248 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 2130 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
2249 EXPECT_TRUE(page->viewportDescription().userZoom); | 2131 EXPECT_TRUE(page->viewportDescription().userZoom); |
2250 } | 2132 } |
2251 | 2133 |
2252 TEST_F(ViewportTest, viewport123) | 2134 TEST_F(LegacyViewportTest, viewport123) |
2253 { | 2135 { |
2254 UseMockScrollbarSettings mockScrollbarSettings; | |
2255 registerMockedHttpURLLoad("viewport/viewport-123.html"); | 2136 registerMockedHttpURLLoad("viewport/viewport-123.html"); |
2256 | 2137 |
2257 FrameTestHelpers::WebViewHelper webViewHelper; | 2138 FrameTestHelpers::WebViewHelper webViewHelper; |
2258 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-123.html", tr ue, 0, 0, setViewportSettings); | 2139 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-123.html", tr ue, 0, 0, setViewportSettings); |
2259 | 2140 |
2260 Page* page = webViewHelper.webViewImpl()->page(); | 2141 Page* page = webViewHelper.webViewImpl()->page(); |
2261 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 2142 PageScaleConstraints constraints = runTest(page, 320, 352); |
2262 | 2143 |
2263 EXPECT_EQ(320, constraints.layoutSize.width()); | 2144 EXPECT_EQ(320, constraints.layoutSize.width()); |
2264 EXPECT_EQ(352, constraints.layoutSize.height()); | 2145 EXPECT_EQ(352, constraints.layoutSize.height()); |
2265 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); | 2146 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); |
2266 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); | 2147 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); |
2267 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 2148 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
2268 EXPECT_TRUE(page->viewportDescription().userZoom); | 2149 EXPECT_TRUE(page->viewportDescription().userZoom); |
2269 } | 2150 } |
2270 | 2151 |
2271 TEST_F(ViewportTest, viewport124) | 2152 TEST_F(LegacyViewportTest, viewport124) |
2272 { | 2153 { |
2273 UseMockScrollbarSettings mockScrollbarSettings; | |
2274 registerMockedHttpURLLoad("viewport/viewport-124.html"); | 2154 registerMockedHttpURLLoad("viewport/viewport-124.html"); |
2275 | 2155 |
2276 FrameTestHelpers::WebViewHelper webViewHelper; | 2156 FrameTestHelpers::WebViewHelper webViewHelper; |
2277 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-124.html", tr ue, 0, 0, setViewportSettings); | 2157 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-124.html", tr ue, 0, 0, setViewportSettings); |
2278 | 2158 |
2279 Page* page = webViewHelper.webViewImpl()->page(); | 2159 Page* page = webViewHelper.webViewImpl()->page(); |
2280 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 2160 PageScaleConstraints constraints = runTest(page, 320, 352); |
2281 | 2161 |
2282 EXPECT_EQ(320, constraints.layoutSize.width()); | 2162 EXPECT_EQ(320, constraints.layoutSize.width()); |
2283 EXPECT_EQ(352, constraints.layoutSize.height()); | 2163 EXPECT_EQ(352, constraints.layoutSize.height()); |
2284 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); | 2164 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); |
2285 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); | 2165 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); |
2286 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 2166 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
2287 EXPECT_TRUE(page->viewportDescription().userZoom); | 2167 EXPECT_TRUE(page->viewportDescription().userZoom); |
2288 } | 2168 } |
2289 | 2169 |
2290 TEST_F(ViewportTest, viewport125) | 2170 TEST_F(LegacyViewportTest, viewport125) |
2291 { | 2171 { |
2292 UseMockScrollbarSettings mockScrollbarSettings; | |
2293 registerMockedHttpURLLoad("viewport/viewport-125.html"); | 2172 registerMockedHttpURLLoad("viewport/viewport-125.html"); |
2294 | 2173 |
2295 FrameTestHelpers::WebViewHelper webViewHelper; | 2174 FrameTestHelpers::WebViewHelper webViewHelper; |
2296 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-125.html", tr ue, 0, 0, setViewportSettings); | 2175 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-125.html", tr ue, 0, 0, setViewportSettings); |
2297 | 2176 |
2298 Page* page = webViewHelper.webViewImpl()->page(); | 2177 Page* page = webViewHelper.webViewImpl()->page(); |
2299 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 2178 PageScaleConstraints constraints = runTest(page, 320, 352); |
2300 | 2179 |
2301 EXPECT_EQ(64, constraints.layoutSize.width()); | 2180 EXPECT_EQ(64, constraints.layoutSize.width()); |
2302 EXPECT_NEAR(70.4, constraints.layoutSize.height(), 0.01f); | 2181 EXPECT_NEAR(70.4, constraints.layoutSize.height(), 0.01f); |
2303 EXPECT_NEAR(5.0f, constraints.initialScale, 0.01f); | 2182 EXPECT_NEAR(5.0f, constraints.initialScale, 0.01f); |
2304 EXPECT_NEAR(5.0f, constraints.minimumScale, 0.01f); | 2183 EXPECT_NEAR(5.0f, constraints.minimumScale, 0.01f); |
2305 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 2184 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
2306 EXPECT_TRUE(page->viewportDescription().userZoom); | 2185 EXPECT_TRUE(page->viewportDescription().userZoom); |
2307 } | 2186 } |
2308 | 2187 |
2309 TEST_F(ViewportTest, viewport126) | 2188 TEST_F(LegacyViewportTest, viewport126) |
2310 { | 2189 { |
2311 UseMockScrollbarSettings mockScrollbarSettings; | |
2312 registerMockedHttpURLLoad("viewport/viewport-126.html"); | 2190 registerMockedHttpURLLoad("viewport/viewport-126.html"); |
2313 | 2191 |
2314 FrameTestHelpers::WebViewHelper webViewHelper; | 2192 FrameTestHelpers::WebViewHelper webViewHelper; |
2315 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-126.html", tr ue, 0, 0, setViewportSettings); | 2193 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-126.html", tr ue, 0, 0, setViewportSettings); |
2316 | 2194 |
2317 Page* page = webViewHelper.webViewImpl()->page(); | 2195 Page* page = webViewHelper.webViewImpl()->page(); |
2318 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 2196 PageScaleConstraints constraints = runTest(page, 320, 352); |
2319 | 2197 |
2320 EXPECT_EQ(64, constraints.layoutSize.width()); | 2198 EXPECT_EQ(64, constraints.layoutSize.width()); |
2321 EXPECT_NEAR(70.4, constraints.layoutSize.height(), 0.01f); | 2199 EXPECT_NEAR(70.4, constraints.layoutSize.height(), 0.01f); |
2322 EXPECT_NEAR(5.0f, constraints.initialScale, 0.01f); | 2200 EXPECT_NEAR(5.0f, constraints.initialScale, 0.01f); |
2323 EXPECT_NEAR(5.0f, constraints.minimumScale, 0.01f); | 2201 EXPECT_NEAR(5.0f, constraints.minimumScale, 0.01f); |
2324 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 2202 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
2325 EXPECT_TRUE(page->viewportDescription().userZoom); | 2203 EXPECT_TRUE(page->viewportDescription().userZoom); |
2326 } | 2204 } |
2327 | 2205 |
2328 TEST_F(ViewportTest, viewport127) | 2206 TEST_F(LegacyViewportTest, viewport127) |
2329 { | 2207 { |
2330 UseMockScrollbarSettings mockScrollbarSettings; | |
2331 registerMockedHttpURLLoad("viewport/viewport-127.html"); | 2208 registerMockedHttpURLLoad("viewport/viewport-127.html"); |
2332 | 2209 |
2333 FrameTestHelpers::WebViewHelper webViewHelper; | 2210 FrameTestHelpers::WebViewHelper webViewHelper; |
2334 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-127.html", tr ue, 0, 0, setViewportSettings); | 2211 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-127.html", tr ue, 0, 0, setViewportSettings); |
2335 | 2212 |
2336 Page* page = webViewHelper.webViewImpl()->page(); | 2213 Page* page = webViewHelper.webViewImpl()->page(); |
2337 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 2214 PageScaleConstraints constraints = runTest(page, 320, 352); |
2338 | 2215 |
2339 EXPECT_EQ(64, constraints.layoutSize.width()); | 2216 EXPECT_EQ(64, constraints.layoutSize.width()); |
2340 EXPECT_NEAR(70.4, constraints.layoutSize.height(), 0.01f); | 2217 EXPECT_NEAR(70.4, constraints.layoutSize.height(), 0.01f); |
2341 EXPECT_NEAR(5.0f, constraints.initialScale, 0.01f); | 2218 EXPECT_NEAR(5.0f, constraints.initialScale, 0.01f); |
2342 EXPECT_NEAR(5.0f, constraints.minimumScale, 0.01f); | 2219 EXPECT_NEAR(5.0f, constraints.minimumScale, 0.01f); |
2343 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 2220 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
2344 EXPECT_TRUE(page->viewportDescription().userZoom); | 2221 EXPECT_TRUE(page->viewportDescription().userZoom); |
2345 } | 2222 } |
2346 | 2223 |
2347 TEST_F(ViewportTest, viewport129) | 2224 TEST_F(LegacyViewportTest, viewport129) |
2348 { | 2225 { |
2349 UseMockScrollbarSettings mockScrollbarSettings; | |
2350 registerMockedHttpURLLoad("viewport/viewport-129.html"); | 2226 registerMockedHttpURLLoad("viewport/viewport-129.html"); |
2351 | 2227 |
2352 FrameTestHelpers::WebViewHelper webViewHelper; | 2228 FrameTestHelpers::WebViewHelper webViewHelper; |
2353 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-129.html", tr ue, 0, 0, setViewportSettings); | 2229 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-129.html", tr ue, 0, 0, setViewportSettings); |
2354 | 2230 |
2355 Page* page = webViewHelper.webViewImpl()->page(); | 2231 Page* page = webViewHelper.webViewImpl()->page(); |
2356 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 2232 PageScaleConstraints constraints = runTest(page, 320, 352); |
2357 | 2233 |
2358 EXPECT_EQ(123, constraints.layoutSize.width()); | 2234 EXPECT_EQ(123, constraints.layoutSize.width()); |
2359 EXPECT_NEAR(135.3, constraints.layoutSize.height(), 0.01f); | 2235 EXPECT_NEAR(135.3, constraints.layoutSize.height(), 0.01f); |
2360 EXPECT_NEAR(2.60f, constraints.initialScale, 0.01f); | 2236 EXPECT_NEAR(2.60f, constraints.initialScale, 0.01f); |
2361 EXPECT_NEAR(2.60f, constraints.minimumScale, 0.01f); | 2237 EXPECT_NEAR(2.60f, constraints.minimumScale, 0.01f); |
2362 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 2238 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
2363 EXPECT_TRUE(page->viewportDescription().userZoom); | 2239 EXPECT_TRUE(page->viewportDescription().userZoom); |
2364 } | 2240 } |
2365 | 2241 |
2366 TEST_F(ViewportTest, viewport130) | 2242 TEST_F(LegacyViewportTest, viewport130) |
2367 { | 2243 { |
2368 UseMockScrollbarSettings mockScrollbarSettings; | |
2369 registerMockedHttpURLLoad("viewport/viewport-130.html"); | 2244 registerMockedHttpURLLoad("viewport/viewport-130.html"); |
2370 | 2245 |
2371 FrameTestHelpers::WebViewHelper webViewHelper; | 2246 FrameTestHelpers::WebViewHelper webViewHelper; |
2372 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-130.html", tr ue, 0, 0, setViewportSettings); | 2247 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-130.html", tr ue, 0, 0, setViewportSettings); |
2373 | 2248 |
2374 Page* page = webViewHelper.webViewImpl()->page(); | 2249 Page* page = webViewHelper.webViewImpl()->page(); |
2375 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 2250 PageScaleConstraints constraints = runTest(page, 320, 352); |
2376 | 2251 |
2377 EXPECT_EQ(320, constraints.layoutSize.width()); | 2252 EXPECT_EQ(320, constraints.layoutSize.width()); |
2378 EXPECT_EQ(352, constraints.layoutSize.height()); | 2253 EXPECT_EQ(352, constraints.layoutSize.height()); |
2379 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); | 2254 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); |
2380 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); | 2255 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); |
2381 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 2256 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
2382 EXPECT_TRUE(page->viewportDescription().userZoom); | 2257 EXPECT_TRUE(page->viewportDescription().userZoom); |
2383 } | 2258 } |
2384 | 2259 |
2385 TEST_F(ViewportTest, viewport131) | 2260 TEST_F(LegacyViewportTest, viewport131) |
2386 { | 2261 { |
2387 UseMockScrollbarSettings mockScrollbarSettings; | |
2388 registerMockedHttpURLLoad("viewport/viewport-131.html"); | 2262 registerMockedHttpURLLoad("viewport/viewport-131.html"); |
2389 | 2263 |
2390 FrameTestHelpers::WebViewHelper webViewHelper; | 2264 FrameTestHelpers::WebViewHelper webViewHelper; |
2391 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-131.html", tr ue, 0, 0, setViewportSettings); | 2265 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-131.html", tr ue, 0, 0, setViewportSettings); |
2392 | 2266 |
2393 Page* page = webViewHelper.webViewImpl()->page(); | 2267 Page* page = webViewHelper.webViewImpl()->page(); |
2394 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 2268 PageScaleConstraints constraints = runTest(page, 320, 352); |
2395 | 2269 |
2396 EXPECT_EQ(320, constraints.layoutSize.width()); | 2270 EXPECT_EQ(320, constraints.layoutSize.width()); |
2397 EXPECT_EQ(352, constraints.layoutSize.height()); | 2271 EXPECT_EQ(352, constraints.layoutSize.height()); |
2398 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); | 2272 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); |
2399 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); | 2273 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); |
2400 EXPECT_NEAR(1.0f, constraints.maximumScale, 0.01f); | 2274 EXPECT_NEAR(1.0f, constraints.maximumScale, 0.01f); |
2401 EXPECT_FALSE(page->viewportDescription().userZoom); | 2275 EXPECT_FALSE(page->viewportDescription().userZoom); |
2402 } | 2276 } |
2403 | 2277 |
2404 TEST_F(ViewportTest, viewport132) | 2278 TEST_F(LegacyViewportTest, viewport132) |
2405 { | 2279 { |
2406 UseMockScrollbarSettings mockScrollbarSettings; | |
2407 registerMockedHttpURLLoad("viewport/viewport-132.html"); | 2280 registerMockedHttpURLLoad("viewport/viewport-132.html"); |
2408 | 2281 |
2409 FrameTestHelpers::WebViewHelper webViewHelper; | 2282 FrameTestHelpers::WebViewHelper webViewHelper; |
2410 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-132.html", tr ue, 0, 0, setViewportSettings); | 2283 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-132.html", tr ue, 0, 0, setViewportSettings); |
2411 | 2284 |
2412 Page* page = webViewHelper.webViewImpl()->page(); | 2285 Page* page = webViewHelper.webViewImpl()->page(); |
2413 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 2286 PageScaleConstraints constraints = runTest(page, 320, 352); |
2414 | 2287 |
2415 EXPECT_EQ(320, constraints.layoutSize.width()); | 2288 EXPECT_EQ(320, constraints.layoutSize.width()); |
2416 EXPECT_EQ(352, constraints.layoutSize.height()); | 2289 EXPECT_EQ(352, constraints.layoutSize.height()); |
2417 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); | 2290 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); |
2418 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); | 2291 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); |
2419 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 2292 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
2420 EXPECT_TRUE(page->viewportDescription().userZoom); | 2293 EXPECT_TRUE(page->viewportDescription().userZoom); |
2421 } | 2294 } |
2422 | 2295 |
2423 TEST_F(ViewportTest, viewport133) | 2296 TEST_F(LegacyViewportTest, viewport133) |
2424 { | 2297 { |
2425 UseMockScrollbarSettings mockScrollbarSettings; | |
2426 registerMockedHttpURLLoad("viewport/viewport-133.html"); | 2298 registerMockedHttpURLLoad("viewport/viewport-133.html"); |
2427 | 2299 |
2428 FrameTestHelpers::WebViewHelper webViewHelper; | 2300 FrameTestHelpers::WebViewHelper webViewHelper; |
2429 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-133.html", tr ue, 0, 0, setViewportSettings); | 2301 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-133.html", tr ue, 0, 0, setViewportSettings); |
2430 | 2302 |
2431 Page* page = webViewHelper.webViewImpl()->page(); | 2303 Page* page = webViewHelper.webViewImpl()->page(); |
2432 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 2304 PageScaleConstraints constraints = runTest(page, 320, 352); |
2433 | 2305 |
2434 EXPECT_EQ(980, constraints.layoutSize.width()); | 2306 EXPECT_EQ(980, constraints.layoutSize.width()); |
2435 EXPECT_EQ(1078, constraints.layoutSize.height()); | 2307 EXPECT_EQ(1078, constraints.layoutSize.height()); |
2436 EXPECT_NEAR(10.0f, constraints.initialScale, 0.01f); | 2308 EXPECT_NEAR(10.0f, constraints.initialScale, 0.01f); |
2437 EXPECT_NEAR(10.0f, constraints.minimumScale, 0.01f); | 2309 EXPECT_NEAR(10.0f, constraints.minimumScale, 0.01f); |
2438 EXPECT_NEAR(10.0f, constraints.maximumScale, 0.01f); | 2310 EXPECT_NEAR(10.0f, constraints.maximumScale, 0.01f); |
2439 EXPECT_TRUE(page->viewportDescription().userZoom); | 2311 EXPECT_TRUE(page->viewportDescription().userZoom); |
2440 } | 2312 } |
2441 | 2313 |
2442 TEST_F(ViewportTest, viewport134) | 2314 TEST_F(LegacyViewportTest, viewport134) |
2443 { | 2315 { |
2444 UseMockScrollbarSettings mockScrollbarSettings; | |
2445 registerMockedHttpURLLoad("viewport/viewport-134.html"); | 2316 registerMockedHttpURLLoad("viewport/viewport-134.html"); |
2446 | 2317 |
2447 FrameTestHelpers::WebViewHelper webViewHelper; | 2318 FrameTestHelpers::WebViewHelper webViewHelper; |
2448 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-134.html", tr ue, 0, 0, setViewportSettings); | 2319 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-134.html", tr ue, 0, 0, setViewportSettings); |
2449 | 2320 |
2450 Page* page = webViewHelper.webViewImpl()->page(); | 2321 Page* page = webViewHelper.webViewImpl()->page(); |
2451 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 2322 PageScaleConstraints constraints = runTest(page, 320, 352); |
2452 | 2323 |
2453 EXPECT_EQ(160, constraints.layoutSize.width()); | 2324 EXPECT_EQ(160, constraints.layoutSize.width()); |
2454 EXPECT_EQ(176, constraints.layoutSize.height()); | 2325 EXPECT_EQ(176, constraints.layoutSize.height()); |
2455 EXPECT_NEAR(2.0f, constraints.initialScale, 0.01f); | 2326 EXPECT_NEAR(2.0f, constraints.initialScale, 0.01f); |
2456 EXPECT_NEAR(2.0f, constraints.minimumScale, 0.01f); | 2327 EXPECT_NEAR(2.0f, constraints.minimumScale, 0.01f); |
2457 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 2328 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
2458 EXPECT_TRUE(page->viewportDescription().userZoom); | 2329 EXPECT_TRUE(page->viewportDescription().userZoom); |
2459 } | 2330 } |
2460 | 2331 |
2461 TEST_F(ViewportTest, viewport135) | 2332 TEST_F(LegacyViewportTest, viewport135) |
2462 { | 2333 { |
2463 UseMockScrollbarSettings mockScrollbarSettings; | |
2464 registerMockedHttpURLLoad("viewport/viewport-135.html"); | 2334 registerMockedHttpURLLoad("viewport/viewport-135.html"); |
2465 | 2335 |
2466 FrameTestHelpers::WebViewHelper webViewHelper; | 2336 FrameTestHelpers::WebViewHelper webViewHelper; |
2467 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-135.html", tr ue, 0, 0, setViewportSettings); | 2337 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-135.html", tr ue, 0, 0, setViewportSettings); |
2468 | 2338 |
2469 Page* page = webViewHelper.webViewImpl()->page(); | 2339 Page* page = webViewHelper.webViewImpl()->page(); |
2470 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 2340 PageScaleConstraints constraints = runTest(page, 320, 352); |
2471 | 2341 |
2472 EXPECT_EQ(980, constraints.layoutSize.width()); | 2342 EXPECT_EQ(980, constraints.layoutSize.width()); |
2473 EXPECT_EQ(1078, constraints.layoutSize.height()); | 2343 EXPECT_EQ(1078, constraints.layoutSize.height()); |
2474 EXPECT_NEAR(0.33f, constraints.initialScale, 0.01f); | 2344 EXPECT_NEAR(0.33f, constraints.initialScale, 0.01f); |
2475 EXPECT_NEAR(0.33f, constraints.minimumScale, 0.01f); | 2345 EXPECT_NEAR(0.33f, constraints.minimumScale, 0.01f); |
2476 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 2346 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
2477 EXPECT_TRUE(page->viewportDescription().userZoom); | 2347 EXPECT_TRUE(page->viewportDescription().userZoom); |
2478 } | 2348 } |
2479 | 2349 |
2480 TEST_F(ViewportTest, viewport136) | 2350 TEST_F(LegacyViewportTest, viewport136) |
2481 { | 2351 { |
2482 UseMockScrollbarSettings mockScrollbarSettings; | |
2483 registerMockedHttpURLLoad("viewport/viewport-136.html"); | 2352 registerMockedHttpURLLoad("viewport/viewport-136.html"); |
2484 | 2353 |
2485 FrameTestHelpers::WebViewHelper webViewHelper; | 2354 FrameTestHelpers::WebViewHelper webViewHelper; |
2486 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-136.html", tr ue, 0, 0, setViewportSettings); | 2355 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-136.html", tr ue, 0, 0, setViewportSettings); |
2487 | 2356 |
2488 Page* page = webViewHelper.webViewImpl()->page(); | 2357 Page* page = webViewHelper.webViewImpl()->page(); |
2489 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 2358 PageScaleConstraints constraints = runTest(page, 320, 352); |
2490 | 2359 |
2491 EXPECT_EQ(320, constraints.layoutSize.width()); | 2360 EXPECT_EQ(320, constraints.layoutSize.width()); |
2492 EXPECT_EQ(352, constraints.layoutSize.height()); | 2361 EXPECT_EQ(352, constraints.layoutSize.height()); |
2493 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); | 2362 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); |
2494 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); | 2363 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); |
2495 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 2364 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
2496 EXPECT_TRUE(page->viewportDescription().userZoom); | 2365 EXPECT_TRUE(page->viewportDescription().userZoom); |
2497 } | 2366 } |
2498 | 2367 |
2499 TEST_F(ViewportTest, viewport137) | 2368 TEST_F(LegacyViewportTest, viewport137) |
2500 { | 2369 { |
2501 UseMockScrollbarSettings mockScrollbarSettings; | |
2502 registerMockedHttpURLLoad("viewport/viewport-137.html"); | 2370 registerMockedHttpURLLoad("viewport/viewport-137.html"); |
2503 | 2371 |
2504 FrameTestHelpers::WebViewHelper webViewHelper; | 2372 FrameTestHelpers::WebViewHelper webViewHelper; |
2505 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-137.html", tr ue, 0, 0, setViewportSettings); | 2373 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-137.html", tr ue, 0, 0, setViewportSettings); |
2506 | 2374 |
2507 Page* page = webViewHelper.webViewImpl()->page(); | 2375 Page* page = webViewHelper.webViewImpl()->page(); |
2508 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 2376 PageScaleConstraints constraints = runTest(page, 320, 352); |
2509 | 2377 |
2510 EXPECT_EQ(980, constraints.layoutSize.width()); | 2378 EXPECT_EQ(980, constraints.layoutSize.width()); |
2511 EXPECT_EQ(1078, constraints.layoutSize.height()); | 2379 EXPECT_EQ(1078, constraints.layoutSize.height()); |
2512 EXPECT_NEAR(0.33f, constraints.initialScale, 0.01f); | 2380 EXPECT_NEAR(0.33f, constraints.initialScale, 0.01f); |
2513 EXPECT_NEAR(0.33f, constraints.minimumScale, 0.01f); | 2381 EXPECT_NEAR(0.33f, constraints.minimumScale, 0.01f); |
2514 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 2382 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
2515 EXPECT_TRUE(page->viewportDescription().userZoom); | 2383 EXPECT_TRUE(page->viewportDescription().userZoom); |
2516 } | 2384 } |
2517 | 2385 |
2518 TEST_F(ViewportTest, viewportLegacyHandheldFriendly) | 2386 TEST_F(LegacyViewportTest, viewportLegacyHandheldFriendly) |
2519 { | 2387 { |
2520 UseMockScrollbarSettings mockScrollbarSettings; | |
2521 registerMockedHttpURLLoad("viewport/viewport-legacy-handheldfriendly.html"); | 2388 registerMockedHttpURLLoad("viewport/viewport-legacy-handheldfriendly.html"); |
2522 | 2389 |
2523 FrameTestHelpers::WebViewHelper webViewHelper; | 2390 FrameTestHelpers::WebViewHelper webViewHelper; |
2524 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-legacy-handhe ldfriendly.html", true, 0, 0, setViewportSettings); | 2391 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-legacy-handhe ldfriendly.html", true, 0, 0, setViewportSettings); |
2525 | 2392 |
2526 Page* page = webViewHelper.webViewImpl()->page(); | 2393 Page* page = webViewHelper.webViewImpl()->page(); |
2527 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 2394 PageScaleConstraints constraints = runTest(page, 320, 352); |
2528 | 2395 |
2529 EXPECT_EQ(320, constraints.layoutSize.width()); | 2396 EXPECT_EQ(320, constraints.layoutSize.width()); |
2530 EXPECT_EQ(352, constraints.layoutSize.height()); | 2397 EXPECT_EQ(352, constraints.layoutSize.height()); |
2531 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); | 2398 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); |
2532 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); | 2399 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); |
2533 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 2400 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
2534 EXPECT_TRUE(page->viewportDescription().userZoom); | 2401 EXPECT_TRUE(page->viewportDescription().userZoom); |
2535 } | 2402 } |
2536 | 2403 |
2537 static void setQuirkViewportSettings(WebSettings* settings) | 2404 static void setQuirkViewportSettings(WebSettings* settings) |
2538 { | 2405 { |
2539 setViewportSettings(settings); | 2406 setViewportSettings(settings); |
2540 | 2407 |
2541 // This quirk allows content attributes of meta viewport tags to be merged. | 2408 // This quirk allows content attributes of meta viewport tags to be merged. |
2542 settings->setViewportMetaMergeContentQuirk(true); | 2409 settings->setViewportMetaMergeContentQuirk(true); |
2543 } | 2410 } |
2544 | 2411 |
2545 TEST_F(ViewportTest, viewportLegacyMergeQuirk1) | 2412 TEST_F(LegacyViewportTest, viewportLegacyMergeQuirk1) |
2546 { | 2413 { |
2547 UseMockScrollbarSettings mockScrollbarSettings; | |
2548 registerMockedHttpURLLoad("viewport/viewport-legacy-merge-quirk-1.html"); | 2414 registerMockedHttpURLLoad("viewport/viewport-legacy-merge-quirk-1.html"); |
2549 | 2415 |
2550 FrameTestHelpers::WebViewHelper webViewHelper; | 2416 FrameTestHelpers::WebViewHelper webViewHelper; |
2551 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-legacy-merge- quirk-1.html", true, 0, 0, setQuirkViewportSettings); | 2417 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-legacy-merge- quirk-1.html", true, 0, 0, setQuirkViewportSettings); |
2552 | 2418 |
2553 Page* page = webViewHelper.webViewImpl()->page(); | 2419 Page* page = webViewHelper.webViewImpl()->page(); |
2554 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 2420 PageScaleConstraints constraints = runTest(page, 320, 352); |
2555 | 2421 |
2556 EXPECT_EQ(640, constraints.layoutSize.width()); | 2422 EXPECT_EQ(640, constraints.layoutSize.width()); |
2557 EXPECT_EQ(704, constraints.layoutSize.height()); | 2423 EXPECT_EQ(704, constraints.layoutSize.height()); |
2558 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); | 2424 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); |
2559 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); | 2425 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); |
2560 EXPECT_NEAR(1.0f, constraints.maximumScale, 0.01f); | 2426 EXPECT_NEAR(1.0f, constraints.maximumScale, 0.01f); |
2561 EXPECT_FALSE(page->viewportDescription().userZoom); | 2427 EXPECT_FALSE(page->viewportDescription().userZoom); |
2562 } | 2428 } |
2563 | 2429 |
2564 TEST_F(ViewportTest, viewportLegacyMergeQuirk2) | 2430 TEST_F(LegacyViewportTest, viewportLegacyMergeQuirk2) |
2565 { | 2431 { |
2566 UseMockScrollbarSettings mockScrollbarSettings; | |
2567 registerMockedHttpURLLoad("viewport/viewport-legacy-merge-quirk-2.html"); | 2432 registerMockedHttpURLLoad("viewport/viewport-legacy-merge-quirk-2.html"); |
2568 | 2433 |
2569 FrameTestHelpers::WebViewHelper webViewHelper; | 2434 FrameTestHelpers::WebViewHelper webViewHelper; |
2570 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-legacy-merge- quirk-2.html", true, 0, 0, setQuirkViewportSettings); | 2435 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-legacy-merge- quirk-2.html", true, 0, 0, setQuirkViewportSettings); |
2571 | 2436 |
2572 Page* page = webViewHelper.webViewImpl()->page(); | 2437 Page* page = webViewHelper.webViewImpl()->page(); |
2573 | 2438 |
2574 // This quirk allows content attributes of meta viewport tags to be merged. | 2439 // This quirk allows content attributes of meta viewport tags to be merged. |
2575 page->settings().setViewportMetaMergeContentQuirk(true); | 2440 page->settings().setViewportMetaMergeContentQuirk(true); |
2576 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 2441 PageScaleConstraints constraints = runTest(page, 320, 352); |
2577 | 2442 |
2578 EXPECT_EQ(500, constraints.layoutSize.width()); | 2443 EXPECT_EQ(500, constraints.layoutSize.width()); |
2579 EXPECT_EQ(550, constraints.layoutSize.height()); | 2444 EXPECT_EQ(550, constraints.layoutSize.height()); |
2580 EXPECT_NEAR(2.0f, constraints.initialScale, 0.01f); | 2445 EXPECT_NEAR(2.0f, constraints.initialScale, 0.01f); |
2581 EXPECT_NEAR(2.0f, constraints.minimumScale, 0.01f); | 2446 EXPECT_NEAR(2.0f, constraints.minimumScale, 0.01f); |
2582 EXPECT_NEAR(2.0f, constraints.maximumScale, 0.01f); | 2447 EXPECT_NEAR(2.0f, constraints.maximumScale, 0.01f); |
2583 EXPECT_FALSE(page->viewportDescription().userZoom); | 2448 EXPECT_FALSE(page->viewportDescription().userZoom); |
2584 } | 2449 } |
2585 | 2450 |
2586 TEST_F(ViewportTest, viewportLegacyMobileOptimizedMetaWithoutContent) | 2451 TEST_F(LegacyViewportTest, viewportLegacyMobileOptimizedMetaWithoutContent) |
2587 { | 2452 { |
2588 UseMockScrollbarSettings mockScrollbarSettings; | |
2589 registerMockedHttpURLLoad("viewport/viewport-legacy-mobileoptimized.html"); | 2453 registerMockedHttpURLLoad("viewport/viewport-legacy-mobileoptimized.html"); |
2590 | 2454 |
2591 FrameTestHelpers::WebViewHelper webViewHelper; | 2455 FrameTestHelpers::WebViewHelper webViewHelper; |
2592 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-legacy-mobile optimized.html", true, 0, 0, setViewportSettings); | 2456 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-legacy-mobile optimized.html", true, 0, 0, setViewportSettings); |
2593 | 2457 |
2594 Page* page = webViewHelper.webViewImpl()->page(); | 2458 Page* page = webViewHelper.webViewImpl()->page(); |
2595 | 2459 |
2596 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 2460 PageScaleConstraints constraints = runTest(page, 320, 352); |
2597 | 2461 |
2598 EXPECT_EQ(320, constraints.layoutSize.width()); | 2462 EXPECT_EQ(320, constraints.layoutSize.width()); |
2599 EXPECT_EQ(352, constraints.layoutSize.height()); | 2463 EXPECT_EQ(352, constraints.layoutSize.height()); |
2600 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); | 2464 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); |
2601 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); | 2465 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); |
2602 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 2466 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
2603 EXPECT_TRUE(page->viewportDescription().userZoom); | 2467 EXPECT_TRUE(page->viewportDescription().userZoom); |
2604 } | 2468 } |
2605 | 2469 |
2606 TEST_F(ViewportTest, viewportLegacyMobileOptimizedMetaWith0) | 2470 TEST_F(LegacyViewportTest, viewportLegacyMobileOptimizedMetaWith0) |
2607 { | 2471 { |
2608 UseMockScrollbarSettings mockScrollbarSettings; | |
2609 registerMockedHttpURLLoad("viewport/viewport-legacy-mobileoptimized-2.html") ; | 2472 registerMockedHttpURLLoad("viewport/viewport-legacy-mobileoptimized-2.html") ; |
2610 | 2473 |
2611 FrameTestHelpers::WebViewHelper webViewHelper; | 2474 FrameTestHelpers::WebViewHelper webViewHelper; |
2612 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-legacy-mobile optimized-2.html", true, 0, 0, setViewportSettings); | 2475 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-legacy-mobile optimized-2.html", true, 0, 0, setViewportSettings); |
2613 | 2476 |
2614 Page* page = webViewHelper.webViewImpl()->page(); | 2477 Page* page = webViewHelper.webViewImpl()->page(); |
2615 | 2478 |
2616 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 2479 PageScaleConstraints constraints = runTest(page, 320, 352); |
2617 | 2480 |
2618 EXPECT_EQ(320, constraints.layoutSize.width()); | 2481 EXPECT_EQ(320, constraints.layoutSize.width()); |
2619 EXPECT_EQ(352, constraints.layoutSize.height()); | 2482 EXPECT_EQ(352, constraints.layoutSize.height()); |
2620 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); | 2483 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); |
2621 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); | 2484 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); |
2622 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 2485 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
2623 EXPECT_TRUE(page->viewportDescription().userZoom); | 2486 EXPECT_TRUE(page->viewportDescription().userZoom); |
2624 } | 2487 } |
2625 | 2488 |
2626 TEST_F(ViewportTest, viewportLegacyMobileOptimizedMetaWith400) | 2489 TEST_F(LegacyViewportTest, viewportLegacyMobileOptimizedMetaWith400) |
2627 { | 2490 { |
2628 UseMockScrollbarSettings mockScrollbarSettings; | |
2629 registerMockedHttpURLLoad("viewport/viewport-legacy-mobileoptimized-2.html") ; | 2491 registerMockedHttpURLLoad("viewport/viewport-legacy-mobileoptimized-2.html") ; |
2630 | 2492 |
2631 FrameTestHelpers::WebViewHelper webViewHelper; | 2493 FrameTestHelpers::WebViewHelper webViewHelper; |
2632 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-legacy-mobile optimized-2.html", true, 0, 0, setViewportSettings); | 2494 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-legacy-mobile optimized-2.html", true, 0, 0, setViewportSettings); |
2633 | 2495 |
2634 Page* page = webViewHelper.webViewImpl()->page(); | 2496 Page* page = webViewHelper.webViewImpl()->page(); |
2635 | 2497 |
2636 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 2498 PageScaleConstraints constraints = runTest(page, 320, 352); |
2637 | 2499 |
2638 EXPECT_EQ(320, constraints.layoutSize.width()); | 2500 EXPECT_EQ(320, constraints.layoutSize.width()); |
2639 EXPECT_EQ(352, constraints.layoutSize.height()); | 2501 EXPECT_EQ(352, constraints.layoutSize.height()); |
2640 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); | 2502 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); |
2641 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); | 2503 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); |
2642 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 2504 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
2643 EXPECT_TRUE(page->viewportDescription().userZoom); | 2505 EXPECT_TRUE(page->viewportDescription().userZoom); |
2644 } | 2506 } |
2645 | 2507 |
2646 TEST_F(ViewportTest, viewportLegacyOrdering2) | 2508 TEST_F(LegacyViewportTest, viewportLegacyOrdering2) |
2647 { | 2509 { |
2648 UseMockScrollbarSettings mockScrollbarSettings; | |
2649 registerMockedHttpURLLoad("viewport/viewport-legacy-ordering-2.html"); | 2510 registerMockedHttpURLLoad("viewport/viewport-legacy-ordering-2.html"); |
2650 | 2511 |
2651 FrameTestHelpers::WebViewHelper webViewHelper; | 2512 FrameTestHelpers::WebViewHelper webViewHelper; |
2652 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-legacy-orderi ng-2.html", true, 0, 0, setViewportSettings); | 2513 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-legacy-orderi ng-2.html", true, 0, 0, setViewportSettings); |
2653 | 2514 |
2654 Page* page = webViewHelper.webViewImpl()->page(); | 2515 Page* page = webViewHelper.webViewImpl()->page(); |
2655 | 2516 |
2656 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 2517 PageScaleConstraints constraints = runTest(page, 320, 352); |
2657 | 2518 |
2658 EXPECT_EQ(300, constraints.layoutSize.width()); | 2519 EXPECT_EQ(300, constraints.layoutSize.width()); |
2659 EXPECT_EQ(330, constraints.layoutSize.height()); | 2520 EXPECT_EQ(330, constraints.layoutSize.height()); |
2660 EXPECT_NEAR(1.07f, constraints.initialScale, 0.01f); | 2521 EXPECT_NEAR(1.07f, constraints.initialScale, 0.01f); |
2661 EXPECT_NEAR(1.07f, constraints.minimumScale, 0.01f); | 2522 EXPECT_NEAR(1.07f, constraints.minimumScale, 0.01f); |
2662 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 2523 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
2663 EXPECT_TRUE(page->viewportDescription().userZoom); | 2524 EXPECT_TRUE(page->viewportDescription().userZoom); |
2664 } | 2525 } |
2665 | 2526 |
2666 TEST_F(ViewportTest, viewportLegacyOrdering3) | 2527 TEST_F(LegacyViewportTest, viewportLegacyOrdering3) |
2667 { | 2528 { |
2668 UseMockScrollbarSettings mockScrollbarSettings; | |
2669 registerMockedHttpURLLoad("viewport/viewport-legacy-ordering-3.html"); | 2529 registerMockedHttpURLLoad("viewport/viewport-legacy-ordering-3.html"); |
2670 | 2530 |
2671 FrameTestHelpers::WebViewHelper webViewHelper; | 2531 FrameTestHelpers::WebViewHelper webViewHelper; |
2672 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-legacy-orderi ng-3.html", true, 0, 0, setViewportSettings); | 2532 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-legacy-orderi ng-3.html", true, 0, 0, setViewportSettings); |
2673 | 2533 |
2674 Page* page = webViewHelper.webViewImpl()->page(); | 2534 Page* page = webViewHelper.webViewImpl()->page(); |
2675 | 2535 |
2676 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 2536 PageScaleConstraints constraints = runTest(page, 320, 352); |
2677 | 2537 |
2678 EXPECT_EQ(300, constraints.layoutSize.width()); | 2538 EXPECT_EQ(300, constraints.layoutSize.width()); |
2679 EXPECT_EQ(330, constraints.layoutSize.height()); | 2539 EXPECT_EQ(330, constraints.layoutSize.height()); |
2680 EXPECT_NEAR(1.07f, constraints.initialScale, 0.01f); | 2540 EXPECT_NEAR(1.07f, constraints.initialScale, 0.01f); |
2681 EXPECT_NEAR(1.07f, constraints.minimumScale, 0.01f); | 2541 EXPECT_NEAR(1.07f, constraints.minimumScale, 0.01f); |
2682 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 2542 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
2683 EXPECT_TRUE(page->viewportDescription().userZoom); | 2543 EXPECT_TRUE(page->viewportDescription().userZoom); |
2684 } | 2544 } |
2685 | 2545 |
2686 TEST_F(ViewportTest, viewportLegacyOrdering4) | 2546 TEST_F(LegacyViewportTest, viewportLegacyOrdering4) |
2687 { | 2547 { |
2688 UseMockScrollbarSettings mockScrollbarSettings; | |
2689 registerMockedHttpURLLoad("viewport/viewport-legacy-ordering-4.html"); | 2548 registerMockedHttpURLLoad("viewport/viewport-legacy-ordering-4.html"); |
2690 | 2549 |
2691 FrameTestHelpers::WebViewHelper webViewHelper; | 2550 FrameTestHelpers::WebViewHelper webViewHelper; |
2692 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-legacy-orderi ng-4.html", true, 0, 0, setViewportSettings); | 2551 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-legacy-orderi ng-4.html", true, 0, 0, setViewportSettings); |
2693 | 2552 |
2694 Page* page = webViewHelper.webViewImpl()->page(); | 2553 Page* page = webViewHelper.webViewImpl()->page(); |
2695 | 2554 |
2696 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 2555 PageScaleConstraints constraints = runTest(page, 320, 352); |
2697 | 2556 |
2698 EXPECT_EQ(300, constraints.layoutSize.width()); | 2557 EXPECT_EQ(300, constraints.layoutSize.width()); |
2699 EXPECT_EQ(330, constraints.layoutSize.height()); | 2558 EXPECT_EQ(330, constraints.layoutSize.height()); |
2700 EXPECT_NEAR(1.07f, constraints.initialScale, 0.01f); | 2559 EXPECT_NEAR(1.07f, constraints.initialScale, 0.01f); |
2701 EXPECT_NEAR(1.07f, constraints.minimumScale, 0.01f); | 2560 EXPECT_NEAR(1.07f, constraints.minimumScale, 0.01f); |
2702 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 2561 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
2703 EXPECT_TRUE(page->viewportDescription().userZoom); | 2562 EXPECT_TRUE(page->viewportDescription().userZoom); |
2704 } | 2563 } |
2705 | 2564 |
2706 TEST_F(ViewportTest, viewportLegacyOrdering5) | 2565 TEST_F(LegacyViewportTest, viewportLegacyOrdering5) |
2707 { | 2566 { |
2708 UseMockScrollbarSettings mockScrollbarSettings; | |
2709 registerMockedHttpURLLoad("viewport/viewport-legacy-ordering-5.html"); | 2567 registerMockedHttpURLLoad("viewport/viewport-legacy-ordering-5.html"); |
2710 | 2568 |
2711 FrameTestHelpers::WebViewHelper webViewHelper; | 2569 FrameTestHelpers::WebViewHelper webViewHelper; |
2712 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-legacy-orderi ng-5.html", true, 0, 0, setViewportSettings); | 2570 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-legacy-orderi ng-5.html", true, 0, 0, setViewportSettings); |
2713 | 2571 |
2714 Page* page = webViewHelper.webViewImpl()->page(); | 2572 Page* page = webViewHelper.webViewImpl()->page(); |
2715 | 2573 |
2716 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 2574 PageScaleConstraints constraints = runTest(page, 320, 352); |
2717 | 2575 |
2718 EXPECT_EQ(320, constraints.layoutSize.width()); | 2576 EXPECT_EQ(320, constraints.layoutSize.width()); |
2719 EXPECT_EQ(352, constraints.layoutSize.height()); | 2577 EXPECT_EQ(352, constraints.layoutSize.height()); |
2720 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); | 2578 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); |
2721 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); | 2579 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); |
2722 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 2580 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
2723 EXPECT_TRUE(page->viewportDescription().userZoom); | 2581 EXPECT_TRUE(page->viewportDescription().userZoom); |
2724 } | 2582 } |
2725 | 2583 |
2726 TEST_F(ViewportTest, viewportLegacyOrdering6) | 2584 TEST_F(LegacyViewportTest, viewportLegacyOrdering6) |
2727 { | 2585 { |
2728 UseMockScrollbarSettings mockScrollbarSettings; | |
2729 registerMockedHttpURLLoad("viewport/viewport-legacy-ordering-6.html"); | 2586 registerMockedHttpURLLoad("viewport/viewport-legacy-ordering-6.html"); |
2730 | 2587 |
2731 FrameTestHelpers::WebViewHelper webViewHelper; | 2588 FrameTestHelpers::WebViewHelper webViewHelper; |
2732 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-legacy-orderi ng-6.html", true, 0, 0, setViewportSettings); | 2589 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-legacy-orderi ng-6.html", true, 0, 0, setViewportSettings); |
2733 | 2590 |
2734 Page* page = webViewHelper.webViewImpl()->page(); | 2591 Page* page = webViewHelper.webViewImpl()->page(); |
2735 | 2592 |
2736 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 2593 PageScaleConstraints constraints = runTest(page, 320, 352); |
2737 | 2594 |
2738 EXPECT_EQ(320, constraints.layoutSize.width()); | 2595 EXPECT_EQ(320, constraints.layoutSize.width()); |
2739 EXPECT_EQ(352, constraints.layoutSize.height()); | 2596 EXPECT_EQ(352, constraints.layoutSize.height()); |
2740 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); | 2597 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); |
2741 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); | 2598 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); |
2742 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 2599 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
2743 EXPECT_TRUE(page->viewportDescription().userZoom); | 2600 EXPECT_TRUE(page->viewportDescription().userZoom); |
2744 } | 2601 } |
2745 | 2602 |
2746 TEST_F(ViewportTest, viewportLegacyOrdering7) | 2603 TEST_F(LegacyViewportTest, viewportLegacyOrdering7) |
2747 { | 2604 { |
2748 UseMockScrollbarSettings mockScrollbarSettings; | |
2749 registerMockedHttpURLLoad("viewport/viewport-legacy-ordering-7.html"); | 2605 registerMockedHttpURLLoad("viewport/viewport-legacy-ordering-7.html"); |
2750 | 2606 |
2751 FrameTestHelpers::WebViewHelper webViewHelper; | 2607 FrameTestHelpers::WebViewHelper webViewHelper; |
2752 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-legacy-orderi ng-7.html", true, 0, 0, setViewportSettings); | 2608 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-legacy-orderi ng-7.html", true, 0, 0, setViewportSettings); |
2753 | 2609 |
2754 Page* page = webViewHelper.webViewImpl()->page(); | 2610 Page* page = webViewHelper.webViewImpl()->page(); |
2755 | 2611 |
2756 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 2612 PageScaleConstraints constraints = runTest(page, 320, 352); |
2757 | 2613 |
2758 EXPECT_EQ(300, constraints.layoutSize.width()); | 2614 EXPECT_EQ(300, constraints.layoutSize.width()); |
2759 EXPECT_EQ(330, constraints.layoutSize.height()); | 2615 EXPECT_EQ(330, constraints.layoutSize.height()); |
2760 EXPECT_NEAR(1.07f, constraints.initialScale, 0.01f); | 2616 EXPECT_NEAR(1.07f, constraints.initialScale, 0.01f); |
2761 EXPECT_NEAR(1.07f, constraints.minimumScale, 0.01f); | 2617 EXPECT_NEAR(1.07f, constraints.minimumScale, 0.01f); |
2762 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 2618 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
2763 EXPECT_TRUE(page->viewportDescription().userZoom); | 2619 EXPECT_TRUE(page->viewportDescription().userZoom); |
2764 } | 2620 } |
2765 | 2621 |
2766 TEST_F(ViewportTest, viewportLegacyOrdering8) | 2622 TEST_F(LegacyViewportTest, viewportLegacyOrdering8) |
2767 { | 2623 { |
2768 UseMockScrollbarSettings mockScrollbarSettings; | |
2769 registerMockedHttpURLLoad("viewport/viewport-legacy-ordering-8.html"); | 2624 registerMockedHttpURLLoad("viewport/viewport-legacy-ordering-8.html"); |
2770 | 2625 |
2771 FrameTestHelpers::WebViewHelper webViewHelper; | 2626 FrameTestHelpers::WebViewHelper webViewHelper; |
2772 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-legacy-orderi ng-8.html", true, 0, 0, setViewportSettings); | 2627 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-legacy-orderi ng-8.html", true, 0, 0, setViewportSettings); |
2773 | 2628 |
2774 Page* page = webViewHelper.webViewImpl()->page(); | 2629 Page* page = webViewHelper.webViewImpl()->page(); |
2775 | 2630 |
2776 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 2631 PageScaleConstraints constraints = runTest(page, 320, 352); |
2777 | 2632 |
2778 EXPECT_EQ(300, constraints.layoutSize.width()); | 2633 EXPECT_EQ(300, constraints.layoutSize.width()); |
2779 EXPECT_EQ(330, constraints.layoutSize.height()); | 2634 EXPECT_EQ(330, constraints.layoutSize.height()); |
2780 EXPECT_NEAR(1.07f, constraints.initialScale, 0.01f); | 2635 EXPECT_NEAR(1.07f, constraints.initialScale, 0.01f); |
2781 EXPECT_NEAR(1.07f, constraints.minimumScale, 0.01f); | 2636 EXPECT_NEAR(1.07f, constraints.minimumScale, 0.01f); |
2782 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 2637 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
2783 EXPECT_TRUE(page->viewportDescription().userZoom); | 2638 EXPECT_TRUE(page->viewportDescription().userZoom); |
2784 } | 2639 } |
2785 | 2640 |
2786 TEST_F(ViewportTest, viewportLegacyEmptyAtViewportDoesntOverrideViewportMeta) | 2641 TEST_F(LegacyViewportTest, viewportLegacyEmptyAtViewportDoesntOverrideViewportMe ta) |
2787 { | 2642 { |
2788 UseMockScrollbarSettings mockScrollbarSettings; | |
2789 registerMockedHttpURLLoad("viewport/viewport-legacy-ordering-10.html"); | 2643 registerMockedHttpURLLoad("viewport/viewport-legacy-ordering-10.html"); |
2790 | 2644 |
2791 FrameTestHelpers::WebViewHelper webViewHelper; | 2645 FrameTestHelpers::WebViewHelper webViewHelper; |
2792 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-legacy-orderi ng-10.html", true, 0, 0, setViewportSettings); | 2646 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-legacy-orderi ng-10.html", true, 0, 0, setViewportSettings); |
2793 | 2647 |
2794 Page* page = webViewHelper.webViewImpl()->page(); | 2648 Page* page = webViewHelper.webViewImpl()->page(); |
2795 PageScaleConstraints constraints = runViewportTest(page, 800, 600); | 2649 PageScaleConstraints constraints = runTest(page, 800, 600); |
2796 | 2650 |
2797 EXPECT_EQ(5000, constraints.layoutSize.width()); | 2651 EXPECT_EQ(5000, constraints.layoutSize.width()); |
2798 } | 2652 } |
2799 | 2653 |
2800 TEST_F(ViewportTest, viewportLegacyDefaultValueChangedByXHTMLMP) | 2654 TEST_F(LegacyViewportTest, viewportLegacyDefaultValueChangedByXHTMLMP) |
2801 { | 2655 { |
2802 UseMockScrollbarSettings mockScrollbarSettings; | |
2803 registerMockedHttpURLLoad("viewport/viewport-legacy-xhtmlmp.html"); | 2656 registerMockedHttpURLLoad("viewport/viewport-legacy-xhtmlmp.html"); |
2804 | 2657 |
2805 FrameTestHelpers::WebViewHelper webViewHelper; | 2658 FrameTestHelpers::WebViewHelper webViewHelper; |
2806 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-legacy-xhtmlm p.html", true, 0, 0, setViewportSettings); | 2659 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-legacy-xhtmlm p.html", true, 0, 0, setViewportSettings); |
2807 | 2660 |
2808 Page* page = webViewHelper.webViewImpl()->page(); | 2661 Page* page = webViewHelper.webViewImpl()->page(); |
2809 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 2662 PageScaleConstraints constraints = runTest(page, 320, 352); |
2810 | 2663 |
2811 EXPECT_EQ(320, constraints.layoutSize.width()); | 2664 EXPECT_EQ(320, constraints.layoutSize.width()); |
2812 EXPECT_EQ(352, constraints.layoutSize.height()); | 2665 EXPECT_EQ(352, constraints.layoutSize.height()); |
2813 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); | 2666 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); |
2814 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); | 2667 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); |
2815 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 2668 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
2816 EXPECT_TRUE(page->viewportDescription().userZoom); | 2669 EXPECT_TRUE(page->viewportDescription().userZoom); |
2817 } | 2670 } |
2818 | 2671 |
2819 TEST_F(ViewportTest, viewportLegacyDefaultValueChangedByXHTMLMPAndOverriddenByMe ta) | 2672 TEST_F(LegacyViewportTest, viewportLegacyDefaultValueChangedByXHTMLMPAndOverridd enByMeta) |
2820 { | 2673 { |
2821 UseMockScrollbarSettings mockScrollbarSettings; | |
2822 registerMockedHttpURLLoad("viewport/viewport-legacy-xhtmlmp-misplaced-doctyp e.html"); | 2674 registerMockedHttpURLLoad("viewport/viewport-legacy-xhtmlmp-misplaced-doctyp e.html"); |
2823 | 2675 |
2824 FrameTestHelpers::WebViewHelper webViewHelper; | 2676 FrameTestHelpers::WebViewHelper webViewHelper; |
2825 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-legacy-xhtmlm p-misplaced-doctype.html", true, 0, 0, setViewportSettings); | 2677 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-legacy-xhtmlm p-misplaced-doctype.html", true, 0, 0, setViewportSettings); |
2826 | 2678 |
2827 Page* page = webViewHelper.webViewImpl()->page(); | 2679 Page* page = webViewHelper.webViewImpl()->page(); |
2828 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 2680 PageScaleConstraints constraints = runTest(page, 320, 352); |
2829 | 2681 |
2830 EXPECT_EQ(640, constraints.layoutSize.width()); | 2682 EXPECT_EQ(640, constraints.layoutSize.width()); |
2831 EXPECT_EQ(704, constraints.layoutSize.height()); | 2683 EXPECT_EQ(704, constraints.layoutSize.height()); |
2832 EXPECT_NEAR(0.5f, constraints.initialScale, 0.01f); | 2684 EXPECT_NEAR(0.5f, constraints.initialScale, 0.01f); |
2833 EXPECT_NEAR(0.5f, constraints.minimumScale, 0.01f); | 2685 EXPECT_NEAR(0.5f, constraints.minimumScale, 0.01f); |
2834 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 2686 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
2835 EXPECT_TRUE(page->viewportDescription().userZoom); | 2687 EXPECT_TRUE(page->viewportDescription().userZoom); |
2836 } | 2688 } |
2837 | 2689 |
2838 TEST_F(ViewportTest, viewportLegacyXHTMLMPOrdering) | 2690 TEST_F(LegacyViewportTest, viewportLegacyXHTMLMPOrdering) |
2839 { | 2691 { |
2840 UseMockScrollbarSettings mockScrollbarSettings; | |
2841 registerMockedHttpURLLoad("viewport/viewport-legacy-xhtmlmp-ordering.html"); | 2692 registerMockedHttpURLLoad("viewport/viewport-legacy-xhtmlmp-ordering.html"); |
2842 | 2693 |
2843 FrameTestHelpers::WebViewHelper webViewHelper; | 2694 FrameTestHelpers::WebViewHelper webViewHelper; |
2844 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-legacy-xhtmlm p-ordering.html", true, 0, 0, setViewportSettings); | 2695 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-legacy-xhtmlm p-ordering.html", true, 0, 0, setViewportSettings); |
2845 | 2696 |
2846 Page* page = webViewHelper.webViewImpl()->page(); | 2697 Page* page = webViewHelper.webViewImpl()->page(); |
2847 PageScaleConstraints constraints = runViewportTest(page, 320, 352); | 2698 PageScaleConstraints constraints = runTest(page, 320, 352); |
2848 | 2699 |
2849 EXPECT_EQ(640, constraints.layoutSize.width()); | 2700 EXPECT_EQ(640, constraints.layoutSize.width()); |
2850 EXPECT_EQ(704, constraints.layoutSize.height()); | 2701 EXPECT_EQ(704, constraints.layoutSize.height()); |
2851 EXPECT_NEAR(0.5f, constraints.initialScale, 0.01f); | 2702 EXPECT_NEAR(0.5f, constraints.initialScale, 0.01f); |
2852 EXPECT_NEAR(0.5f, constraints.minimumScale, 0.01f); | 2703 EXPECT_NEAR(0.5f, constraints.minimumScale, 0.01f); |
2853 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | 2704 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); |
2854 EXPECT_TRUE(page->viewportDescription().userZoom); | 2705 EXPECT_TRUE(page->viewportDescription().userZoom); |
2855 } | 2706 } |
2856 | 2707 |
2857 TEST_F(ViewportTest, viewportLimitsAdjustedForNoUserScale) | 2708 TEST_F(LegacyViewportTest, viewportLegacyXHTMLMPRemoveAndAdd) |
2858 { | 2709 { |
2859 UseMockScrollbarSettings mockScrollbarSettings; | 2710 registerMockedHttpURLLoad("viewport/viewport-legacy-xhtmlmp-remove-and-add.h tml"); |
2711 | |
2712 FrameTestHelpers::WebViewHelper webViewHelper; | |
2713 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-legacy-xhtmlm p-remove-and-add.html", true, 0, 0, setViewportSettings); | |
2714 | |
2715 Page* page = webViewHelper.webViewImpl()->page(); | |
2716 PageScaleConstraints constraints = runTest(page, 320, 352); | |
2717 | |
2718 EXPECT_EQ(320, constraints.layoutSize.width()); | |
kenneth.r.christiansen
2013/11/21 20:30:36
I would love tests like these to have a comment ab
bokan
2013/11/21 20:37:59
I agree, and I think going forward we should work
| |
2719 EXPECT_EQ(352, constraints.layoutSize.height()); | |
2720 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); | |
2721 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); | |
2722 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | |
2723 EXPECT_TRUE(page->viewportDescription().userZoom); | |
2724 | |
2725 executeScript(webViewHelper.webViewImpl()->mainFrame(), | |
2726 "originalDoctype = document.doctype;" | |
2727 "document.removeChild(originalDoctype);"); | |
2728 | |
2729 | |
2730 constraints = runTest(page, 320, 352); | |
2731 | |
2732 EXPECT_EQ(320, constraints.layoutSize.width()); | |
2733 EXPECT_EQ(352, constraints.layoutSize.height()); | |
2734 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); | |
2735 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); | |
2736 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | |
2737 EXPECT_TRUE(page->viewportDescription().userZoom); | |
2738 | |
2739 executeScript(webViewHelper.webViewImpl()->mainFrame(), | |
2740 "document.insertBefore(originalDoctype, document.firstChild);"); | |
2741 | |
2742 constraints = runTest(page, 320, 352); | |
2743 | |
2744 EXPECT_EQ(320, constraints.layoutSize.width()); | |
2745 EXPECT_EQ(352, constraints.layoutSize.height()); | |
2746 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); | |
2747 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); | |
2748 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | |
2749 EXPECT_TRUE(page->viewportDescription().userZoom); | |
2750 } | |
2751 | |
2752 | |
2753 TEST_F(LegacyViewportTest, viewportLimitsAdjustedForNoUserScale) | |
2754 { | |
2860 registerMockedHttpURLLoad("viewport/viewport-limits-adjusted-for-no-user-sca le.html"); | 2755 registerMockedHttpURLLoad("viewport/viewport-limits-adjusted-for-no-user-sca le.html"); |
2861 | 2756 |
2862 FrameTestHelpers::WebViewHelper webViewHelper; | 2757 FrameTestHelpers::WebViewHelper webViewHelper; |
2863 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-limits-adjust ed-for-no-user-scale.html", true, 0, 0, setViewportSettings); | 2758 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-limits-adjust ed-for-no-user-scale.html", true, 0, 0, setViewportSettings); |
2864 | 2759 |
2865 Page* page = webViewHelper.webViewImpl()->page(); | 2760 Page* page = webViewHelper.webViewImpl()->page(); |
2866 | 2761 |
2867 EXPECT_FALSE(page->viewportDescription().userZoom); | 2762 EXPECT_FALSE(page->viewportDescription().userZoom); |
2868 } | 2763 } |
2869 | 2764 |
2870 TEST_F(ViewportTest, viewportLimitsAdjustedForNoUserScaleControl) | 2765 TEST_F(LegacyViewportTest, viewportLimitsAdjustedForNoUserScaleControl) |
2871 { | 2766 { |
2872 UseMockScrollbarSettings mockScrollbarSettings; | |
2873 registerMockedHttpURLLoad("viewport/viewport-limits-adjusted-for-no-user-sca le-control.html"); | 2767 registerMockedHttpURLLoad("viewport/viewport-limits-adjusted-for-no-user-sca le-control.html"); |
2874 | 2768 |
2875 FrameTestHelpers::WebViewHelper webViewHelper; | 2769 FrameTestHelpers::WebViewHelper webViewHelper; |
2876 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-limits-adjust ed-for-no-user-scale-control.html", true, 0, 0, setViewportSettings); | 2770 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-limits-adjust ed-for-no-user-scale-control.html", true, 0, 0, setViewportSettings); |
2877 | 2771 |
2878 Page* page = webViewHelper.webViewImpl()->page(); | 2772 Page* page = webViewHelper.webViewImpl()->page(); |
2879 | 2773 |
2880 EXPECT_TRUE(page->viewportDescription().userZoom); | 2774 EXPECT_TRUE(page->viewportDescription().userZoom); |
2881 } | 2775 } |
2882 | 2776 |
2777 class ConsoleMessageWebViewClient : public WebViewClient { | |
2778 public: | |
2779 virtual void didAddMessageToConsole(const WebConsoleMessage& msg, const WebS tring& sourceName, unsigned sourceLine, const WebString& stackTrace) | |
2780 { | |
2781 messages.push_back(msg); | |
2782 } | |
2783 | |
2784 std::vector<WebConsoleMessage> messages; | |
2785 }; | |
2786 | |
2787 TEST_F(LegacyViewportTest, viewportWarnings1) | |
2788 { | |
2789 ConsoleMessageWebViewClient webViewClient; | |
2790 | |
2791 registerMockedHttpURLLoad("viewport/viewport-warnings-1.html"); | |
2792 | |
2793 FrameTestHelpers::WebViewHelper webViewHelper; | |
2794 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-warnings-1.ht ml", true, 0, &webViewClient, setViewportSettings); | |
2795 | |
2796 Page* page = webViewHelper.webViewImpl()->page(); | |
2797 PageScaleConstraints constraints = runTest(page, 320, 352); | |
2798 | |
2799 EXPECT_TRUE(webViewClient.messages.empty()); | |
2800 | |
2801 EXPECT_EQ(320, constraints.layoutSize.width()); | |
2802 EXPECT_EQ(352, constraints.layoutSize.height()); | |
2803 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); | |
2804 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); | |
2805 EXPECT_NEAR(2.0f, constraints.maximumScale, 0.01f); | |
2806 EXPECT_TRUE(page->viewportDescription().userZoom); | |
2807 } | |
2808 | |
2809 TEST_F(LegacyViewportTest, viewportWarnings2) | |
2810 { | |
2811 ConsoleMessageWebViewClient webViewClient; | |
2812 | |
2813 registerMockedHttpURLLoad("viewport/viewport-warnings-2.html"); | |
2814 | |
2815 FrameTestHelpers::WebViewHelper webViewHelper; | |
2816 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-warnings-2.ht ml", true, 0, &webViewClient, setViewportSettings); | |
2817 | |
2818 Page* page = webViewHelper.webViewImpl()->page(); | |
2819 PageScaleConstraints constraints = runTest(page, 320, 352); | |
2820 | |
2821 EXPECT_EQ(1U, webViewClient.messages.size()); | |
2822 EXPECT_EQ(WebConsoleMessage::LevelError, webViewClient.messages[0].level); | |
2823 EXPECT_STREQ("The key \"wwidth\" is not recognized and ignored.", webViewCli ent.messages[0].text.utf8().c_str()); | |
2824 | |
2825 EXPECT_EQ(980, constraints.layoutSize.width()); | |
2826 EXPECT_EQ(1078, constraints.layoutSize.height()); | |
2827 EXPECT_NEAR(0.33f, constraints.initialScale, 0.01f); | |
2828 EXPECT_NEAR(0.33f, constraints.minimumScale, 0.01f); | |
2829 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | |
2830 EXPECT_TRUE(page->viewportDescription().userZoom); | |
2831 } | |
2832 | |
2833 TEST_F(LegacyViewportTest, viewportWarnings3) | |
2834 { | |
2835 ConsoleMessageWebViewClient webViewClient; | |
2836 | |
2837 registerMockedHttpURLLoad("viewport/viewport-warnings-3.html"); | |
2838 | |
2839 FrameTestHelpers::WebViewHelper webViewHelper; | |
2840 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-warnings-3.ht ml", true, 0, &webViewClient, setViewportSettings); | |
2841 | |
2842 Page* page = webViewHelper.webViewImpl()->page(); | |
2843 PageScaleConstraints constraints = runTest(page, 320, 352); | |
2844 | |
2845 EXPECT_EQ(1U, webViewClient.messages.size()); | |
2846 EXPECT_EQ(WebConsoleMessage::LevelError, webViewClient.messages[0].level); | |
2847 EXPECT_STREQ("The value \"unrecognized-width\" for key \"width\" is invalid, and has been ignored.", | |
2848 webViewClient.messages[0].text.utf8().c_str()); | |
2849 | |
2850 EXPECT_NEAR(64.0f, constraints.layoutSize.width(), 0.01); | |
2851 EXPECT_NEAR(70.4f, constraints.layoutSize.height(), 0.01); | |
2852 EXPECT_NEAR(5.0f, constraints.initialScale, 0.01f); | |
2853 EXPECT_NEAR(5.0f, constraints.minimumScale, 0.01f); | |
2854 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | |
2855 EXPECT_TRUE(page->viewportDescription().userZoom); | |
2856 } | |
2857 | |
2858 TEST_F(LegacyViewportTest, viewportWarnings4) | |
2859 { | |
2860 ConsoleMessageWebViewClient webViewClient; | |
2861 | |
2862 registerMockedHttpURLLoad("viewport/viewport-warnings-4.html"); | |
2863 | |
2864 FrameTestHelpers::WebViewHelper webViewHelper; | |
2865 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-warnings-4.ht ml", true, 0, &webViewClient, setViewportSettings); | |
2866 | |
2867 Page* page = webViewHelper.webViewImpl()->page(); | |
2868 PageScaleConstraints constraints = runTest(page, 320, 352); | |
2869 | |
2870 EXPECT_EQ(1U, webViewClient.messages.size()); | |
2871 EXPECT_EQ(WebConsoleMessage::LevelWarning, webViewClient.messages[0].level); | |
2872 EXPECT_STREQ("The value \"123x456\" for key \"width\" was truncated to its n umeric prefix.", | |
2873 webViewClient.messages[0].text.utf8().c_str()); | |
2874 | |
2875 EXPECT_NEAR(123.0f, constraints.layoutSize.width(), 0.01); | |
2876 EXPECT_NEAR(135.3f, constraints.layoutSize.height(), 0.01); | |
2877 EXPECT_NEAR(2.60f, constraints.initialScale, 0.01f); | |
2878 EXPECT_NEAR(2.60f, constraints.minimumScale, 0.01f); | |
2879 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | |
2880 EXPECT_TRUE(page->viewportDescription().userZoom); | |
2881 } | |
2882 | |
2883 TEST_F(LegacyViewportTest, viewportWarnings5) | |
2884 { | |
2885 ConsoleMessageWebViewClient webViewClient; | |
2886 | |
2887 registerMockedHttpURLLoad("viewport/viewport-warnings-5.html"); | |
2888 | |
2889 FrameTestHelpers::WebViewHelper webViewHelper; | |
2890 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-warnings-5.ht ml", true, 0, &webViewClient, setViewportSettings); | |
2891 | |
2892 Page* page = webViewHelper.webViewImpl()->page(); | |
2893 PageScaleConstraints constraints = runTest(page, 320, 352); | |
2894 | |
2895 EXPECT_EQ(5U, webViewClient.messages.size()); | |
2896 | |
2897 EXPECT_EQ(WebConsoleMessage::LevelError, webViewClient.messages[0].level); | |
2898 EXPECT_STREQ("The value \"device-width;\" for key \"width\" is invalid, and has been ignored.", | |
2899 webViewClient.messages[0].text.utf8().c_str()); | |
2900 | |
2901 EXPECT_EQ(WebConsoleMessage::LevelWarning, webViewClient.messages[1].level); | |
2902 EXPECT_STREQ("The value \"1.0;\" for key \"initial-scale\" was truncated to its numeric prefix.", | |
2903 webViewClient.messages[1].text.utf8().c_str()); | |
2904 | |
2905 EXPECT_EQ(WebConsoleMessage::LevelWarning, webViewClient.messages[2].level); | |
2906 EXPECT_STREQ("The value \"1.0;\" for key \"maximum-scale\" was truncated to its numeric prefix.", | |
2907 webViewClient.messages[2].text.utf8().c_str()); | |
2908 | |
2909 EXPECT_EQ(WebConsoleMessage::LevelWarning, webViewClient.messages[3].level); | |
2910 EXPECT_STREQ("The value \"0;\" for key \"user-scalable\" was truncated to it s numeric prefix.", | |
2911 webViewClient.messages[3].text.utf8().c_str()); | |
2912 | |
2913 EXPECT_EQ(WebConsoleMessage::LevelWarning, webViewClient.messages[4].level); | |
2914 EXPECT_STREQ("Error parsing a meta element's content: ';' is not a valid key -value pair separator. Please use ',' instead.", | |
2915 webViewClient.messages[4].text.utf8().c_str()); | |
2916 | |
2917 EXPECT_NEAR(320.0f, constraints.layoutSize.width(), 0.01); | |
2918 EXPECT_NEAR(352.0f, constraints.layoutSize.height(), 0.01); | |
2919 EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f); | |
2920 EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f); | |
2921 EXPECT_NEAR(1.0f, constraints.maximumScale, 0.01f); | |
2922 EXPECT_FALSE(page->viewportDescription().userZoom); | |
2923 } | |
2924 | |
2925 TEST_F(LegacyViewportTest, viewportWarnings6) | |
2926 { | |
2927 ConsoleMessageWebViewClient webViewClient; | |
2928 | |
2929 registerMockedHttpURLLoad("viewport/viewport-warnings-6.html"); | |
2930 | |
2931 FrameTestHelpers::WebViewHelper webViewHelper; | |
2932 webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-warnings-6.ht ml", true, 0, &webViewClient, setViewportSettings); | |
2933 | |
2934 Page* page = webViewHelper.webViewImpl()->page(); | |
2935 PageScaleConstraints constraints = runTest(page, 320, 352); | |
2936 | |
2937 EXPECT_EQ(1U, webViewClient.messages.size()); | |
2938 EXPECT_EQ(WebConsoleMessage::LevelError, webViewClient.messages[0].level); | |
2939 EXPECT_STREQ("The value \"\" for key \"width\" is invalid, and has been igno red.", | |
2940 webViewClient.messages[0].text.utf8().c_str()); | |
2941 | |
2942 EXPECT_NEAR(64.0f, constraints.layoutSize.width(), 0.01); | |
2943 EXPECT_NEAR(70.4f, constraints.layoutSize.height(), 0.01); | |
2944 EXPECT_NEAR(5.0f, constraints.initialScale, 0.01f); | |
2945 EXPECT_NEAR(5.0f, constraints.minimumScale, 0.01f); | |
2946 EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f); | |
2947 EXPECT_TRUE(page->viewportDescription().userZoom); | |
2948 } | |
2949 | |
2883 } // namespace | 2950 } // namespace |
OLD | NEW |