Bug 164764 - Hard to write reliable UIScriptController scrollingTreeAsText tests
Summary: Hard to write reliable UIScriptController scrollingTreeAsText tests
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Simon Fraser (smfr)
URL:
Keywords:
Depends on:
Blocks: 164766
  Show dependency treegraph
 
Reported: 2016-11-14 20:44 PST by Simon Fraser (smfr)
Modified: 2016-11-16 15:17 PST (History)
2 users (show)

See Also:


Attachments
Patch (1.80 KB, patch)
2016-11-16 15:05 PST, Simon Fraser (smfr)
wenson_hsieh: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2016-11-14 20:44:09 PST
It's very hard to know when the UI process has received a scrolling tree update, so scrollingTreeAsText tests are flakey.
Comment 1 Simon Fraser (smfr) 2016-11-14 21:15:39 PST
Maybe need this:

diff --git a/Tools/WebKitTestRunner/ios/TestControllerIOS.mm b/Tools/WebKitTestRunner/ios/TestControllerIOS.mm
index 03454a5b5d4847e015a142a19b31920141373bb4..452c410c8379b70c6512dad2c0fd0146311afbda 100644
--- a/Tools/WebKitTestRunner/ios/TestControllerIOS.mm
+++ b/Tools/WebKitTestRunner/ios/TestControllerIOS.mm
@@ -28,6 +28,7 @@
 
 #import "PlatformWebView.h"
 #import "TestInvocation.h"
+#import "TestRunnerWKWebView.h"
 #import <Foundation/Foundation.h>
 #import <UIKit/UIKit.h>
 #import <WebKit/WKPreferencesRefPrivate.h>
@@ -83,6 +84,12 @@ void TestController::platformResetPreferencesToConsistentValues()
 void TestController::platformResetStateToConsistentValues()
 {
     cocoaResetStateToConsistentValues();
+
+    if (PlatformWebView* webView = mainWebView()) {
+        UIScrollView *scrollView = webView->platformView().scrollView;
+        [scrollView setZoomScale:1 animated:NO];
+        [scrollView setContentOffset:CGPointZero];
+    }
 }
 
 void TestController::platformConfigureViewForTest(const TestInvocation& test)
Comment 2 Simon Fraser (smfr) 2016-11-16 15:05:24 PST
Created attachment 294981 [details]
Patch
Comment 3 Wenson Hsieh 2016-11-16 15:14:36 PST
Comment on attachment 294981 [details]
Patch

r=mews
Comment 4 Simon Fraser (smfr) 2016-11-16 15:17:34 PST
Committed r208818: <http://trac.webkit.org/changeset/208818>