WebKit Bugzilla
Attachment 341664 Details for
Bug 184893
: [iOS] API test ScrollViewInsetTests.InnerHeightWithLargeTopContentInset is a flaky failure
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-184893-20180531090903.patch (text/plain), 3.12 KB, created by
Chris Dumez
on 2018-05-31 09:09:03 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Chris Dumez
Created:
2018-05-31 09:09:03 PDT
Size:
3.12 KB
patch
obsolete
>Subversion Revision: 232310 >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 4d0b8d94ff46e978bec1460bbd8e32b0c9f34fac..b669edca1214c099ea6e2a0b8457d1353e38f48b 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,19 @@ >+2018-05-30 Chris Dumez <cdumez@apple.com> >+ >+ [iOS] API test ScrollViewInsetTests.InnerHeightWithLargeTopContentInset is a flaky failure >+ https://bugs.webkit.org/show_bug.cgi?id=184893 >+ <rdar://problem/39747271> >+ >+ Reviewed by Wenson Hsieh. >+ >+ Update test to wait until the view is the expected height instead of >+ calling waitForNextPresentationUpdate once and expect the view to >+ have the right height. This fixes the flakiness. >+ >+ * TestWebKitAPI/Tests/ios/ScrollViewInsetTests.mm: >+ (TestWebKitAPI::waitUntilInnerHeightIs): >+ (TestWebKitAPI::TEST): >+ > 2018-05-30 Youenn Fablet <youenn@apple.com> > > Rename CrossOriginResourcePolicy same to same-origin >diff --git a/Tools/TestWebKitAPI/Tests/ios/ScrollViewInsetTests.mm b/Tools/TestWebKitAPI/Tests/ios/ScrollViewInsetTests.mm >index 347fa235f43b14af251cf2297fc5b2ed137241ec..7171f1903cab500ada86be074400c2e7ee1d428a 100644 >--- a/Tools/TestWebKitAPI/Tests/ios/ScrollViewInsetTests.mm >+++ b/Tools/TestWebKitAPI/Tests/ios/ScrollViewInsetTests.mm >@@ -76,23 +76,32 @@ namespace TestWebKitAPI { > static const CGFloat viewHeight = 500; > static NSString *veryTallDocumentMarkup = @"<meta name='viewport' content='width=device-width, initial-scale=1'><body style='width: 100%; height: 5000px'>"; > >+static void waitUntilInnerHeightIs(TestWKWebView *webView, CGFloat expectedValue) >+{ >+ int tries = 0; >+ do { >+ Util::sleep(0.1); >+ } while ([[webView objectByEvaluatingJavaScript:@"innerHeight"] floatValue] != expectedValue && ++tries <= 100); >+} >+ > TEST(ScrollViewInsetTests, InnerHeightWithLargeTopContentInset) > { > auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, viewHeight)]); > [webView scrollView].contentInset = UIEdgeInsetsMake(400, 0, 0, 0); > [webView synchronouslyLoadHTMLString:veryTallDocumentMarkup]; >+ > [webView stringByEvaluatingJavaScript:@"scrollTo(0, 10)"]; >- [webView waitForNextPresentationUpdate]; >+ waitUntilInnerHeightIs(webView.get(), viewHeight); > EXPECT_EQ(viewHeight, [[webView objectByEvaluatingJavaScript:@"innerHeight"] floatValue]); > EXPECT_EQ(10, [[webView objectByEvaluatingJavaScript:@"pageYOffset"] floatValue]); > > [webView stringByEvaluatingJavaScript:@"scrollBy(0, -10)"]; >- [webView waitForNextPresentationUpdate]; >+ waitUntilInnerHeightIs(webView.get(), viewHeight); > EXPECT_EQ(viewHeight, [[webView objectByEvaluatingJavaScript:@"innerHeight"] floatValue]); > EXPECT_EQ(0, [[webView objectByEvaluatingJavaScript:@"pageYOffset"] floatValue]); > > [webView stringByEvaluatingJavaScript:@"scrollBy(0, 20)"]; >- [webView waitForNextPresentationUpdate]; >+ waitUntilInnerHeightIs(webView.get(), viewHeight); > EXPECT_EQ(viewHeight, [[webView objectByEvaluatingJavaScript:@"innerHeight"] floatValue]); > EXPECT_EQ(20, [[webView objectByEvaluatingJavaScript:@"pageYOffset"] floatValue]); > }
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 184893
:
341623
| 341664