WebKit Bugzilla
Attachment 339029 Details for
Bug 184918
: REGRESSION (r230919): API test WebKit.AutoLayoutIntegration is a flaky failure
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-184918-20180427143022.patch (text/plain), 5.06 KB, created by
Chris Dumez
on 2018-04-27 14:30:23 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Chris Dumez
Created:
2018-04-27 14:30:23 PDT
Size:
5.06 KB
patch
obsolete
>Subversion Revision: 230939 >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index ad7e975afc6a798df71900e04e21ecb71ea69a15..daf86eea1e146fde1c1b9a720b2dc02a1aace209 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,24 @@ >+2018-04-27 Chris Dumez <cdumez@apple.com> >+ >+ REGRESSION (r230919): API test WebKit.AutoLayoutIntegration is a flaky failure >+ https://bugs.webkit.org/show_bug.cgi?id=184918 >+ <rdar://problem/39705516> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Make sure provisional load has started before calling beginLayoutAtMinimumWidth >+ on the AutoLayoutWKWebView to restore pre-r230919 behavior. The load now starts >+ asynchronously because we ask the client if it is OK to do the load and the policy >+ delegates are asynchronous nowadays. >+ >+ * TestWebKitAPI/Tests/WebKitCocoa/AutoLayoutIntegration.mm: >+ (-[AutoLayoutWKWebView load:withWidth:expectingContentSize:resettingWidth:]): >+ * TestWebKitAPI/cocoa/TestNavigationDelegate.h: >+ * TestWebKitAPI/cocoa/TestNavigationDelegate.mm: >+ (-[TestNavigationDelegate webView:didStartProvisionalNavigation:]): >+ (-[TestNavigationDelegate waitForDidStartProvisionalNavigation]): >+ (-[WKWebView _test_waitForDidStartProvisionalNavigation]): >+ > 2018-04-23 Zalan Bujtas <zalan@apple.com> > > [LayoutFormattingContext] Initial commit. >diff --git a/Tools/TestWebKitAPI/Tests/WebKitCocoa/AutoLayoutIntegration.mm b/Tools/TestWebKitAPI/Tests/WebKitCocoa/AutoLayoutIntegration.mm >index 7c39c3ce8224839e1a59108626f29d9d36b63c9e..a14744d86a0620515a698399d3f83fc79928cb13 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitCocoa/AutoLayoutIntegration.mm >+++ b/Tools/TestWebKitAPI/Tests/WebKitCocoa/AutoLayoutIntegration.mm >@@ -71,6 +71,7 @@ - (void)load:(NSString *)HTMLString withWidth:(CGFloat)width expectingContentSiz > "</style>"; > > [self loadHTMLString:[baseHTML stringByAppendingString:HTMLString] baseURL:nil]; >+ [self _test_waitForDidStartProvisionalNavigation]; > [self beginLayoutAtMinimumWidth:width andExpectContentSizeChange:size]; > [self _test_waitForDidFinishNavigation]; > >diff --git a/Tools/TestWebKitAPI/cocoa/TestNavigationDelegate.h b/Tools/TestWebKitAPI/cocoa/TestNavigationDelegate.h >index 7a382c7c9c2a7441caa8dd27a289fbb4218cd834..16a0bceadee9e912337be2e75700696457f136f5 100644 >--- a/Tools/TestWebKitAPI/cocoa/TestNavigationDelegate.h >+++ b/Tools/TestWebKitAPI/cocoa/TestNavigationDelegate.h >@@ -33,15 +33,18 @@ > @interface TestNavigationDelegate : NSObject <WKNavigationDelegate> > > @property (nonatomic, copy) void (^didFailProvisionalNavigation)(WKWebView *, WKNavigation *, NSError *); >+@property (nonatomic, copy) void (^didStartProvisionalNavigation)(WKWebView *, WKNavigation *); > @property (nonatomic, copy) void (^didFinishNavigation)(WKWebView *, WKNavigation *); > @property (nonatomic, copy) void (^renderingProgressDidChange)(WKWebView *, _WKRenderingProgressEvents); > @property (nonatomic, copy) void (^webContentProcessDidTerminate)(WKWebView *); > >+- (void)waitForDidStartProvisionalNavigation; > - (void)waitForDidFinishNavigation; > > @end > > @interface WKWebView (TestWebKitAPIExtras) >+- (void)_test_waitForDidStartProvisionalNavigation; > - (void)_test_waitForDidFinishNavigation; > @end > >diff --git a/Tools/TestWebKitAPI/cocoa/TestNavigationDelegate.mm b/Tools/TestWebKitAPI/cocoa/TestNavigationDelegate.mm >index f5dfd5df8cba2e5c69d58035f9b56142832bf44e..4d5bc8b81442e321044d57ca58006c523230890b 100644 >--- a/Tools/TestWebKitAPI/cocoa/TestNavigationDelegate.mm >+++ b/Tools/TestWebKitAPI/cocoa/TestNavigationDelegate.mm >@@ -33,6 +33,12 @@ > > @implementation TestNavigationDelegate > >+- (void)webView:(WKWebView *)webView didStartProvisionalNavigation:(WKNavigation *)navigation >+{ >+ if (_didStartProvisionalNavigation) >+ _didStartProvisionalNavigation(webView, navigation); >+} >+ > - (void)webView:(WKWebView *)webView didFailProvisionalNavigation:(WKNavigation *)navigation withError:(NSError *)error > { > if (_didFailProvisionalNavigation) >@@ -57,6 +63,20 @@ - (void)_webView:(WKWebView *)webView renderingProgressDidChange:(_WKRenderingPr > _renderingProgressDidChange(webView, progressEvents); > } > >+- (void)waitForDidStartProvisionalNavigation >+{ >+ EXPECT_FALSE(self.didStartProvisionalNavigation); >+ >+ __block bool finished = false; >+ self.didStartProvisionalNavigation = ^(WKWebView *, WKNavigation *) { >+ finished = true; >+ }; >+ >+ TestWebKitAPI::Util::run(&finished); >+ >+ self.didStartProvisionalNavigation = nil; >+} >+ > - (void)waitForDidFinishNavigation > { > EXPECT_FALSE(self.didFinishNavigation); >@@ -75,6 +95,17 @@ @end > > @implementation WKWebView (TestWebKitAPIExtras) > >+- (void)_test_waitForDidStartProvisionalNavigation >+{ >+ EXPECT_FALSE(self.navigationDelegate); >+ >+ auto navigationDelegate = adoptNS([[TestNavigationDelegate alloc] init]); >+ self.navigationDelegate = navigationDelegate.get(); >+ [navigationDelegate waitForDidStartProvisionalNavigation]; >+ >+ self.navigationDelegate = nil; >+} >+ > - (void)_test_waitForDidFinishNavigation > { > EXPECT_FALSE(self.navigationDelegate);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 184918
: 339029