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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 | 161 |
162 m_webViewHelper.reset(); // Explicitly reset to break dependency on locally
scoped client. | 162 m_webViewHelper.reset(); // Explicitly reset to break dependency on locally
scoped client. |
163 } | 163 } |
164 | 164 |
165 WebView* TouchActionTest::setupTest(std::string file, TouchActionTrackingWebView
Client& client) | 165 WebView* TouchActionTest::setupTest(std::string file, TouchActionTrackingWebView
Client& client) |
166 { | 166 { |
167 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL),
WebString::fromUTF8(file)); | 167 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL),
WebString::fromUTF8(file)); |
168 // Note that JavaScript must be enabled for shadow DOM tests. | 168 // Note that JavaScript must be enabled for shadow DOM tests. |
169 WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + file, true,
0, &client); | 169 WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + file, true,
0, &client); |
170 | 170 |
| 171 // Lock page scale factor to avoid zooming out to contents size. |
| 172 m_webViewHelper.webView()->setPageScaleFactorLimits(1, 1); |
| 173 |
171 // Set size to enable hit testing, and avoid line wrapping for consistency w
ith browser. | 174 // Set size to enable hit testing, and avoid line wrapping for consistency w
ith browser. |
172 webView->resize(WebSize(800, 1200)); | 175 webView->resize(WebSize(800, 1200)); |
173 | 176 |
174 // Scroll to verify the code properly transforms windows to client co-ords. | 177 // Scroll to verify the code properly transforms windows to client co-ords. |
175 const int kScrollOffset = 100; | 178 const int kScrollOffset = 100; |
176 RefPtr<WebCore::Document> document = static_cast<PassRefPtr<WebCore::Documen
t> >(webView->mainFrame()->document()); | 179 RefPtr<WebCore::Document> document = static_cast<PassRefPtr<WebCore::Documen
t> >(webView->mainFrame()->document()); |
177 document->frame()->view()->setScrollOffset(WebCore::IntPoint(0, kScrollOffse
t)); | 180 document->frame()->view()->setScrollOffset(WebCore::IntPoint(0, kScrollOffse
t)); |
178 | 181 |
179 return webView; | 182 return webView; |
180 } | 183 } |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 { | 327 { |
325 runShadowDOMTest("touch-action-shadow-dom.html"); | 328 runShadowDOMTest("touch-action-shadow-dom.html"); |
326 } | 329 } |
327 | 330 |
328 TEST_F(TouchActionTest, Pan) | 331 TEST_F(TouchActionTest, Pan) |
329 { | 332 { |
330 runTouchActionTest("touch-action-pan.html"); | 333 runTouchActionTest("touch-action-pan.html"); |
331 } | 334 } |
332 | 335 |
333 } | 336 } |
OLD | NEW |