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

Unified 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: incoporated review comments Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: Source/web/tests/TouchActionTest.cpp
diff --git a/Source/web/tests/TouchActionTest.cpp b/Source/web/tests/TouchActionTest.cpp
index 9cb4f7c3513d232af60559ef933150aee7c593b9..b4ccceff40dfd8c2f5d1a184596eba86b8e6d9a5 100644
--- a/Source/web/tests/TouchActionTest.cpp
+++ b/Source/web/tests/TouchActionTest.cpp
@@ -169,7 +169,7 @@ WebView* TouchActionTest::setupTest(std::string file, TouchActionTrackingWebView
WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + file, true, 0, &client);
// Set size to enable hit testing, and avoid line wrapping for consistency with browser.
- webView->resize(WebSize(700, 1000));
+ webView->resize(WebSize(800, 1200));
gnana 2014/02/24 18:59:50 I changed this to fix the unit test failure for
Rick Byers 2014/02/25 22:52:03 Yeah, that should be fine. At some point we may w
gnana 2014/02/27 13:26:59 Done.
// Scroll to verify the code properly transforms windows to client co-ords.
const int kScrollOffset = 100;
@@ -252,14 +252,18 @@ void TouchActionTest::runTestOnTree(WebCore::ContainerNode* root, WebView* webVi
<< " Got element: \"" << result.innerElement()->outerHTML().stripWhiteSpace().left(80).ascii().data() << "\""
<< std::endl << "Document render tree:" << std::endl << externalRepresentation(root->document().frame()).utf8().data();
+ WebCore::HitTestResult taResult = frame->eventHandler().hitTestResultAtPoint(docPoint, WebCore::HitTestRequest::ReadOnly | WebCore::HitTestRequest::Active | WebCore::HitTestRequest::TouchAction);
+
// Now send the touch event and check any touch action result.
sendTouchEvent(webView, WebInputEvent::TouchStart, clientPoint);
AtomicString expectedAction = element->getAttribute("expected-action");
if (expectedAction == "auto") {
- // Auto is the default - no action set.
- EXPECT_EQ(0, client.touchActionSetCount()) << failureContextPos;
- EXPECT_EQ(WebTouchActionAuto, client.lastTouchAction()) << failureContextPos;
+ if (taResult.innerElement() == result.innerElement()) {
gnana 2014/02/24 18:59:50 I have added this check for cases similar to this
Rick Byers 2014/02/25 22:52:03 Oh! Something is wrong with the hit testing code
gnana 2014/02/27 13:26:59 Debugged and found that this issue caused in inlin
Rick Byers 2014/02/27 14:53:11 Good work!
+ // Auto is the default - no action set.
+ EXPECT_EQ(0, client.touchActionSetCount()) << failureContextPos;
+ EXPECT_EQ(WebTouchActionAuto, client.lastTouchAction()) << failureContextPos;
+ }
} else {
// Should have received exactly one touch action.
EXPECT_EQ(1, client.touchActionSetCount()) << failureContextPos;

Powered by Google App Engine
This is Rietveld 408576698