Chromium Code Reviews| Index: Source/web/tests/LinkHighlightTest.cpp |
| diff --git a/Source/web/tests/LinkHighlightTest.cpp b/Source/web/tests/LinkHighlightTest.cpp |
| index a57554e4631d5f59582734ab8e719639abc8bac1..5b925475820eb7f4757d7fd999e344c0a56d4946 100644 |
| --- a/Source/web/tests/LinkHighlightTest.cpp |
| +++ b/Source/web/tests/LinkHighlightTest.cpp |
| @@ -29,6 +29,8 @@ |
| #include "bindings/core/v8/ExceptionStatePlaceholder.h" |
| #include "core/dom/Node.h" |
| #include "core/frame/FrameView.h" |
| +#include "core/page/EventHandler.h" |
| +#include "core/page/Page.h" |
| #include "core/page/TouchDisambiguation.h" |
| #include "core/testing/URLTestHelpers.h" |
| #include "platform/geometry/IntRect.h" |
| @@ -76,14 +78,18 @@ TEST(LinkHighlightTest, verifyWebViewImplIntegration) |
| { |
| PlatformGestureEventBuilder platformEvent(webViewImpl->mainFrameImpl()->frameView(), touchEvent); |
| - Node* touchNode = webViewImpl->bestTapNode(platformEvent); |
| + GestureEventWithHitTestResults targetedEvent = |
| + webViewImpl->page()->deprecatedLocalMainFrame()->eventHandler().targetGestureEvent(platformEvent, true); |
|
Rick Byers
2014/08/20 23:59:33
Factor these couple lines into a little helper fun
Zeeshan Qureshi
2014/08/21 04:59:25
Done.
|
| + Node* touchNode = webViewImpl->bestTapNode(targetedEvent); |
| ASSERT_TRUE(touchNode); |
| } |
| touchEvent.y = 40; |
| { |
| PlatformGestureEventBuilder platformEvent(webViewImpl->mainFrameImpl()->frameView(), touchEvent); |
| - EXPECT_FALSE(webViewImpl->bestTapNode(platformEvent)); |
| + GestureEventWithHitTestResults targetedEvent = |
| + webViewImpl->page()->deprecatedLocalMainFrame()->eventHandler().targetGestureEvent(platformEvent, true); |
| + EXPECT_FALSE(webViewImpl->bestTapNode(targetedEvent)); |
| } |
| touchEvent.y = 20; |
| @@ -91,7 +97,9 @@ TEST(LinkHighlightTest, verifyWebViewImplIntegration) |
| { |
| PlatformGestureEventBuilder platformEvent(webViewImpl->mainFrameImpl()->frameView(), touchEvent); |
| - webViewImpl->enableTapHighlightAtPoint(platformEvent); |
| + GestureEventWithHitTestResults targetedEvent = |
| + webViewImpl->page()->deprecatedLocalMainFrame()->eventHandler().targetGestureEvent(platformEvent, true); |
| + webViewImpl->enableTapHighlightAtPoint(targetedEvent); |
| } |
| EXPECT_TRUE(webViewImpl->linkHighlight(0)); |
| @@ -103,7 +111,9 @@ TEST(LinkHighlightTest, verifyWebViewImplIntegration) |
| touchEvent.y = 100; |
| { |
| PlatformGestureEventBuilder platformEvent(webViewImpl->mainFrameImpl()->frameView(), touchEvent); |
| - webViewImpl->enableTapHighlightAtPoint(platformEvent); |
| + GestureEventWithHitTestResults targetedEvent = |
| + webViewImpl->page()->deprecatedLocalMainFrame()->eventHandler().targetGestureEvent(platformEvent, true); |
| + webViewImpl->enableTapHighlightAtPoint(targetedEvent); |
| } |
| ASSERT_TRUE(webViewImpl->linkHighlight(0)); |
| @@ -112,14 +122,18 @@ TEST(LinkHighlightTest, verifyWebViewImplIntegration) |
| touchEvent.y = 220; // An A-link with cross-hair cursor. |
| { |
| PlatformGestureEventBuilder platformEvent(webViewImpl->mainFrameImpl()->frameView(), touchEvent); |
| - webViewImpl->enableTapHighlightAtPoint(platformEvent); |
| + GestureEventWithHitTestResults targetedEvent = |
| + webViewImpl->page()->deprecatedLocalMainFrame()->eventHandler().targetGestureEvent(platformEvent, true); |
| + webViewImpl->enableTapHighlightAtPoint(targetedEvent); |
| } |
| ASSERT_EQ(0U, webViewImpl->numLinkHighlights()); |
| touchEvent.y = 260; // A text input box. |
| { |
| PlatformGestureEventBuilder platformEvent(webViewImpl->mainFrameImpl()->frameView(), touchEvent); |
| - webViewImpl->enableTapHighlightAtPoint(platformEvent); |
| + GestureEventWithHitTestResults targetedEvent = |
| + webViewImpl->page()->deprecatedLocalMainFrame()->eventHandler().targetGestureEvent(platformEvent, true); |
| + webViewImpl->enableTapHighlightAtPoint(targetedEvent); |
| } |
| ASSERT_EQ(0U, webViewImpl->numLinkHighlights()); |
| @@ -161,10 +175,12 @@ TEST(LinkHighlightTest, resetDuringNodeRemoval) |
| touchEvent.y = 20; |
| PlatformGestureEventBuilder platformEvent(webViewImpl->mainFrameImpl()->frameView(), touchEvent); |
| - Node* touchNode = webViewImpl->bestTapNode(platformEvent); |
| + GestureEventWithHitTestResults targetedEvent = |
| + webViewImpl->page()->deprecatedLocalMainFrame()->eventHandler().targetGestureEvent(platformEvent, true); |
| + Node* touchNode = webViewImpl->bestTapNode(targetedEvent); |
| ASSERT_TRUE(touchNode); |
| - webViewImpl->enableTapHighlightAtPoint(platformEvent); |
| + webViewImpl->enableTapHighlightAtPoint(targetedEvent); |
| ASSERT_TRUE(webViewImpl->linkHighlight(0)); |
| GraphicsLayer* highlightLayer = webViewImpl->linkHighlight(0)->currentGraphicsLayerForTesting(); |