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

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

Issue 137123009: Add hittest mode for Touch-action which ignore inline elements and svg elements (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase to trunk and Incorporated review comments 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
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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 // Set size to enable hit testing, and avoid line wrapping for consistency w ith browser. 171 // Set size to enable hit testing, and avoid line wrapping for consistency w ith browser.
172 webView->resize(WebSize(700, 1000)); 172 webView->resize(WebSize(800, 1200));
173 173
174 // Scroll to verify the code properly transforms windows to client co-ords. 174 // Scroll to verify the code properly transforms windows to client co-ords.
175 const int kScrollOffset = 100; 175 const int kScrollOffset = 100;
176 RefPtr<WebCore::Document> document = static_cast<PassRefPtr<WebCore::Documen t> >(webView->mainFrame()->document()); 176 RefPtr<WebCore::Document> document = static_cast<PassRefPtr<WebCore::Documen t> >(webView->mainFrame()->document());
177 document->frame()->view()->setScrollOffset(WebCore::IntPoint(0, kScrollOffse t)); 177 document->frame()->view()->setScrollOffset(WebCore::IntPoint(0, kScrollOffse t));
178 178
179 return webView; 179 return webView;
180 } 180 }
181 181
182 void TouchActionTest::runTestOnTree(WebCore::ContainerNode* root, WebView* webVi ew, TouchActionTrackingWebViewClient& client) 182 void TouchActionTest::runTestOnTree(WebCore::ContainerNode* root, WebView* webVi ew, TouchActionTrackingWebViewClient& client)
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 { 322 {
323 runShadowDOMTest("touch-action-shadow-dom.html"); 323 runShadowDOMTest("touch-action-shadow-dom.html");
324 } 324 }
325 325
326 TEST_F(TouchActionTest, Pan) 326 TEST_F(TouchActionTest, Pan)
327 { 327 {
328 runTouchActionTest("touch-action-pan.html"); 328 runTouchActionTest("touch-action-pan.html");
329 } 329 }
330 330
331 } 331 }
OLDNEW
« no previous file with comments | « Source/core/rendering/svg/RenderSVGRoot.h ('k') | Source/web/tests/data/touch-action-simple.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698