OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 #include "web/WebLocalFrameImpl.h" | 48 #include "web/WebLocalFrameImpl.h" |
49 #include "web/WebViewImpl.h" | 49 #include "web/WebViewImpl.h" |
50 #include "web/tests/FrameTestHelpers.h" | 50 #include "web/tests/FrameTestHelpers.h" |
51 #include "wtf/PtrUtil.h" | 51 #include "wtf/PtrUtil.h" |
52 #include <memory> | 52 #include <memory> |
53 | 53 |
54 namespace blink { | 54 namespace blink { |
55 | 55 |
56 GestureEventWithHitTestResults getTargetedEvent(WebViewImpl* webViewImpl, | 56 GestureEventWithHitTestResults getTargetedEvent(WebViewImpl* webViewImpl, |
57 WebGestureEvent& touchEvent) { | 57 WebGestureEvent& touchEvent) { |
58 PlatformGestureEventBuilder platformEvent( | 58 WebGestureEvent scaledEvent = ScaleWebGestureEvent( |
59 webViewImpl->mainFrameImpl()->frameView(), touchEvent); | 59 webViewImpl->mainFrameImpl()->frameView(), touchEvent); |
60 return webViewImpl->page() | 60 return webViewImpl->page() |
61 ->deprecatedLocalMainFrame() | 61 ->deprecatedLocalMainFrame() |
62 ->eventHandler() | 62 ->eventHandler() |
63 .targetGestureEvent(platformEvent, true); | 63 .targetGestureEvent(scaledEvent, true); |
64 } | 64 } |
65 | 65 |
66 TEST(LinkHighlightImplTest, verifyWebViewImplIntegration) { | 66 TEST(LinkHighlightImplTest, verifyWebViewImplIntegration) { |
67 const std::string baseURL("http://www.test.com/"); | 67 const std::string baseURL("http://www.test.com/"); |
68 const std::string fileName("test_touch_link_highlight.html"); | 68 const std::string fileName("test_touch_link_highlight.html"); |
69 | 69 |
70 URLTestHelpers::registerMockedURLFromBaseURL( | 70 URLTestHelpers::registerMockedURLFromBaseURL( |
71 WebString::fromUTF8(baseURL.c_str()), | 71 WebString::fromUTF8(baseURL.c_str()), |
72 WebString::fromUTF8("test_touch_link_highlight.html")); | 72 WebString::fromUTF8("test_touch_link_highlight.html")); |
73 FrameTestHelpers::WebViewHelper webViewHelper; | 73 FrameTestHelpers::WebViewHelper webViewHelper; |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 goodTargets, highlightNodes); | 260 goodTargets, highlightNodes); |
261 | 261 |
262 webViewImpl->enableTapHighlights(highlightNodes); | 262 webViewImpl->enableTapHighlights(highlightNodes); |
263 EXPECT_EQ(2U, webViewImpl->numLinkHighlights()); | 263 EXPECT_EQ(2U, webViewImpl->numLinkHighlights()); |
264 | 264 |
265 Platform::current()->getURLLoaderMockFactory()->unregisterAllURLs(); | 265 Platform::current()->getURLLoaderMockFactory()->unregisterAllURLs(); |
266 WebCache::clear(); | 266 WebCache::clear(); |
267 } | 267 } |
268 | 268 |
269 } // namespace blink | 269 } // namespace blink |
OLD | NEW |