| 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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 FrameView* frameView = frame->view(); | 252 FrameView* frameView = frame->view(); |
| 253 IntRect visibleRect = frameView->windowClipRect(); | 253 IntRect visibleRect = frameView->windowClipRect(); |
| 254 ASSERT_TRUE(visibleRect.contains(clientPoint)) << failureContextPos | 254 ASSERT_TRUE(visibleRect.contains(clientPoint)) << failureContextPos |
| 255 << " Test point not contained in visible area: " << visibleRect.
x() << "," << visibleRect.y() | 255 << " Test point not contained in visible area: " << visibleRect.
x() << "," << visibleRect.y() |
| 256 << "-" << visibleRect.maxX() << "," << visibleRect.maxY(); | 256 << "-" << visibleRect.maxX() << "," << visibleRect.maxY(); |
| 257 | 257 |
| 258 // First validate that a hit test at this point will really hit the
element | 258 // First validate that a hit test at this point will really hit the
element |
| 259 // we intended. This is the easiest way for a test to be broken, but
has nothing really | 259 // we intended. This is the easiest way for a test to be broken, but
has nothing really |
| 260 // to do with touch action. | 260 // to do with touch action. |
| 261 // Note that we can't use WebView's hit test API because it doesn't
look into shadow DOM. | 261 // Note that we can't use WebView's hit test API because it doesn't
look into shadow DOM. |
| 262 IntPoint docPoint(frameView->windowToContents(clientPoint)); | 262 IntPoint docPoint(frameView->rootFrameToContents(clientPoint)); |
| 263 HitTestResult result = frame->eventHandler().hitTestResultAtPoint(do
cPoint, HitTestRequest::ReadOnly | HitTestRequest::Active); | 263 HitTestResult result = frame->eventHandler().hitTestResultAtPoint(do
cPoint, HitTestRequest::ReadOnly | HitTestRequest::Active); |
| 264 ASSERT_EQ(element, result.innerElement()) << "Unexpected hit test re
sult " << failureContextPos | 264 ASSERT_EQ(element, result.innerElement()) << "Unexpected hit test re
sult " << failureContextPos |
| 265 << " Got element: \"" << result.innerElement()->outerHTML().str
ipWhiteSpace().left(80).ascii().data() << "\"" | 265 << " Got element: \"" << result.innerElement()->outerHTML().str
ipWhiteSpace().left(80).ascii().data() << "\"" |
| 266 << std::endl << "Document render tree:" << std::endl << external
Representation(root->document().frame()).utf8().data(); | 266 << std::endl << "Document render tree:" << std::endl << external
Representation(root->document().frame()).utf8().data(); |
| 267 | 267 |
| 268 // Now send the touch event and check any touch action result. | 268 // Now send the touch event and check any touch action result. |
| 269 sendTouchEvent(webView, WebInputEvent::TouchStart, clientPoint); | 269 sendTouchEvent(webView, WebInputEvent::TouchStart, clientPoint); |
| 270 | 270 |
| 271 AtomicString expectedAction = element->getAttribute("expected-action
"); | 271 AtomicString expectedAction = element->getAttribute("expected-action
"); |
| 272 if (expectedAction == "auto") { | 272 if (expectedAction == "auto") { |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 { | 340 { |
| 341 runShadowDOMTest("touch-action-shadow-dom.html"); | 341 runShadowDOMTest("touch-action-shadow-dom.html"); |
| 342 } | 342 } |
| 343 | 343 |
| 344 TEST_F(TouchActionTest, Pan) | 344 TEST_F(TouchActionTest, Pan) |
| 345 { | 345 { |
| 346 runTouchActionTest("touch-action-pan.html"); | 346 runTouchActionTest("touch-action-pan.html"); |
| 347 } | 347 } |
| 348 | 348 |
| 349 } | 349 } |
| OLD | NEW |