Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(419)

Side by Side Diff: Source/web/tests/TouchActionTest.cpp

Issue 190723007: Fix tests to be compatible with Android scale initialization. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Reupload Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698