WebKitTestRunner uses a strange mix of synchronous and asynchronous events to simulate keyboard and mouse. WebKit2 has entire separate code paths to support that. All this makes writing tests difficult, as WebKitTestRunner is difficult to predict, and this obviously reduces test coverage, as we test a custom code path. Here is what the upcoming patch does: - When testRunner is used to send a sync event (like a keyDown), the connection goes into a state where all the events become synchronous in both directions. So it's in a way like the current KeyEventSyncForTesting, but it guarantees that all other events that UI process sends at the same time get delivered in correct order. This is not ideal, because even though page level code in WK2 is now the same, we make it work in a different way. In an ideal world, we would make all the tests that use keyboard and mouse events asynchronous - but I don't think that it's doable in practice. A good thing is that all these tests just worked in the new mode, which means that it's quite close to real life code path, after all. - When testRunner is used to send a scroll event, it's now fully asynchronous. Scrolling is always asynchronous in WK2, and so were most tests, but we used to have a strange mix of sync and async behaviors. It should all be more straightforward now.
Created attachment 259655 [details] proposed patch
Comment on attachment 259655 [details] proposed patch View in context: https://bugs.webkit.org/attachment.cgi?id=259655&action=review > Source/WebKit2/UIProcess/API/APIProcessPoolConfiguration.h:91 > + void allowFullySynchronousModeForTesting() { m_fullySynchronousModeIsAllowedForTesting = true; } This should be a getter/setter pair. > Source/WebKit2/UIProcess/API/C/WKContextConfigurationRef.h:58 > +WK_EXPORT void WKContextConfigurationAllowFullySynchronousModeForTesting(WKContextConfigurationRef configuration); Please add a getter/setter for this to match all the other WKContextConfiguration functions.
Committed <https://trac.webkit.org/r188793>.
Follow-up scrolling test tweak in r188827. It was flaky on some machines, randomly not scrolling where it should have, so I nudged some distances. Let's see if it helps.
(In reply to comment #3) > Committed <https://trac.webkit.org/r188793>. Following this change, the tests fast/events/wheelevent-{basic, mousewheel-interaction}.html began to timeout in iOS Simulator WebKit Test Runner. See bug #148709.