Make it possible to test scrolling tree layer manipulation more easily
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Mar 2019 01:10:09 +0000 (01:10 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Mar 2019 01:10:09 +0000 (01:10 +0000)
commit6043e5fc23786bd53092013e27fbd2bde52c19ff
tree5808e07fac5183794db150b2a5e74165a92c1c86
parent92f1ca102eb9c7b4f92a9f9c8f5a9a8a1322cfbb
Make it possible to test scrolling tree layer manipulation more easily
https://bugs.webkit.org/show_bug.cgi?id=195780

Reviewed by Tim Horton.
Source/WebKit:

Add a boolean attribute 'scrollUpdatesDisabled' on UIScriptController that
cuts off communication of scrolling tree scrolls back to the web process
(in RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll()). This
allows tests to trigger scrolls which run the scrolling tree layer positioning
logic, but never get another commit from the web process that might mask
scrolling tree bugs.

WKWebView's testing protocol get @property _scrollingUpdatesDisabledForTesting,
whose getters and setters are overridden by TestRunnerWKWebView. Plumbing
via PageClient and WebPageProxy makes this flag reachable by RemoteScrollingCoordinatorProxy.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _scrollingUpdatesDisabledForTesting]):
(-[WKWebView _setScrollingUpdatesDisabledForTesting:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/Cocoa/PageClientImplCocoa.h:
* UIProcess/Cocoa/PageClientImplCocoa.mm:
(WebKit::PageClientImplCocoa::scrollingUpdatesDisabledForTesting):
* UIProcess/Cocoa/WebPageProxyCocoa.mm:
(WebKit::WebPageProxy::scrollingUpdatesDisabledForTesting):
* UIProcess/PageClient.h:
(WebKit::PageClient::scrollingUpdatesDisabledForTesting):
* UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
(WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
* UIProcess/WebPageProxy.h:

Tools:

Add a boolean attribute 'scrollUpdatesDisabled' on UIScriptController that
cuts off communication of scrolling tree scrolls back to the web process
(in RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll()). This
allows tests to trigger scrolls which run the scrolling tree layer positioning
logic, but never get another commit from the web process that might mask
scrolling tree bugs.

WKWebView's testing protocol get @property _scrollingUpdatesDisabledForTesting,
whose getters and setters are overridden by TestRunnerWKWebView. Plumbing
via PageClient and WebPageProxy makes this flag reachable by RemoteScrollingCoordinatorProxy.

* DumpRenderTree/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::scrollUpdatesDisabled const):
(WTR::UIScriptController::setScrollUpdatesDisabled):
* TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
* TestRunnerShared/UIScriptContext/UIScriptController.cpp:
(WTR::UIScriptController::scrollUpdatesDisabled const):
(WTR::UIScriptController::setScrollUpdatesDisabled):
* TestRunnerShared/UIScriptContext/UIScriptController.h:
* WebKitTestRunner/cocoa/TestRunnerWKWebView.h:
* WebKitTestRunner/cocoa/TestRunnerWKWebView.mm:
(-[TestRunnerWKWebView _scrollingUpdatesDisabledForTesting]):
(-[TestRunnerWKWebView _setScrollingUpdatesDisabledForTesting:]):
* WebKitTestRunner/ios/TestControllerIOS.mm:
(WTR::TestController::platformResetStateToConsistentValues):
* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::scrollUpdatesDisabled const):
(WTR::UIScriptController::setScrollUpdatesDisabled):

LayoutTests:

Add a boolean attribute 'scrollUpdatesDisabled' on UIScriptController that
cuts off communication of scrolling tree scrolls back to the web process
(in RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll()). This
allows tests to trigger scrolls which run the scrolling tree layer positioning
logic, but never get another commit from the web process that might mask
scrolling tree bugs.

WKWebView's testing protocol get @property _scrollingUpdatesDisabledForTesting,
whose getters and setters are overridden by TestRunnerWKWebView. Plumbing
via PageClient and WebPageProxy makes this flag reachable by RemoteScrollingCoordinatorProxy.

* resources/ui-helper.js: Some 'async' functions that awaited promises should just return
the promise.
(window.UIHelper.immediateScrollTo):
(window.UIHelper.immediateUnstableScrollTo):
(window.UIHelper.async.delayFor): Deleted.
(window.UIHelper.async.immediateScrollTo): Deleted.
(window.UIHelper.async.immediateUnstableScrollTo): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242979 268f45cc-cd09-0410-ab3c-d52691b4dbfc
20 files changed:
LayoutTests/ChangeLog
LayoutTests/resources/ui-helper.js
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h
Source/WebKit/UIProcess/Cocoa/PageClientImplCocoa.h
Source/WebKit/UIProcess/Cocoa/PageClientImplCocoa.mm
Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm
Source/WebKit/UIProcess/PageClient.h
Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp
Source/WebKit/UIProcess/WebPageProxy.h
Tools/ChangeLog
Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm
Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl
Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp
Tools/TestRunnerShared/UIScriptContext/UIScriptController.h
Tools/WebKitTestRunner/cocoa/TestRunnerWKWebView.h
Tools/WebKitTestRunner/cocoa/TestRunnerWKWebView.mm
Tools/WebKitTestRunner/ios/TestControllerIOS.mm
Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm