⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 293742 in webkit


Ignore:
Timestamp:
May 3, 2022, 3:10:46 PM (4 years ago)
Author:
commit-queue@webkit.org
Message:

[macOS] Make a couple of grammar checking tests more robust to system spell checker changes
​https://bugs.webkit.org/show_bug.cgi?id=240034
rdar://92689657

Reviewed by Aditya Keerthi.

In some versions of macOS, feeding the following sentence to NSSpellChecker:

"the the adlj adaasj sdklj. there there"

...no longer yields grammar errors at "the the" and "there there", due to presence of duplicated "the" and
"there", which causes a couple of layout tests to time out.

This patch works around the system changes by swizzling out spell checking results, such that we don't need to
rely on the default NSSpellChecker always tagging "the the" and "there there" as grammar errors.

  • editing/spelling/inline-spelling-markers-hidpi.html:
  • editing/spelling/inline-spelling-markers.html:

Canonical link: ​https://commits.webkit.org/250230@main

Location:
trunk/LayoutTests
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r293741 r293742  
     12022-05-03  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        [macOS] Make a couple of grammar checking tests more robust to system spell checker changes
     4        https://bugs.webkit.org/show_bug.cgi?id=240034
     5        rdar://92689657
     6
     7        Reviewed by Aditya Keerthi.
     8
     9        In some versions of macOS, feeding the following sentence to NSSpellChecker:
     10
     11        > "the the adlj adaasj sdklj. there there"
     12
     13        ...no longer yields grammar errors at "the the" and "there there", due to presence of duplicated "the" and
     14        "there", which causes a couple of layout tests to time out.
     15
     16        This patch works around the system changes by swizzling out spell checking results, such that we don't need to
     17        rely on the default NSSpellChecker always tagging "the the" and "there there" as grammar errors.
     18
     19        * editing/spelling/inline-spelling-markers-hidpi.html:
     20        * editing/spelling/inline-spelling-markers.html:
     21
    1222022-05-03  Truitt Savell  <tsavell@apple.com>
    223
  • trunk/LayoutTests/editing/spelling/inline-spelling-markers-hidpi.html

    r164643 r293742  
    2222
    2323<body>
    24 <script src="../../resources/js-test-pre.js"></script>
     24<script src="../../resources/ui-helper.js"></script>
     25<script src="../../resources/js-test.js"></script>
    2526LTR
    2627<div id="testLTR" class="testDiv" contenteditable="true"></div>
    … …  
    102103if (window.testRunner) {
    103104    testRunner.dumpAsText(true);
    104     testRunner.setBackingScaleFactor(2, function () {
    105         done();
    106     });
     105    UIHelper.setSpellCheckerResults({
     106        "the the adlj adaasj sdklj. there there\u00A0" : [
     107            { type : "spelling", from : 8, to : 12 },
     108            { type : "spelling", from : 13, to : 19 },
     109            { type : "spelling", from : 20, to : 25 },
     110            {
     111                type : "grammar",
     112                from : 4,
     113                to : 7,
     114                details : [{ from : 0, to : 3 }]
     115            },
     116            {
     117                type : "grammar",
     118                from : 33,
     119                to : 38,
     120                details : [{ from : 0, to : 5 }]
     121            }
     122        ]
     123    }).then(() => testRunner.setBackingScaleFactor(2, done));
    107124}
    108125
    109126</script>
    110 <script src="../../resources/js-test-post.js"></script>
    111127</body>
    112128</html>
  • trunk/LayoutTests/editing/spelling/inline-spelling-markers.html

    r164643 r293742  
    2222
    2323<body>
    24 <script src="../../resources/js-test-pre.js"></script>
     24<script src="../../resources/ui-helper.js"></script>
     25<script src="../../resources/js-test.js"></script>
    2526LTR
    2627<div id="testLTR" class="testDiv" contenteditable="true"></div>
    … …  
    107108    finishJSTest();
    108109}
    109 done();
     110
     111UIHelper.setSpellCheckerResults({
     112    "the the adlj adaasj sdklj. there there\u00A0" : [
     113        { type : "spelling", from : 8, to : 12 },
     114        { type : "spelling", from : 13, to : 19 },
     115        { type : "spelling", from : 20, to : 25 },
     116        {
     117            type : "grammar",
     118            from : 4,
     119            to : 7,
     120            details : [{ from : 0, to : 3 }]
     121        },
     122        {
     123            type : "grammar",
     124            from : 33,
     125            to : 38,
     126            details : [{ from : 0, to : 5 }]
     127        }
     128    ]
     129}).then(done);
    110130</script>
    111 <script src="../../resources/js-test-post.js"></script>
    112131</body>
    113132</html>
Note: See TracChangeset for help on using the changeset viewer.