Changeset 234614 in webkit
- Timestamp:
- Aug 6, 2018 12:31:06 PM (6 years ago)
- Location:
- trunk/Tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r234613 r234614 1 2018-08-06 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 [iOS] Caret disappears after resigning and becoming first responder if active focus state is retained 4 https://bugs.webkit.org/show_bug.cgi?id=188322 5 <rdar://problem/42455270> 6 7 Reviewed by Tim Horton. 8 9 Fixes an API test added in r234600, which had incorrect test expectations — namely, the width of the caret rect 10 was not in content view coordinates, unlike the x, y, and height. 11 12 * TestWebKitAPI/Tests/ios/KeyboardInputTestsIOS.mm: 13 (rounded): 14 (-[TestWKWebView waitForCaretViewFrameToBecome:]): 15 (-[TestWKWebView waitForSelectionViewRectsToBecome:]): 16 (TestWebKitAPI::TEST): 17 1 18 2018-08-06 Ryan Haddad <ryanhaddad@apple.com> 2 19 -
trunk/Tools/TestWebKitAPI/Tests/ios/KeyboardInputTestsIOS.mm
r234600 r234614 37 37 @implementation TestWKWebView (KeyboardInputTests) 38 38 39 static CGRect rounded(CGRect rect) 40 { 41 return CGRectMake(roundl(rect.origin.x), roundl(rect.origin.y), roundl(rect.size.width), roundl(rect.size.height)); 42 } 43 39 44 - (void)waitForCaretViewFrameToBecome:(CGRect)frame 40 45 { … … 43 48 NSTimeInterval startTime = [NSDate timeIntervalSinceReferenceDate]; 44 49 while ([[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantPast]]) { 45 CGRect currentFrame = self.caretViewRectInContentCoordinates;50 CGRect currentFrame = rounded(self.caretViewRectInContentCoordinates); 46 51 if (CGRectEqualToRect(currentFrame, frame)) 47 52 break; … … 65 70 if (currentRects.count == selectionRects.count) { 66 71 for (NSUInteger index = 0; index < selectionRects.count; ++index) 67 selectionRectsMatch |= [selectionRects[index] isEqualToValue:currentRects[index]];72 selectionRectsMatch |= CGRectEqualToRect(selectionRects[index].CGRectValue, rounded(currentRects[index].CGRectValue)); 68 73 } else 69 74 selectionRectsMatch = NO; … … 125 130 TEST(KeyboardInputTests, CaretSelectionRectAfterRestoringFirstResponder) 126 131 { 127 auto expectedCaretRect = CGRectMake(16, 13, 3, 15);132 auto expectedCaretRect = CGRectMake(16, 13, 2, 15); 128 133 auto webView = webViewWithAutofocusedInput(); 129 134 EXPECT_WK_STREQ("INPUT", [webView stringByEvaluatingJavaScript:@"document.activeElement.tagName"]);
Note: See TracChangeset
for help on using the changeset viewer.