[webkit-changes] [WebKit/WebKit] 835f5f: [macOS] Make it possible to test smart magnify in ...

Simon Fraser noreply at github.com
Fri Dec 15 10:29:31 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 835f5fc2d0ec6def0f44cfc3d343d7f45cc82588
      https://github.com/WebKit/WebKit/commit/835f5fc2d0ec6def0f44cfc3d343d7f45cc82588
  Author: Simon Fraser <simon.fraser at apple.com>
  Date:   2023-12-15 (Fri, 15 Dec 2023)

  Changed paths:
    M LayoutTests/TestExpectations
    M LayoutTests/platform/mac-wk2/TestExpectations
    M LayoutTests/resources/ui-helper.js
    A LayoutTests/view-gestures/resources/view-gesture-helpers.js
    A LayoutTests/view-gestures/smart-magnify/double-tap-zoom-expected.txt
    A LayoutTests/view-gestures/smart-magnify/double-tap-zoom.html
    M Source/WebCore/PAL/pal/spi/mac/IOKitSPIMac.h
    M Source/WebCore/page/WheelEventTestMonitor.cpp
    M Source/WebCore/page/WheelEventTestMonitor.h
    M Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in
    M Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteLayerTreeDrawingAreaProxyMac.h
    M Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteLayerTreeDrawingAreaProxyMac.mm
    M Source/WebKit/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm
    M Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp
    M Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h
    M Source/WebKit/WebProcess/WebPage/DrawingArea.h
    M Source/WebKit/WebProcess/WebPage/DrawingArea.messages.in
    M Source/WebKit/WebProcess/WebPage/mac/RemoteLayerTreeDrawingAreaMac.h
    M Source/WebKit/WebProcess/WebPage/mac/RemoteLayerTreeDrawingAreaMac.mm
    M Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h
    M Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm
    M Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl
    M Tools/TestRunnerShared/UIScriptContext/UIScriptController.h
    M Tools/WebKitTestRunner/EventSenderProxy.h
    M Tools/WebKitTestRunner/InjectedBundle/Bindings/EventSendingController.idl
    M Tools/WebKitTestRunner/InjectedBundle/EventSendingController.cpp
    M Tools/WebKitTestRunner/InjectedBundle/EventSendingController.h
    M Tools/WebKitTestRunner/TestController.cpp
    M Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm
    M Tools/WebKitTestRunner/mac/EventSenderProxy.mm
    M Tools/WebKitTestRunner/mac/UIScriptControllerMac.h
    M Tools/WebKitTestRunner/mac/UIScriptControllerMac.mm

  Log Message:
  -----------
  [macOS] Make it possible to test smart magnify in layout tests
https://bugs.webkit.org/show_bug.cgi?id=266449
rdar://119699103

Reviewed by Tim Horton.

Make it possible to write a "smart magnify" test. There are several components to this:
1. We teach EventSender how to generate the event, which is an NSEvent of type NSEventTypeSmartMagnify
   with kIOHIDEventTypeZoomToggle.
2. We allow a test to enable WKWebView magnification via UIScriptController. We also fix WebKitTestRunner
   to reset the magnification state between tests.
3. We give WheelEventTestMonitor a defer reason so that a test can wait for the zoom animation to complete
   (yes, this isn't wheel events, but the infrastructure is exactly what we need).
   To support this, DrawingArea::commitTransientZoom() returns an async reply, and
   RemoteLayerTreeDrawingAreaProxyMac::commitTransientZoom() sets up the deferral reason across the
   CAAnimation, and the reply from the web process that the zoom is committed.

A new test is added in LayoutTests/view-gestures/smart-magnify. In future, we should move the swipe
tests into this view-gestures directory.

* LayoutTests/TestExpectations:
* LayoutTests/platform/mac-wk2/TestExpectations:
* LayoutTests/resources/ui-helper.js:
(window.UIHelper.async smartMagnifyAt):
(window.UIHelper.setWebViewAllowsMagnification):
* LayoutTests/view-gestures/resources/view-gesture-helpers.js: Added.
(visualViewportDescription):
* LayoutTests/view-gestures/smart-magnify/double-tap-zoom-expected.txt: Added.
* LayoutTests/view-gestures/smart-magnify/double-tap-zoom.html: Added.
* Source/WebCore/page/WheelEventTestMonitor.cpp:
(WebCore::operator<<):
* Source/WebCore/page/WheelEventTestMonitor.h:
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:
* Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteLayerTreeDrawingAreaProxyMac.h:
* Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteLayerTreeDrawingAreaProxyMac.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxyMac::commitTransientZoom):
(WebKit::RemoteLayerTreeDrawingAreaProxyMac::sendCommitTransientZoom):
* Source/WebKit/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
(WebKit::TiledCoreAnimationDrawingAreaProxy::commitTransientZoom):
* Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
(WebKit::DrawingAreaCoordinatedGraphics::commitTransientZoom):
* Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h:
* Source/WebKit/WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::commitTransientZoom):
* Source/WebKit/WebProcess/WebPage/DrawingArea.messages.in:
* Source/WebKit/WebProcess/WebPage/mac/RemoteLayerTreeDrawingAreaMac.h:
* Source/WebKit/WebProcess/WebPage/mac/RemoteLayerTreeDrawingAreaMac.mm:
(WebKit::RemoteLayerTreeDrawingAreaMac::commitTransientZoom):
* Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::commitTransientZoom):
* Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
* Tools/TestRunnerShared/UIScriptContext/UIScriptController.h:
(WTR::UIScriptController::setWebViewAllowsMagnification):
* Tools/WebKitTestRunner/EventSenderProxy.h:
* Tools/WebKitTestRunner/InjectedBundle/Bindings/EventSendingController.idl:
* Tools/WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
(WTR::EventSendingController::smartMagnify):
* Tools/WebKitTestRunner/InjectedBundle/EventSendingController.h:
* Tools/WebKitTestRunner/TestController.cpp:
(WTR::TestController::didReceiveSynchronousMessageFromInjectedBundle):
* Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::TestController::cocoaResetStateToConsistentValues):
* Tools/WebKitTestRunner/mac/EventSenderProxy.mm:
(-[EventSenderSyntheticEvent initSmartMagnifyEventAtLocation:globalLocation:time:eventNumber:window:]):
(WTR::EventSenderProxy::smartMagnify):
* Tools/WebKitTestRunner/mac/UIScriptControllerMac.h:
* Tools/WebKitTestRunner/mac/UIScriptControllerMac.mm:
(WTR::UIScriptControllerMac::setWebViewAllowsMagnification):

Canonical link: https://commits.webkit.org/272128@main




More information about the webkit-changes mailing list