Title: [206572] trunk/Tools
- Revision
- 206572
- Author
- [email protected]
- Date
- 2016-09-28 18:14:38 -0700 (Wed, 28 Sep 2016)
Log Message
API test WebKit2.AutoLayoutIntegration is a flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=160284
Reviewed by Dan Bernstein.
* TestWebKitAPI/Tests/WebKit2Cocoa/AutoLayoutIntegration.mm:
(-[AutoLayoutWKWebView load:withWidth:expectingContentSize:resettingWidth:]):
(-[AutoLayoutWKWebView beginLayoutAtMinimumWidth:andExpectContentSizeChange:]):
(-[AutoLayoutWKWebView waitForContentSizeChangeResettingWidth:]):
(-[AutoLayoutWKWebView layoutAtMinimumWidth:andExpectContentSizeChange:resettingWidth:]):
(-[AutoLayoutWKWebView invalidateIntrinsicContentSize]):
(TEST):
Make the autolayout tests a bit more flexible regarding the ordering of
invalidateIntrinsicContentSize, to avoid a race between the load
completing and the invalidation.
Also, move the newly added test to use its own WKWebView, since once in a
while we get a first layout notification from the previous page, causing the test to fail.
Un-disable the tests, which now run without any flakes for me with quite a few iterations.
Modified Paths
Diff
Modified: trunk/Tools/ChangeLog (206571 => 206572)
--- trunk/Tools/ChangeLog 2016-09-29 00:58:02 UTC (rev 206571)
+++ trunk/Tools/ChangeLog 2016-09-29 01:14:38 UTC (rev 206572)
@@ -1,3 +1,26 @@
+2016-09-28 Tim Horton <[email protected]>
+
+ API test WebKit2.AutoLayoutIntegration is a flaky timeout
+ https://bugs.webkit.org/show_bug.cgi?id=160284
+
+ Reviewed by Dan Bernstein.
+
+ * TestWebKitAPI/Tests/WebKit2Cocoa/AutoLayoutIntegration.mm:
+ (-[AutoLayoutWKWebView load:withWidth:expectingContentSize:resettingWidth:]):
+ (-[AutoLayoutWKWebView beginLayoutAtMinimumWidth:andExpectContentSizeChange:]):
+ (-[AutoLayoutWKWebView waitForContentSizeChangeResettingWidth:]):
+ (-[AutoLayoutWKWebView layoutAtMinimumWidth:andExpectContentSizeChange:resettingWidth:]):
+ (-[AutoLayoutWKWebView invalidateIntrinsicContentSize]):
+ (TEST):
+ Make the autolayout tests a bit more flexible regarding the ordering of
+ invalidateIntrinsicContentSize, to avoid a race between the load
+ completing and the invalidation.
+
+ Also, move the newly added test to use its own WKWebView, since once in a
+ while we get a first layout notification from the previous page, causing the test to fail.
+
+ Un-disable the tests, which now run without any flakes for me with quite a few iterations.
+
2016-09-28 Alex Christensen <[email protected]>
URLParser should properly handle unexpected periods and overflows in IPv4 addresses
Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/AutoLayoutIntegration.mm (206571 => 206572)
--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/AutoLayoutIntegration.mm 2016-09-29 00:58:02 UTC (rev 206571)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/AutoLayoutIntegration.mm 2016-09-29 01:14:38 UTC (rev 206572)
@@ -70,12 +70,13 @@
"</style>";
[self loadHTMLString:[baseHTML stringByAppendingString:HTMLString] baseURL:nil];
+ [self beginLayoutAtMinimumWidth:width andExpectContentSizeChange:size];
[self _test_waitForDidFinishNavigation];
- [self layoutAtMinimumWidth:width andExpectContentSizeChange:size resettingWidth:resetAfter];
+ [self waitForContentSizeChangeResettingWidth:resetAfter];
}
-- (void)layoutAtMinimumWidth:(CGFloat)width andExpectContentSizeChange:(NSSize)size resettingWidth:(BOOL)resetAfter
+- (void)beginLayoutAtMinimumWidth:(CGFloat)width andExpectContentSizeChange:(NSSize)size
{
[self _setMinimumLayoutWidth:width];
@@ -85,12 +86,26 @@
_expectingIntrinsicContentSizeChange = YES;
_expectedIntrinsicContentSize = size;
didInvalidateIntrinsicContentSize = false;
+}
+
+- (void)waitForContentSizeChangeResettingWidth:(BOOL)resetAfter
+{
TestWebKitAPI::Util::run(&didInvalidateIntrinsicContentSize);
+ NSSize intrinsicContentSize = self.intrinsicContentSize;
+ EXPECT_EQ(_expectedIntrinsicContentSize.width, intrinsicContentSize.width);
+ EXPECT_EQ(_expectedIntrinsicContentSize.height, intrinsicContentSize.height);
+
if (resetAfter)
[self _setMinimumLayoutWidth:0];
}
+- (void)layoutAtMinimumWidth:(CGFloat)width andExpectContentSizeChange:(NSSize)size resettingWidth:(BOOL)resetAfter
+{
+ [self beginLayoutAtMinimumWidth:width andExpectContentSizeChange:size];
+ [self waitForContentSizeChangeResettingWidth:resetAfter];
+}
+
- (void)invalidateIntrinsicContentSize
{
if (!_expectingIntrinsicContentSizeChange)
@@ -97,17 +112,12 @@
return;
_expectingIntrinsicContentSizeChange = NO;
-
- NSSize intrinsicContentSize = self.intrinsicContentSize;
- EXPECT_EQ(_expectedIntrinsicContentSize.width, intrinsicContentSize.width);
- EXPECT_EQ(_expectedIntrinsicContentSize.height, intrinsicContentSize.height);
-
didInvalidateIntrinsicContentSize = true;
}
@end
-TEST(WebKit2, DISABLED_AutoLayoutIntegration)
+TEST(WebKit2, AutoLayoutIntegration)
{
RetainPtr<AutoLayoutWKWebView> webView = adoptNS([[AutoLayoutWKWebView alloc] initWithFrame:NSMakeRect(0, 0, 1000, 1000)]);
@@ -156,7 +166,12 @@
TestWebKitAPI::Util::run(&didEvaluateJavaScript);
didEvaluateJavaScript = false;
[webView _setShouldExpandContentToViewHeightForAutoLayout:NO];
+}
+TEST(WebKit2, AutoLayoutRenderingProgressRelativeOrdering)
+{
+ RetainPtr<AutoLayoutWKWebView> webView = adoptNS([[AutoLayoutWKWebView alloc] initWithFrame:NSMakeRect(0, 0, 1000, 1000)]);
+
auto navigationDelegate = adoptNS([[TestNavigationDelegate alloc] init]);
__block bool didFinishNavigation = false;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes