Title: [210101] trunk/Tools
- Revision
- 210101
- Author
- [email protected]
- Date
- 2016-12-22 09:37:50 -0800 (Thu, 22 Dec 2016)
Log Message
fast/events/ios/viewport-shrink-to-fit-allows-double-tap.html is flaky/order dependent
https://bugs.webkit.org/show_bug.cgi?id=161328
<rdar://problem/28475977>
Reviewed by Darin Adler.
Running a test that scales the viewport and listens to a didEndZooming callback (such as
viewport-shrink-to-fit-allows-double-tap.html) immediately after a test that may begin to trigger viewport
scaling as the test completes (such as viewport-device-width-at-initial-scale-fast-clicks.html) may result in
the didEndZooming callback of the latter test being fired early due to the previous test triggering a zoom
animation. Ideally, -[WKScrollView _stopScrollingAndZoomingAnimations], which is called when committing the page
load, should prevent this from happening, but from reading documentation and code inspection, this is not
intended to fire any associated delegate methods or notifications of the UIScrollView, instead deferring them
for later. Instead, what we need in this case is to clear out any started but not yet completed animations after
we finish running a test and before we load the next test.
One way to do this is to remove all animations from the WKScrollView's layer, and the layers of its children,
recursively. Doing so causes scrollViewDidEndZooming:withView:atScale: to fire at the end of the runloop if the
previous test started zooming and then finished before zooming completed. Since this happens before the next
test has a chance to run UI-side scripts, we won't end up firing this callback prematurely during the next test.
* WebKitTestRunner/ios/TestControllerIOS.mm:
(WTR::TestController::platformResetStateToConsistentValues):
Modified Paths
Diff
Modified: trunk/Tools/ChangeLog (210100 => 210101)
--- trunk/Tools/ChangeLog 2016-12-22 17:32:38 UTC (rev 210100)
+++ trunk/Tools/ChangeLog 2016-12-22 17:37:50 UTC (rev 210101)
@@ -1,3 +1,29 @@
+2016-12-22 Wenson Hsieh <[email protected]>
+
+ fast/events/ios/viewport-shrink-to-fit-allows-double-tap.html is flaky/order dependent
+ https://bugs.webkit.org/show_bug.cgi?id=161328
+ <rdar://problem/28475977>
+
+ Reviewed by Darin Adler.
+
+ Running a test that scales the viewport and listens to a didEndZooming callback (such as
+ viewport-shrink-to-fit-allows-double-tap.html) immediately after a test that may begin to trigger viewport
+ scaling as the test completes (such as viewport-device-width-at-initial-scale-fast-clicks.html) may result in
+ the didEndZooming callback of the latter test being fired early due to the previous test triggering a zoom
+ animation. Ideally, -[WKScrollView _stopScrollingAndZoomingAnimations], which is called when committing the page
+ load, should prevent this from happening, but from reading documentation and code inspection, this is not
+ intended to fire any associated delegate methods or notifications of the UIScrollView, instead deferring them
+ for later. Instead, what we need in this case is to clear out any started but not yet completed animations after
+ we finish running a test and before we load the next test.
+
+ One way to do this is to remove all animations from the WKScrollView's layer, and the layers of its children,
+ recursively. Doing so causes scrollViewDidEndZooming:withView:atScale: to fire at the end of the runloop if the
+ previous test started zooming and then finished before zooming completed. Since this happens before the next
+ test has a chance to run UI-side scripts, we won't end up firing this callback prematurely during the next test.
+
+ * WebKitTestRunner/ios/TestControllerIOS.mm:
+ (WTR::TestController::platformResetStateToConsistentValues):
+
2016-12-22 Jer Noble <[email protected]>
Muted media element playback should not interrupt other audio playback
Modified: trunk/Tools/WebKitTestRunner/ios/TestControllerIOS.mm (210100 => 210101)
--- trunk/Tools/WebKitTestRunner/ios/TestControllerIOS.mm 2016-12-22 17:32:38 UTC (rev 210100)
+++ trunk/Tools/WebKitTestRunner/ios/TestControllerIOS.mm 2016-12-22 17:37:50 UTC (rev 210101)
@@ -30,6 +30,7 @@
#import "PlatformWebView.h"
#import "TestInvocation.h"
#import "TestRunnerWKWebView.h"
+#import "UIKitSPI.h"
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <WebKit/WKPreferencesRefPrivate.h>
@@ -89,6 +90,7 @@
if (PlatformWebView* webView = mainWebView()) {
webView->platformView()._stableStateOverride = nil;
UIScrollView *scrollView = webView->platformView().scrollView;
+ [scrollView _removeAllAnimations:YES];
[scrollView setZoomScale:1 animated:NO];
[scrollView setContentOffset:CGPointZero];
}
Modified: trunk/Tools/WebKitTestRunner/ios/UIKitSPI.h (210100 => 210101)
--- trunk/Tools/WebKitTestRunner/ios/UIKitSPI.h 2016-12-22 17:32:38 UTC (rev 210100)
+++ trunk/Tools/WebKitTestRunner/ios/UIKitSPI.h 2016-12-22 17:37:50 UTC (rev 210101)
@@ -36,6 +36,7 @@
#import <UIKit/UIApplication_Private.h>
#import <UIKit/UIKeyboard.h>
+#import <UIKit/UIView_Private.h>
#import <UIKit/UIWindow_Private.h>
@interface UIKeyboardPredictionView : UIView
@@ -60,6 +61,10 @@
+ (void)removeAllDynamicDictionaries;
@end
+@interface UIView ()
+- (void)_removeAllAnimations:(BOOL)includeSubviews;
+@end
+
#endif // USE(APPLE_INTERNAL_SDK)
#endif // PLATFORM(IOS)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes