Skip to content

Commit 43f144d

Browse files
committed
REGRESSION(307394@main): TestWebKitAPI.DocumentEditingContext/AccessibilityTests/RequestTextInputContext tests are constant text failures
https://bugs.webkit.org/show_bug.cgi?id=308666 <rdar://171106709> Unreviewed gardening after 307394@main. * Tools/TestWebKitAPI/Tests/WebKitCocoa/DocumentEditingContext.mm: (TEST(DocumentEditingContext, RequestMarkedText)): * Tools/TestWebKitAPI/Tests/WebKitCocoa/FindInPage.mm: (TEST(WebKit, FindAndHighlightDifferentWebViews)): (TEST(WebKit, RequestRectForFoundTextRange)): * Tools/TestWebKitAPI/Tests/WebKitCocoa/RequestTextInputContext.mm: (TestWebKitAPI::TEST(RequestTextInputContext, FocusedEditableLineWithOnlyLineBreak)): * Tools/TestWebKitAPI/Tests/WebKitCocoa/WritingTools.mm: (TEST(WritingTools, ShowDetailsForSuggestions)): (TEST(WritingTools, IntelligenceTextEffectCoordinatorDelegate_RectsForProofreadingSuggestionsInRange)): * Tools/TestWebKitAPI/Tests/ios/AccessibilityTestsIOS.mm: (TestWebKitAPI::TEST(AccessibilityTests, RectsForSpeakingSelectionBasic)): (TestWebKitAPI::TEST(AccessibilityTests, RectsForSpeakingSelectionWithLineWrapping)): (TestWebKitAPI::TEST(AccessibilityTests, StoreSelection)): Canonical link: https://commits.webkit.org/308279@main
1 parent 7a9e8eb commit 43f144d

5 files changed

Lines changed: 37 additions & 37 deletions

File tree

Tools/TestWebKitAPI/Tests/WebKitCocoa/DocumentEditingContext.mm

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -370,11 +370,11 @@ - (CGRect)waitForFirstSelectionRectToChange:(CGRect)previousRect
370370
NSArray<NSValue *> *rectValues = context.markedTextRects;
371371
EXPECT_EQ(5U, rectValues.count);
372372
if (rectValues.count >= 5) {
373-
EXPECT_EQ(CGRectMake(47, 8, 13, 20), [rectValues[0] CGRectValue]);
374-
EXPECT_EQ(CGRectMake(59, 8, 9, 20), [rectValues[1] CGRectValue]);
375-
EXPECT_EQ(CGRectMake(67, 8, 6, 20), [rectValues[2] CGRectValue]);
376-
EXPECT_EQ(CGRectMake(72, 8, 5, 20), [rectValues[3] CGRectValue]);
377-
EXPECT_EQ(CGRectMake(76, 8, 9, 20), [rectValues[4] CGRectValue]);
373+
EXPECT_EQ(CGRectMake(47, 8, 13, 19), [rectValues[0] CGRectValue]);
374+
EXPECT_EQ(CGRectMake(59, 8, 9, 19), [rectValues[1] CGRectValue]);
375+
EXPECT_EQ(CGRectMake(67, 8, 6, 19), [rectValues[2] CGRectValue]);
376+
EXPECT_EQ(CGRectMake(72, 8, 5, 19), [rectValues[3] CGRectValue]);
377+
EXPECT_EQ(CGRectMake(76, 8, 9, 19), [rectValues[4] CGRectValue]);
378378
}
379379
}
380380
[contentView unmarkText];
@@ -393,11 +393,11 @@ - (CGRect)waitForFirstSelectionRectToChange:(CGRect)previousRect
393393
NSArray<NSValue *> *rectValues = context.markedTextRects;
394394
EXPECT_EQ(5U, rectValues.count);
395395
if (rectValues.count >= 5) {
396-
EXPECT_EQ(CGRectMake(8, 8, 12, 20), [rectValues[0] CGRectValue]);
397-
EXPECT_EQ(CGRectMake(19, 8, 8, 20), [rectValues[1] CGRectValue]);
398-
EXPECT_EQ(CGRectMake(26, 8, 6, 20), [rectValues[2] CGRectValue]);
399-
EXPECT_EQ(CGRectMake(31, 8, 5, 20), [rectValues[3] CGRectValue]);
400-
EXPECT_EQ(CGRectMake(35, 8, 9, 20), [rectValues[4] CGRectValue]);
396+
EXPECT_EQ(CGRectMake(8, 8, 12, 19), [rectValues[0] CGRectValue]);
397+
EXPECT_EQ(CGRectMake(19, 8, 8, 19), [rectValues[1] CGRectValue]);
398+
EXPECT_EQ(CGRectMake(26, 8, 6, 19), [rectValues[2] CGRectValue]);
399+
EXPECT_EQ(CGRectMake(31, 8, 5, 19), [rectValues[3] CGRectValue]);
400+
EXPECT_EQ(CGRectMake(35, 8, 9, 19), [rectValues[4] CGRectValue]);
401401
}
402402
}
403403
[contentView unmarkText];
@@ -416,9 +416,9 @@ - (CGRect)waitForFirstSelectionRectToChange:(CGRect)previousRect
416416
NSArray<NSValue *> *rectValues = context.markedTextRects;
417417
EXPECT_EQ(3U, rectValues.count);
418418
if (rectValues.count >= 3) {
419-
EXPECT_EQ(CGRectMake(8, 8, 6, 20), [rectValues[0] CGRectValue]);
420-
EXPECT_EQ(CGRectMake(13, 8, 9, 20), [rectValues[1] CGRectValue]);
421-
EXPECT_EQ(CGRectMake(21, 8, 9, 20), [rectValues[2] CGRectValue]);
419+
EXPECT_EQ(CGRectMake(8, 8, 6, 19), [rectValues[0] CGRectValue]);
420+
EXPECT_EQ(CGRectMake(13, 8, 9, 19), [rectValues[1] CGRectValue]);
421+
EXPECT_EQ(CGRectMake(21, 8, 9, 19), [rectValues[2] CGRectValue]);
422422
}
423423
}
424424
[contentView unmarkText];
@@ -437,9 +437,9 @@ - (CGRect)waitForFirstSelectionRectToChange:(CGRect)previousRect
437437
NSArray<NSValue *> *rectValues = context.markedTextRects;
438438
EXPECT_EQ(3U, rectValues.count);
439439
if (rectValues.count >= 3) {
440-
EXPECT_EQ(CGRectMake(29, 8, 9, 20), [rectValues[0] CGRectValue]);
441-
EXPECT_EQ(CGRectMake(37, 8, 8, 20), [rectValues[1] CGRectValue]);
442-
EXPECT_EQ(CGRectMake(44, 8, 6, 20), [rectValues[2] CGRectValue]);
440+
EXPECT_EQ(CGRectMake(29, 8, 9, 19), [rectValues[0] CGRectValue]);
441+
EXPECT_EQ(CGRectMake(37, 8, 8, 19), [rectValues[1] CGRectValue]);
442+
EXPECT_EQ(CGRectMake(44, 8, 6, 19), [rectValues[2] CGRectValue]);
443443
}
444444
}
445445
}

Tools/TestWebKitAPI/Tests/WebKitCocoa/FindInPage.mm

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -560,14 +560,14 @@ static size_t overlayCount(WKWebView *webView)
560560

561561
__block bool retrievedRect = false;
562562
[webViewForHighlight _requestRectForFoundTextRange:[ranges objectAtIndex:0] completionHandler:^(CGRect rect) {
563-
EXPECT_TRUE(CGRectEqualToRect(rect, CGRectMake(8, 8, 27, 20)));
563+
EXPECT_TRUE(CGRectEqualToRect(rect, CGRectMake(8, 8, 27, 19)));
564564
retrievedRect = true;
565565
}];
566566
TestWebKitAPI::Util::run(&retrievedRect);
567567

568568
retrievedRect = false;
569569
[webViewForHighlight _requestRectForFoundTextRange:[ranges objectAtIndex:1] completionHandler:^(CGRect rect) {
570-
EXPECT_TRUE(CGRectEqualToRect(rect, CGRectMake(18, 54, 27, 20)));
570+
EXPECT_TRUE(CGRectEqualToRect(rect, CGRectMake(18, 54, 27, 19)));
571571
retrievedRect = true;
572572
}];
573573
TestWebKitAPI::Util::run(&retrievedRect);
@@ -582,7 +582,7 @@ static size_t overlayCount(WKWebView *webView)
582582

583583
__block bool done = false;
584584
[webView _requestRectForFoundTextRange:[ranges firstObject] completionHandler:^(CGRect rect) {
585-
EXPECT_TRUE(CGRectEqualToRect(rect, CGRectMake(252, 146, 44, 20)));
585+
EXPECT_TRUE(CGRectEqualToRect(rect, CGRectMake(252, 146, 44, 19)));
586586
done = true;
587587
}];
588588
TestWebKitAPI::Util::run(&done);
@@ -591,15 +591,15 @@ static size_t overlayCount(WKWebView *webView)
591591

592592
done = false;
593593
[webView _requestRectForFoundTextRange:[ranges firstObject] completionHandler:^(CGRect rect) {
594-
EXPECT_TRUE(CGRectEqualToRect(rect, CGRectMake(229, 646, 72, 20)));
594+
EXPECT_TRUE(CGRectEqualToRect(rect, CGRectMake(229, 646, 72, 19)));
595595
done = true;
596596
}];
597597
TestWebKitAPI::Util::run(&done);
598598

599599
[webView scrollRangeToVisible:[ranges firstObject] inDocument:nil];
600600
done = false;
601601
[webView _requestRectForFoundTextRange:[ranges firstObject] completionHandler:^(CGRect rect) {
602-
EXPECT_TRUE(CGRectEqualToRect(rect, CGRectMake(229, 104, 72, 20)));
602+
EXPECT_TRUE(CGRectEqualToRect(rect, CGRectMake(229, 104, 72, 19)));
603603
done = true;
604604
}];
605605
TestWebKitAPI::Util::run(&done);

Tools/TestWebKitAPI/Tests/WebKitCocoa/RequestTextInputContext.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ static CGRect squareCenteredAtPoint(float x, float y, float length)
349349

350350
NSArray<_WKTextInputContext *> *contexts = [webView synchronouslyRequestTextInputContextsInRect:[webView bounds]];
351351
EXPECT_EQ(1UL, contexts.count);
352-
EXPECT_EQ(CGRectMake(0, 0, 0, 20), contexts[0].boundingRect);
352+
EXPECT_EQ(CGRectMake(0, 0, 0, 19), contexts[0].boundingRect);
353353
}
354354

355355
TEST(RequestTextInputContext, FocusAfterNavigation)

Tools/TestWebKitAPI/Tests/WebKitCocoa/WritingTools.mm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2369,8 +2369,8 @@ - (void)textSystemWillBeginEditingDuringSessionWithUUID:(NSUUID *)sessionUUID
23692369
};
23702370
#else
23712371
const Vector<WebCore::IntRect> expectedRects {
2372-
{ { 8, 9 }, { 40, 20 } },
2373-
{ { 97, 9 }, { 47, 20 } },
2372+
{ { 8, 9 }, { 40, 19 } },
2373+
{ { 97, 9 }, { 47, 19 } },
23742374
};
23752375
#endif
23762376

@@ -4110,8 +4110,8 @@ InstanceMethodSwizzler swizzler(PAL::getWTWritingToolsClassSingleton(), @selecto
41104110
};
41114111
#else
41124112
const Vector<WebCore::IntRect> expectedRects {
4113-
{ { 196, 8 }, { 29, 20 } },
4114-
{ { 84, 44 }, { 40, 20 } },
4113+
{ { 196, 8 }, { 29, 19 } },
4114+
{ { 84, 44 }, { 40, 19 } },
41154115
};
41164116
#endif
41174117

Tools/TestWebKitAPI/Tests/ios/AccessibilityTestsIOS.mm

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ static void checkCGRectValueAtIndex(NSArray<NSValue *> *rectValues, CGRect expec
7979
checkCGRectValueAtIndex([webView rectsAtSelectionOffset:6 withText:@"second"], CGRectMake(36, 8, 46, 19), 0);
8080
checkCGRectValueAtIndex([webView rectsAtSelectionOffset:13 withText:@"third"], CGRectMake(8, 27, 31, 20), 0);
8181
#else
82-
checkCGRectValueAtIndex([webView rectsAtSelectionOffset:0 withText:@"first"], CGRectMake(8, 8, 26, 20), 0);
83-
checkCGRectValueAtIndex([webView rectsAtSelectionOffset:6 withText:@"second"], CGRectMake(37, 8, 46, 20), 0);
84-
checkCGRectValueAtIndex([webView rectsAtSelectionOffset:13 withText:@"third"], CGRectMake(8, 27, 31, 21), 0);
82+
checkCGRectValueAtIndex([webView rectsAtSelectionOffset:0 withText:@"first"], CGRectMake(8, 8, 26, 19), 0);
83+
checkCGRectValueAtIndex([webView rectsAtSelectionOffset:6 withText:@"second"], CGRectMake(37, 8, 46, 19), 0);
84+
checkCGRectValueAtIndex([webView rectsAtSelectionOffset:13 withText:@"third"], CGRectMake(8, 27, 31, 19), 0);
8585
#endif
8686
}
8787

@@ -99,11 +99,11 @@ static void checkCGRectValueAtIndex(NSArray<NSValue *> *rectValues, CGRect expec
9999
checkCGRectValueAtIndex(rects, CGRectMake(8, 356, 304, 116), 3);
100100
checkCGRectValueAtIndex(rects, CGRectMake(8, 472, 145, 116), 4);
101101
#else
102-
checkCGRectValueAtIndex(rects, CGRectMake(8, 10, 304, 113), 0);
103-
checkCGRectValueAtIndex(rects, CGRectMake(8, 123, 304, 117), 1);
104-
checkCGRectValueAtIndex(rects, CGRectMake(8, 240, 304, 117), 2);
105-
checkCGRectValueAtIndex(rects, CGRectMake(8, 357, 304, 117), 3);
106-
checkCGRectValueAtIndex(rects, CGRectMake(8, 474, 145, 117), 4);
102+
checkCGRectValueAtIndex(rects, CGRectMake(8, 10, 304, 112), 0);
103+
checkCGRectValueAtIndex(rects, CGRectMake(8, 122, 304, 117), 1);
104+
checkCGRectValueAtIndex(rects, CGRectMake(8, 239, 304, 117), 2);
105+
checkCGRectValueAtIndex(rects, CGRectMake(8, 356, 304, 117), 3);
106+
checkCGRectValueAtIndex(rects, CGRectMake(8, 473, 145, 117), 4);
107107
#endif
108108
}
109109

@@ -132,23 +132,23 @@ static void checkCGRectValueAtIndex(NSArray<NSValue *> *rectValues, CGRect expec
132132
#if PLATFORM(MACCATALYST)
133133
checkCGRectValueAtIndex([webView rectsAtSelectionOffset:0 withText:@"first"], CGRectMake(8, 8, 25, 19), 0);
134134
#else
135-
checkCGRectValueAtIndex([webView rectsAtSelectionOffset:0 withText:@"first"], CGRectMake(8, 8, 26, 20), 0);
135+
checkCGRectValueAtIndex([webView rectsAtSelectionOffset:0 withText:@"first"], CGRectMake(8, 8, 26, 19), 0);
136136
#endif
137137

138138
// Now select the second node, we should use the stored selection to retrieve rects
139139
[webView stringByEvaluatingJavaScript:@"getSelection().setBaseAndExtent(second, 0, second, 1)"];
140140
#if PLATFORM(MACCATALYST)
141141
checkCGRectValueAtIndex([webView rectsAtSelectionOffset:0 withText:@"first"], CGRectMake(8, 8, 25, 19), 0);
142142
#else
143-
checkCGRectValueAtIndex([webView rectsAtSelectionOffset:0 withText:@"first"], CGRectMake(8, 8, 26, 20), 0);
143+
checkCGRectValueAtIndex([webView rectsAtSelectionOffset:0 withText:@"first"], CGRectMake(8, 8, 26, 19), 0);
144144
#endif
145145

146146
// Clear the stored selection, we should use the current selection to retrieve rects
147147
[webView _accessibilityClearSelection];
148148
#if PLATFORM(MACCATALYST)
149149
checkCGRectValueAtIndex([webView rectsAtSelectionOffset:0 withText:@"first"], CGRectMake(8, 27, 25, 20), 0);
150150
#else
151-
checkCGRectValueAtIndex([webView rectsAtSelectionOffset:0 withText:@"first"], CGRectMake(8, 27, 26, 21), 0);
151+
checkCGRectValueAtIndex([webView rectsAtSelectionOffset:0 withText:@"first"], CGRectMake(8, 27, 26, 20), 0);
152152
#endif
153153
}
154154

0 commit comments

Comments
 (0)