WebKit Bugzilla
Attachment 340322 Details for
Bug 185383
: NSEvent event trackers don't work from WebKitTestRunner for simulated wheel events.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for landing.
bug-185383-20180514094656.patch (text/plain), 5.38 KB, created by
Jeremy Jones
on 2018-05-14 09:46:57 PDT
(
hide
)
Description:
Patch for landing.
Filename:
MIME Type:
Creator:
Jeremy Jones
Created:
2018-05-14 09:46:57 PDT
Size:
5.38 KB
patch
obsolete
>Subversion Revision: 231175 >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index cba905e6179e4a78f79a07354fd7a9e518740329..f6784d823d9560fe453a4f2b2c043449dd4bea0c 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,17 @@ >+2018-05-07 Jeremy Jones <jeremyj@apple.com> >+ >+ NSEvent event trackers don't work from WebKitTestRunner >+ https://bugs.webkit.org/show_bug.cgi?id=185383 >+ rdar://problem/40025045 >+ >+ Reviewed by Simon Fraser. >+ >+ Post simulated wheel events to _sendEventToObservers: so they can be handled by NSEvent observers. >+ NSEvent swipe tracking is used for webkit swipe navigation. >+ >+ * WebKitTestRunner/mac/EventSenderProxy.mm: >+ (WTR::EventSenderProxy::mouseScrollByWithWheelAndMomentumPhases): >+ > 2018-04-30 Mark Lam <mark.lam@apple.com> > > Apply PtrTags to the MetaAllocator and friends. >diff --git a/Tools/WebKitTestRunner/mac/EventSenderProxy.mm b/Tools/WebKitTestRunner/mac/EventSenderProxy.mm >index 790f6351bd6b01e3984581025ed9d0f4773541cb..da25e4f9c51c18d5847c408b53f35e2b573b29f4 100644 >--- a/Tools/WebKitTestRunner/mac/EventSenderProxy.mm >+++ b/Tools/WebKitTestRunner/mac/EventSenderProxy.mm >@@ -43,6 +43,7 @@ - (void)_setCurrentEvent:(NSEvent *)event; > @end > > @interface NSEvent (ForTestRunner) >++ (NSEvent *)_sendEventToObservers:(NSEvent *)event; > - (void)_postDelayed; > @end > >@@ -876,6 +877,7 @@ void EventSenderProxy::mouseScrollByWithWheelAndMomentumPhases(int x, int y, int > // Our event should have the correct settings: > if (NSView *targetView = [m_testController->mainWebView()->platformView() hitTest:[event locationInWindow]]) { > [NSApp _setCurrentEvent:event]; >+ event = [NSEvent _sendEventToObservers:event]; > [targetView scrollWheel:event]; > [NSApp _setCurrentEvent:nil]; > } else { >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 455af94cb667739e26b782487f1f55abba485a64..256d0cf2fab54282b4f37a6faf4aa45f457bb59d 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,16 @@ >+2018-05-07 Jeremy Jones <jeremyj@apple.com> >+ >+ NSEvent event trackers don't work from WebKitTestRunner >+ https://bugs.webkit.org/show_bug.cgi?id=185383 >+ rdar://problem/40025045 >+ >+ Reviewed by Simon Fraser. >+ >+ This test initiates back navigation with wheel events. >+ >+ * swipe/wheel-event-initiated-back-navigation-expected.txt: Added. >+ * swipe/wheel-event-initiated-back-navigation.html: Added. >+ > 2018-04-30 Wenson Hsieh <wenson_hsieh@apple.com> > > [Extra zoom mode] Respect the existing shrink-to-fit attribute instead of using min-device-width >diff --git a/LayoutTests/swipe/wheel-event-initiated-back-navigation-expected.txt b/LayoutTests/swipe/wheel-event-initiated-back-navigation-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..4339457c1474b7c4a6a2d69a3bce27215c78c7fb >--- /dev/null >+++ b/LayoutTests/swipe/wheel-event-initiated-back-navigation-expected.txt >@@ -0,0 +1,5 @@ >+This is a swipe navigation test. >+ >+PASS: mouseWheel caused navigation >+PASS: navigated back to page1 >+ >diff --git a/LayoutTests/swipe/wheel-event-initiated-back-navigation.html b/LayoutTests/swipe/wheel-event-initiated-back-navigation.html >new file mode 100644 >index 0000000000000000000000000000000000000000..c6124860116b3b3e5a388813fe4b9e67022bc6cf >--- /dev/null >+++ b/LayoutTests/swipe/wheel-event-initiated-back-navigation.html >@@ -0,0 +1,68 @@ >+<html> >+<head> >+<script> >+ >+function logResult(s) { >+ document.getElementById('result').textContent += s + "\n"; >+} >+ >+function backSwipe() >+{ >+ var divTarget = document.getElementById('content'); >+ var documentBounds = divTarget.getBoundingClientRect(); >+ >+ eventSender.mouseMoveTo(documentBounds.left + 10, documentBounds.top + 10); >+ eventSender.mouseScrollByWithWheelAndMomentumPhases(100, 0, 'began', 'none'); >+ eventSender.mouseScrollByWithWheelAndMomentumPhases(100, 0, 'changed', 'none'); >+ eventSender.mouseScrollByWithWheelAndMomentumPhases(100, 0, 'changed', 'none'); >+ eventSender.mouseScrollByWithWheelAndMomentumPhases(100, 0, 'ended', 'none'); >+} >+ >+function startTest() >+{ >+ if (!window.eventSender) { >+ logResult('This test must be run in DumpRenderTree/WebKitTestRunner (no eventSender)'); >+ return; >+ } >+ >+ if (!window.testRunner) { >+ logResult('This test must be run in DumpRenderTree/WebKitTestRunner (no testRunner)'); >+ return; >+ } >+ >+ testRunner.dumpAsText(); >+ testRunner.waitUntilDone(); >+ testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1); >+ testRunner.setNavigationGesturesEnabled(true); >+ >+ window.onpopstate = function(event) { >+ logResult('PASS: mouseWheel caused navigation'); >+ if (event.state.name == "page1") { >+ logResult('PASS: navigated back to ' + event.state.name); >+ } else { >+ logResult('FAILED: navigated back to ' + event.state.name); >+ } >+ testRunner.notifyDone(); >+ }; >+ >+ var stateObj = { name: "page1" }; >+ history.replaceState(stateObj, "page1", ""); >+ >+ var stateObj = { name: "page2" }; >+ history.pushState(stateObj, "page2", ""); >+ >+ backSwipe(); >+} >+ >+window.addEventListener('load', startTest, false); >+ >+</script> >+</head> >+<body id="content"> >+ >+<h1>This is a swipe navigation test.</h1> >+ >+<pre id="result"></pre> >+ >+</body> >+</html> >\ No newline at end of file
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185383
:
339729
|
339987
| 340322