Changeset 242979 in webkit
- Timestamp:
- Mar 14, 2019, 6:10:09 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 20 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/resources/ui-helper.js (modified) (4 diffs)
-
Source/WebKit/ChangeLog (modified) (1 diff)
-
Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm (modified) (1 diff)
-
Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h (modified) (1 diff)
-
Source/WebKit/UIProcess/Cocoa/PageClientImplCocoa.h (modified) (1 diff)
-
Source/WebKit/UIProcess/Cocoa/PageClientImplCocoa.mm (modified) (1 diff)
-
Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm (modified) (1 diff)
-
Source/WebKit/UIProcess/PageClient.h (modified) (1 diff)
-
Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp (modified) (1 diff)
-
Source/WebKit/UIProcess/WebPageProxy.h (modified) (1 diff)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm (modified) (1 diff)
-
Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl (modified) (1 diff)
-
Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp (modified) (1 diff)
-
Tools/TestRunnerShared/UIScriptContext/UIScriptController.h (modified) (1 diff)
-
Tools/WebKitTestRunner/cocoa/TestRunnerWKWebView.h (modified) (1 diff)
-
Tools/WebKitTestRunner/cocoa/TestRunnerWKWebView.mm (modified) (5 diffs)
-
Tools/WebKitTestRunner/ios/TestControllerIOS.mm (modified) (1 diff)
-
Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r242974 r242979 1 2019-03-14 Simon Fraser <simon.fraser@apple.com> 2 3 Make it possible to test scrolling tree layer manipulation more easily 4 https://bugs.webkit.org/show_bug.cgi?id=195780 5 6 Reviewed by Tim Horton. 7 8 Add a boolean attribute 'scrollUpdatesDisabled' on UIScriptController that 9 cuts off communication of scrolling tree scrolls back to the web process 10 (in RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll()). This 11 allows tests to trigger scrolls which run the scrolling tree layer positioning 12 logic, but never get another commit from the web process that might mask 13 scrolling tree bugs. 14 15 WKWebView's testing protocol get @property _scrollingUpdatesDisabledForTesting, 16 whose getters and setters are overridden by TestRunnerWKWebView. Plumbing 17 via PageClient and WebPageProxy makes this flag reachable by RemoteScrollingCoordinatorProxy. 18 19 * resources/ui-helper.js: Some 'async' functions that awaited promises should just return 20 the promise. 21 (window.UIHelper.immediateScrollTo): 22 (window.UIHelper.immediateUnstableScrollTo): 23 (window.UIHelper.async.delayFor): Deleted. 24 (window.UIHelper.async.immediateScrollTo): Deleted. 25 (window.UIHelper.async.immediateUnstableScrollTo): Deleted. 26 1 27 2019-03-14 Justin Fan <justin_fan@apple.com> 2 28 -
trunk/LayoutTests/resources/ui-helper.js
r242757 r242979 223 223 } 224 224 225 static asyncdelayFor(ms)225 static delayFor(ms) 226 226 { 227 227 return new Promise(resolve => setTimeout(resolve, ms)); 228 228 } 229 229 230 static asyncimmediateScrollTo(x, y)230 static immediateScrollTo(x, y) 231 231 { 232 232 if (!this.isWebKit2()) { … … 235 235 } 236 236 237 awaitnew Promise(resolve => {237 return new Promise(resolve => { 238 238 testRunner.runUIScript(` 239 239 uiController.immediateScrollToOffset(${x}, ${y});`, resolve); … … 241 241 } 242 242 243 static asyncimmediateUnstableScrollTo(x, y)243 static immediateUnstableScrollTo(x, y) 244 244 { 245 245 if (!this.isWebKit2()) { … … 248 248 } 249 249 250 awaitnew Promise(resolve => {250 return new Promise(resolve => { 251 251 testRunner.runUIScript(` 252 252 uiController.stableStateOverride = false; -
trunk/Source/WebKit/ChangeLog
r242975 r242979 1 2019-03-14 Simon Fraser <simon.fraser@apple.com> 2 3 Make it possible to test scrolling tree layer manipulation more easily 4 https://bugs.webkit.org/show_bug.cgi?id=195780 5 6 Reviewed by Tim Horton. 7 8 Add a boolean attribute 'scrollUpdatesDisabled' on UIScriptController that 9 cuts off communication of scrolling tree scrolls back to the web process 10 (in RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll()). This 11 allows tests to trigger scrolls which run the scrolling tree layer positioning 12 logic, but never get another commit from the web process that might mask 13 scrolling tree bugs. 14 15 WKWebView's testing protocol get @property _scrollingUpdatesDisabledForTesting, 16 whose getters and setters are overridden by TestRunnerWKWebView. Plumbing 17 via PageClient and WebPageProxy makes this flag reachable by RemoteScrollingCoordinatorProxy. 18 19 * UIProcess/API/Cocoa/WKWebView.mm: 20 (-[WKWebView _scrollingUpdatesDisabledForTesting]): 21 (-[WKWebView _setScrollingUpdatesDisabledForTesting:]): 22 * UIProcess/API/Cocoa/WKWebViewPrivate.h: 23 * UIProcess/Cocoa/PageClientImplCocoa.h: 24 * UIProcess/Cocoa/PageClientImplCocoa.mm: 25 (WebKit::PageClientImplCocoa::scrollingUpdatesDisabledForTesting): 26 * UIProcess/Cocoa/WebPageProxyCocoa.mm: 27 (WebKit::WebPageProxy::scrollingUpdatesDisabledForTesting): 28 * UIProcess/PageClient.h: 29 (WebKit::PageClient::scrollingUpdatesDisabledForTesting): 30 * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp: 31 (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll): 32 * UIProcess/WebPageProxy.h: 33 1 34 2019-03-14 Youenn Fablet <youenn@apple.com> 2 35 -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
r242968 r242979 7114 7114 } 7115 7115 7116 - (BOOL)_scrollingUpdatesDisabledForTesting 7117 { 7118 // For subclasses to override; 7119 return NO; 7120 } 7121 7122 - (void)_setScrollingUpdatesDisabledForTesting:(BOOL)disabled 7123 { 7124 } 7125 7116 7126 // Execute the supplied block after the next transaction from the WebProcess. 7117 7127 - (void)_doAfterNextPresentationUpdate:(void (^)(void))updateBlock -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h
r242696 r242979 552 552 @property (nonatomic, readonly) _WKFrameHandle *_mainFrame WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA)); 553 553 554 @property (nonatomic, setter=_setScrollingUpdatesDisabledForTesting:) BOOL _scrollingUpdatesDisabledForTesting WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA)); 555 554 556 - (void)_processWillSuspendImminentlyForTesting; 555 557 - (void)_processDidResumeForTesting; -
trunk/Source/WebKit/UIProcess/Cocoa/PageClientImplCocoa.h
r238726 r242979 44 44 void isPlayingAudioDidChange() final; 45 45 46 bool scrollingUpdatesDisabledForTesting() final; 47 46 48 #if ENABLE(ATTACHMENT_ELEMENT) 47 49 void didInsertAttachment(API::Attachment&, const String& source) final; -
trunk/Source/WebKit/UIProcess/Cocoa/PageClientImplCocoa.mm
r242339 r242979 42 42 } 43 43 44 bool PageClientImplCocoa::scrollingUpdatesDisabledForTesting() 45 { 46 return [m_webView _scrollingUpdatesDisabledForTesting]; 47 } 48 44 49 #if ENABLE(ATTACHMENT_ELEMENT) 45 50 -
trunk/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm
r242748 r242979 136 136 } 137 137 138 bool WebPageProxy::scrollingUpdatesDisabledForTesting() 139 { 140 return pageClient().scrollingUpdatesDisabledForTesting(); 141 } 142 138 143 #if ENABLE(DRAG_SUPPORT) 139 144 -
trunk/Source/WebKit/UIProcess/PageClient.h
r242757 r242979 424 424 virtual void isPlayingAudioWillChange() = 0; 425 425 virtual void isPlayingAudioDidChange() = 0; 426 426 427 virtual void pinnedStateWillChange() { } 427 428 virtual void pinnedStateDidChange() { } 429 virtual bool scrollingUpdatesDisabledForTesting() { return false; } 428 430 429 431 virtual bool hasSafeBrowsingWarning() const { return false; } -
trunk/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp
r242913 r242979 205 205 return; 206 206 207 if (m_webPageProxy.scrollingUpdatesDisabledForTesting()) 208 return; 209 207 210 #if PLATFORM(IOS_FAMILY) 208 211 m_webPageProxy.scrollingNodeScrollViewDidScroll(); -
trunk/Source/WebKit/UIProcess/WebPageProxy.h
r242952 r242979 1310 1310 #endif 1311 1311 1312 bool scrollingUpdatesDisabledForTesting(); 1313 1312 1314 void installActivityStateChangeCompletionHandler(Function<void()>&&); 1313 1315 -
trunk/Tools/ChangeLog
r242975 r242979 1 2019-03-14 Simon Fraser <simon.fraser@apple.com> 2 3 Make it possible to test scrolling tree layer manipulation more easily 4 https://bugs.webkit.org/show_bug.cgi?id=195780 5 6 Reviewed by Tim Horton. 7 8 Add a boolean attribute 'scrollUpdatesDisabled' on UIScriptController that 9 cuts off communication of scrolling tree scrolls back to the web process 10 (in RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll()). This 11 allows tests to trigger scrolls which run the scrolling tree layer positioning 12 logic, but never get another commit from the web process that might mask 13 scrolling tree bugs. 14 15 WKWebView's testing protocol get @property _scrollingUpdatesDisabledForTesting, 16 whose getters and setters are overridden by TestRunnerWKWebView. Plumbing 17 via PageClient and WebPageProxy makes this flag reachable by RemoteScrollingCoordinatorProxy. 18 19 * DumpRenderTree/ios/UIScriptControllerIOS.mm: 20 (WTR::UIScriptController::scrollUpdatesDisabled const): 21 (WTR::UIScriptController::setScrollUpdatesDisabled): 22 * TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl: 23 * TestRunnerShared/UIScriptContext/UIScriptController.cpp: 24 (WTR::UIScriptController::scrollUpdatesDisabled const): 25 (WTR::UIScriptController::setScrollUpdatesDisabled): 26 * TestRunnerShared/UIScriptContext/UIScriptController.h: 27 * WebKitTestRunner/cocoa/TestRunnerWKWebView.h: 28 * WebKitTestRunner/cocoa/TestRunnerWKWebView.mm: 29 (-[TestRunnerWKWebView _scrollingUpdatesDisabledForTesting]): 30 (-[TestRunnerWKWebView _setScrollingUpdatesDisabledForTesting:]): 31 * WebKitTestRunner/ios/TestControllerIOS.mm: 32 (WTR::TestController::platformResetStateToConsistentValues): 33 * WebKitTestRunner/ios/UIScriptControllerIOS.mm: 34 (WTR::UIScriptController::scrollUpdatesDisabled const): 35 (WTR::UIScriptController::setScrollUpdatesDisabled): 36 1 37 2019-03-14 Youenn Fablet <youenn@apple.com> 2 38 -
trunk/Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm
r242773 r242979 239 239 } 240 240 241 bool UIScriptController::scrollUpdatesDisabled() const 242 { 243 return false; 244 } 245 246 void UIScriptController::setScrollUpdatesDisabled(bool) 247 { 248 } 249 241 250 void UIScriptController::scrollToOffset(long x, long y) 242 251 { -
trunk/Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl
r242773 r242979 245 245 readonly attribute double contentOffsetY; 246 246 247 attribute boolean scrollUpdatesDisabled; // Turns off notifications back to the web process after scrolls (used for testing scrolling tree). 248 247 249 void scrollToOffset(long x, long y); // Initiate an animated scroll in the UI process. 248 250 attribute object didEndScrollingCallback; -
trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp
r242773 r242979 386 386 } 387 387 388 bool UIScriptController::scrollUpdatesDisabled() const 389 { 390 return false; 391 } 392 393 void UIScriptController::setScrollUpdatesDisabled(bool) 394 { 395 } 396 388 397 void UIScriptController::scrollToOffset(long x, long y) 389 398 { -
trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.h
r242773 r242979 126 126 double contentOffsetY() const; 127 127 128 bool scrollUpdatesDisabled() const; 129 void setScrollUpdatesDisabled(bool); 130 128 131 void scrollToOffset(long x, long y); 129 132 -
trunk/Tools/WebKitTestRunner/cocoa/TestRunnerWKWebView.h
r242339 r242979 62 62 63 63 @property (nonatomic, retain, setter=_setStableStateOverride:) NSNumber *_stableStateOverride; 64 @property (nonatomic, setter=_setScrollingUpdatesDisabledForTesting:) BOOL _scrollingUpdatesDisabledForTesting; 64 65 65 66 @end -
trunk/Tools/WebKitTestRunner/cocoa/TestRunnerWKWebView.mm
r242339 r242979 48 48 @interface TestRunnerWKWebView () <WKUIDelegatePrivate> { 49 49 RetainPtr<NSNumber> m_stableStateOverride; 50 BOOL m_isInteractingWithFormControl; 50 BOOL _isInteractingWithFormControl; 51 BOOL _scrollingUpdatesDisabled; 51 52 } 52 53 … … 109 110 - (void)didStartFormControlInteraction 110 111 { 111 m_isInteractingWithFormControl = YES;112 _isInteractingWithFormControl = YES; 112 113 113 114 if (self.didStartFormControlInteractionCallback) … … 117 118 - (void)didEndFormControlInteraction 118 119 { 119 m_isInteractingWithFormControl = NO;120 _isInteractingWithFormControl = NO; 120 121 121 122 if (self.didEndFormControlInteractionCallback) … … 125 126 - (BOOL)isInteractingWithFormControl 126 127 { 127 return m_isInteractingWithFormControl;128 return _isInteractingWithFormControl; 128 129 } 129 130 … … 235 236 } 236 237 238 - (BOOL)_scrollingUpdatesDisabledForTesting 239 { 240 return _scrollingUpdatesDisabled; 241 } 242 243 - (void)_setScrollingUpdatesDisabledForTesting:(BOOL)disabled 244 { 245 _scrollingUpdatesDisabled = disabled; 246 } 247 237 248 - (void)_didEndRotation 238 249 { -
trunk/Tools/WebKitTestRunner/ios/TestControllerIOS.mm
r242621 r242979 147 147 TestRunnerWKWebView *webView = platformWebView->platformView(); 148 148 webView._stableStateOverride = nil; 149 webView._scrollingUpdatesDisabledForTesting = NO; 149 150 webView.usesSafariLikeRotation = NO; 150 151 webView.overrideSafeAreaInsets = UIEdgeInsetsZero; -
trunk/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm
r242773 r242979 547 547 } 548 548 549 bool UIScriptController::scrollUpdatesDisabled() const 550 { 551 TestRunnerWKWebView *webView = TestController::singleton().mainWebView()->platformView(); 552 return webView._scrollingUpdatesDisabledForTesting; 553 } 554 555 void UIScriptController::setScrollUpdatesDisabled(bool disabled) 556 { 557 TestRunnerWKWebView *webView = TestController::singleton().mainWebView()->platformView(); 558 webView._scrollingUpdatesDisabledForTesting = disabled; 559 } 560 549 561 void UIScriptController::scrollToOffset(long x, long y) 550 562 {
Note:
See TracChangeset
for help on using the changeset viewer.