Changeset 232351 in webkit
- Timestamp:
- May 31, 2018 9:47:31 AM (6 years ago)
- Location:
- trunk/Tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r232343 r232351 1 2018-05-31 Chris Dumez <cdumez@apple.com> 2 3 [iOS] API test ScrollViewInsetTests.InnerHeightWithLargeTopContentInset is a flaky failure 4 https://bugs.webkit.org/show_bug.cgi?id=184893 5 <rdar://problem/39747271> 6 7 Reviewed by Wenson Hsieh. 8 9 Update test to wait until the view is the expected height instead of 10 calling waitForNextPresentationUpdate once and expect the view to 11 have the right height. This fixes the flakiness. 12 13 * TestWebKitAPI/Tests/ios/ScrollViewInsetTests.mm: 14 (TestWebKitAPI::waitUntilInnerHeightIs): 15 (TestWebKitAPI::TEST): 16 1 17 2018-05-31 Leo Balter <leonardo.balter@gmail.com> 2 18 -
trunk/Tools/TestWebKitAPI/Tests/ios/ScrollViewInsetTests.mm
r230883 r232351 77 77 static NSString *veryTallDocumentMarkup = @"<meta name='viewport' content='width=device-width, initial-scale=1'><body style='width: 100%; height: 5000px'>"; 78 78 79 static void waitUntilInnerHeightIs(TestWKWebView *webView, CGFloat expectedValue) 80 { 81 int tries = 0; 82 do { 83 Util::sleep(0.1); 84 } while ([[webView objectByEvaluatingJavaScript:@"innerHeight"] floatValue] != expectedValue && ++tries <= 100); 85 } 86 79 87 TEST(ScrollViewInsetTests, InnerHeightWithLargeTopContentInset) 80 88 { … … 82 90 [webView scrollView].contentInset = UIEdgeInsetsMake(400, 0, 0, 0); 83 91 [webView synchronouslyLoadHTMLString:veryTallDocumentMarkup]; 92 84 93 [webView stringByEvaluatingJavaScript:@"scrollTo(0, 10)"]; 85 [webView waitForNextPresentationUpdate];94 waitUntilInnerHeightIs(webView.get(), viewHeight); 86 95 EXPECT_EQ(viewHeight, [[webView objectByEvaluatingJavaScript:@"innerHeight"] floatValue]); 87 96 EXPECT_EQ(10, [[webView objectByEvaluatingJavaScript:@"pageYOffset"] floatValue]); 88 97 89 98 [webView stringByEvaluatingJavaScript:@"scrollBy(0, -10)"]; 90 [webView waitForNextPresentationUpdate];99 waitUntilInnerHeightIs(webView.get(), viewHeight); 91 100 EXPECT_EQ(viewHeight, [[webView objectByEvaluatingJavaScript:@"innerHeight"] floatValue]); 92 101 EXPECT_EQ(0, [[webView objectByEvaluatingJavaScript:@"pageYOffset"] floatValue]); 93 102 94 103 [webView stringByEvaluatingJavaScript:@"scrollBy(0, 20)"]; 95 [webView waitForNextPresentationUpdate];104 waitUntilInnerHeightIs(webView.get(), viewHeight); 96 105 EXPECT_EQ(viewHeight, [[webView objectByEvaluatingJavaScript:@"innerHeight"] floatValue]); 97 106 EXPECT_EQ(20, [[webView objectByEvaluatingJavaScript:@"pageYOffset"] floatValue]);
Note: See TracChangeset
for help on using the changeset viewer.