Changeset 217292 in webkit


Ignore:
Timestamp:
May 23, 2017 1:23:23 PM (7 years ago)
Author:
ap@apple.com
Message:

Many editing js-tests use waitUntilDone
https://bugs.webkit.org/show_bug.cgi?id=172401

Reviewed by Ryosuke Niwa.

Corrected the use of js-test harness, updated the tests to use js-test.js instead
of js-test-pre.js where possible.

  • editing/caret/ios/absolute-caret-position-after-scroll.html:
  • editing/caret/ios/fixed-caret-position-after-scroll.html:
  • editing/input/style-change-during-input.html:
  • editing/inserting/insert-html-crash.html:
  • editing/mac/input/undo-grouping-on-text-insertion.html:
  • editing/mac/selection/context-menu-select-editability-expected.txt:
  • editing/mac/selection/context-menu-select-editability.html:
  • editing/mac/spelling/accept-candidate-undo-does-not-select.html:
  • editing/mac/spelling/autocorrection-respets-undo-expected.txt:
  • editing/mac/spelling/autocorrection-respets-undo.html:
  • editing/pasteboard/drag-and-drop-attachment-contenteditable.html:
  • editing/pasteboard/drag-and-drop-image-contenteditable.html:
  • editing/pasteboard/drag-and-drop-inputimage-contenteditable.html:
  • editing/pasteboard/drag-and-drop-objectimage-contenteditable.html:
  • editing/pasteboard/drag-link-with-data-transfer-adds-trusted-link-to-pasteboard-expected.txt:
  • editing/pasteboard/drag-link-with-data-transfer-adds-trusted-link-to-pasteboard.html:
  • editing/selection/ios/absolute-selection-after-scroll.html:
  • editing/selection/ios/fixed-selection-after-scroll.html:
  • editing/spelling/copy-paste-crash-expected.txt:
  • editing/spelling/copy-paste-crash.html:
  • editing/style/apply-style-join-child-text-nodes-crash.html:
Location:
trunk/LayoutTests
Files:
22 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r217290 r217292  
     12017-05-23  Alexey Proskuryakov  <ap@apple.com>
     2
     3        Many editing js-tests use waitUntilDone
     4        https://bugs.webkit.org/show_bug.cgi?id=172401
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Corrected the use of js-test harness, updated the tests to use js-test.js instead
     9        of js-test-pre.js where possible.
     10
     11        * editing/caret/ios/absolute-caret-position-after-scroll.html:
     12        * editing/caret/ios/fixed-caret-position-after-scroll.html:
     13        * editing/input/style-change-during-input.html:
     14        * editing/inserting/insert-html-crash.html:
     15        * editing/mac/input/undo-grouping-on-text-insertion.html:
     16        * editing/mac/selection/context-menu-select-editability-expected.txt:
     17        * editing/mac/selection/context-menu-select-editability.html:
     18        * editing/mac/spelling/accept-candidate-undo-does-not-select.html:
     19        * editing/mac/spelling/autocorrection-respets-undo-expected.txt:
     20        * editing/mac/spelling/autocorrection-respets-undo.html:
     21        * editing/pasteboard/drag-and-drop-attachment-contenteditable.html:
     22        * editing/pasteboard/drag-and-drop-image-contenteditable.html:
     23        * editing/pasteboard/drag-and-drop-inputimage-contenteditable.html:
     24        * editing/pasteboard/drag-and-drop-objectimage-contenteditable.html:
     25        * editing/pasteboard/drag-link-with-data-transfer-adds-trusted-link-to-pasteboard-expected.txt:
     26        * editing/pasteboard/drag-link-with-data-transfer-adds-trusted-link-to-pasteboard.html:
     27        * editing/selection/ios/absolute-selection-after-scroll.html:
     28        * editing/selection/ios/fixed-selection-after-scroll.html:
     29        * editing/spelling/copy-paste-crash-expected.txt:
     30        * editing/spelling/copy-paste-crash.html:
     31        * editing/style/apply-style-join-child-text-nodes-crash.html:
     32
    1332017-05-23  Jiewen Tan  <jiewen_tan@apple.com>
    234
  • trunk/LayoutTests/editing/caret/ios/absolute-caret-position-after-scroll.html

    r209967 r217292  
    33<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    44<head>
    5     <script src="../../../resources/js-test-pre.js"></script>
     5    <script src="../../../resources/js-test.js"></script>
    66    <style>
    77        body {
     
    2323    </style>
    2424    <script>
    25     if (window.testRunner) {
    26         testRunner.dumpAsText();
    27         testRunner.waitUntilDone();
    28     }
     25    jsTestIsAsync = true;
    2926
    3027    function tapInInputScript(tapX, tapY)
     
    7673                shouldBe("finalCaretRect.width", "initialCaretRect.width");
    7774                shouldBe("finalCaretRect.height", "initialCaretRect.height");
    78                 testRunner.notifyDone();
     75                finishJSTest();
    7976            });
    8077        });
     
    8481<body onload=run()>
    8582    <input></input>
    86     <script src="../../../resources/js-test-post.js"></script>
    8783</body>
    8884
  • trunk/LayoutTests/editing/caret/ios/fixed-caret-position-after-scroll.html

    r209967 r217292  
    33<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    44<head>
    5     <script src="../../../resources/js-test-pre.js"></script>
     5    <script src="../../../resources/js-test.js"></script>
    66    <style>
    77        body {
     
    2323    </style>
    2424    <script>
    25     if (window.testRunner) {
    26         testRunner.dumpAsText();
    27         testRunner.waitUntilDone();
    28     }
     25    jsTestIsAsync = true;
    2926
    3027    function getInputViewBoundsAfterTappingInInputScript(tapX, tapY)
     
    7168                    window.finalCaretRect = finalCaretRect = JSON.parse(finalCaretRect);
    7269                    shouldBe("finalCaretRect.top - initialCaretRect.top", "500");
    73                     testRunner.notifyDone();
     70                    finishJSTest();
    7471                });
    7572            });
     
    8077<body onload=run()>
    8178    <input id="input"></input>
    82     <script src="../../../resources/js-test-post.js"></script>
    8379</body>
    8480
  • trunk/LayoutTests/editing/input/style-change-during-input.html

    r155276 r217292  
    11<html>
    22<head>
    3 <script src="../../resources/js-test-pre.js"></script>
     3<script src="../../resources/js-test.js"></script>
    44<style>
    55body[style] { }
     
    1313document.getElementById("target").addEventListener("textInput", function (evt) { evt.target.style.width = 100; });
    1414if (window.testRunner) {
    15     testRunner.dumpAsText();
    16     testRunner.waitUntilDone();
    1715    window.target = document.getElementById("target");
    1816    window.setTimeout(function() {
     
    3028window.jsTestIsAsync = true;
    3129</script>
    32 <script src="../../resources/js-test-post.js"></script>
    3330</body>
    3431</html>
  • trunk/LayoutTests/editing/inserting/insert-html-crash.html

    r155276 r217292  
    11<!DOCTYPE html>
    22<html>
    3 <script src="../../resources/js-test-pre.js"></script>
     3<script src="../../resources/js-test.js"></script>
    44<script>
    55window.jsTestIsAsync = true;
    6 
    7 if (window.testRunner)
    8     testRunner.waitUntilDone();
    96
    107document.addEventListener("DOMCharacterDataModified", function() {
     
    1916document.execCommand("InsertHTML", false, 4);
    2017</script>
    21 <script src="../../resources/js-test-post.js"></script>
    2218</html>
  • trunk/LayoutTests/editing/mac/input/undo-grouping-on-text-insertion.html

    r187932 r217292  
    11<html>
    22<head>
    3 <script src="../../../resources/js-test-pre.js"></script>
     3<script src="../../../resources/js-test.js"></script>
    44<style>
    55body { margin: 0; padding: 0 }
     
    1313
    1414    description("When inserting text with the undo insertion attribute, each blob of inserted text should create an undo group so that, sending an undo command will undo just that last text insertion.");
    15     var jsTestIsAsync = true;
    16     window.jsTestIsAsync = true;
    17     testRunner.waitUntilDone();
     15    jsTestIsAsync = true;
    1816
    1917    var undoCount = 0;
     
    3230        document.execCommand("Undo");
    3331        undoCount++;
    34         if (undoCount == 4) {
    35             testRunner.notifyDone();
     32        if (undoCount == 4)
    3633            finishJSTest();
    37         } else {
     34        else
    3835            setTimeout("undoNow()", 1);
    39         }
    4036    }
    4137
  • trunk/LayoutTests/editing/mac/selection/context-menu-select-editability-expected.txt

    r187932 r217292  
    44The crowd says: New York, New York    is a helluva town!
    55
    6 
    7 
    8 PASS successfullyParsed is true
    9 
    10 TEST COMPLETE
    116
    127
  • trunk/LayoutTests/editing/mac/selection/context-menu-select-editability.html

    r187932 r217292  
    22<html>
    33<head>
    4 <script src="../../../resources/js-test-pre.js"></script>
     4<script src="../../../resources/js-test.js"></script>
    55</head>
    66<body onload="onLoad()">
     
    1414</div>
    1515<div id="console">
    16 </body>
    1716<script>
    1817
     
    4039function onLoad()
    4140{
    42     if (window.testRunner) {
    43         window.jsTestIsAsync = true;
    44         testRunner.waitUntilDone();
    45     }
     41    jsTestIsAsync = true;
    4642
    4743    setTimeout(performTest, 500); // Wait for page to display
    4844}
    4945</script>
    50 <script src="../../../resources/js-test-post.js"></script>
    5146</body>
    5247</html>
  • trunk/LayoutTests/editing/mac/spelling/accept-candidate-undo-does-not-select.html

    r205870 r217292  
    22<head>
    33<script src=../../editing.js></script>
    4 <script src="../../../resources/js-test-pre.js"></script>
     4<script src="../../../resources/js-test.js"></script>
    55<script>
    66
    77function editingTest() {
    8     if (window.testRunner) {
    9         testRunner.waitUntilDone();
    10         testRunner.dumpAsText(true);
    11     }
     8    jsTestIsAsync = true;
    129
    1310    edit = document.getElementById('edit');
     
    3431        typeCharacterCommand('.');
    3532
    36         testRunner.notifyDone();
     33        finishJSTest();
    3734    }, 100);
    3835}
     
    4845runEditingTest();
    4946</script>
    50 <script src="../../../resources/js-test-post.js"></script>
    5147</body>
    5248</html>
  • trunk/LayoutTests/editing/mac/spelling/autocorrection-respets-undo-expected.txt

    r187932 r217292  
    1 PASS editor.innerText is 'wellcome '
    21Test that undoing autocorrection from "wellcome" to "welcome" and typing a space doesn't re-autocorrect "wellcome".
    32To manually test, type "testt " and observe that it's auto-corrected to "test ". Then undo the auto-correction and type a space again. You should see "testt ".
    43
    54wellcome 
     5PASS editor.innerText is 'wellcome '
     6PASS successfullyParsed is true
     7
     8TEST COMPLETE
     9
  • trunk/LayoutTests/editing/mac/spelling/autocorrection-respets-undo.html

    r187932 r217292  
    55To manually test, type "testt " and observe that it's auto-corrected to "test ". Then undo the auto-correction and type a space again. You should see "testt ".</p>
    66<div id="editor" contenteditable></div>
    7 <script src="../../../resources/js-test-pre.js"></script>
     7<div id="console"></div>
     8<script src="../../../resources/js-test.js"></script>
    89<script>
    910
    1011if (window.testRunner) {
    11     testRunner.dumpAsText();
    12     testRunner.waitUntilDone();
     12    jsTestIsAsync = true;
    1313
    1414    var editor = document.getElementById('editor');
     
    2222        document.execCommand('insertText', false, ' ');
    2323        shouldBe("editor.innerText", "'wellcome\xa0'");
    24         if (window.testRunner)
    25             testRunner.notifyDone();
     24        finishJSTest();
    2625    }, 100); // The delay is needed to separate the autocorrection from typing "wellcome" in NSUndoManager.
    2726}
    28 
    2927</script>
    3028</body>
  • trunk/LayoutTests/editing/pasteboard/drag-and-drop-attachment-contenteditable.html

    r198088 r217292  
    66        window.internals.settings.setAttachmentElementEnabled(true)
    77</script>
    8 <script src="../../resources/js-test-pre.js"></script>
     8<script src="../../resources/js-test.js"></script>
    99<style>
    1010#target {
     
    4444    if (!window.testRunner)
    4545        return;
    46    
    47     testRunner.waitUntilDone();
    4846
    4947    e = document.getElementById("attachment");
     
    6260}
    6361</script>
    64 <script src="../../resources/js-test-post.js"></script>
    6562</body>
    6663</html>
  • trunk/LayoutTests/editing/pasteboard/drag-and-drop-image-contenteditable.html

    r155276 r217292  
    22<html>
    33<head>
    4 <script src="../../resources/js-test-pre.js"></script>
     4<script src="../../resources/js-test.js"></script>
    55<style>
    66#target {
     
    3838        return;
    3939
    40     testRunner.waitUntilDone();
    41 
    4240    e = document.getElementById("source");
    4341    x = e.offsetLeft + e.offsetWidth / 2;
     
    5553}
    5654</script>
    57 <script src="../../resources/js-test-post.js"></script>
    5855</body>
    5956</html>
  • trunk/LayoutTests/editing/pasteboard/drag-and-drop-inputimage-contenteditable.html

    r155276 r217292  
    22<html>
    33<head>
    4 <script src="../../resources/js-test-pre.js"></script>
     4<script src="../../resources/js-test.js"></script>
    55<style>
    66#target {
     
    3939        return;
    4040
    41     testRunner.waitUntilDone();
    42 
    4341    e = document.getElementById("source");
    4442    x = e.offsetLeft + e.offsetWidth / 2;
     
    5654}
    5755</script>
    58 <script src="../../resources/js-test-post.js"></script>
    5956</body>
    6057</html>
  • trunk/LayoutTests/editing/pasteboard/drag-and-drop-objectimage-contenteditable.html

    r155276 r217292  
    22<html>
    33<head>
    4 <script src="../../resources/js-test-pre.js"></script>
     4<script src="../../resources/js-test.js"></script>
    55<style>
    66#target {
     
    3939        return;
    4040
    41     testRunner.waitUntilDone();
    42 
    4341    e = document.getElementById("source");
    4442    x = e.offsetLeft + e.offsetWidth / 2;
     
    5654}
    5755</script>
    58 <script src="../../resources/js-test-post.js"></script>
    5956</body>
    6057</html>
  • trunk/LayoutTests/editing/pasteboard/drag-link-with-data-transfer-adds-trusted-link-to-pasteboard-expected.txt

    r208576 r217292  
    1 PASS 'javascript:alert('Set by data transfer');' was set in the data transfer for firstAnchorSource and not overwritten.
    2 PASS 'http://webkit.org/setByDataTransfer' was set in the data transfer for secondAnchorSource and not overwritten.
    3 PASS 'javascript:alert('Set by data transfer');' was set in the data transfer for firstSvgSource and not overwritten.
    4 PASS 'http://webkit.org/setByDataTransfer' was set in the data transfer for secondSvgSource and not overwritten.
    51
    62This only has an ondragenter handler and is here to make sure dragging over it doesn't change the pasteboard.
     
    128https://webkit.org
    139
     10PASS 'javascript:alert('Set by data transfer');' was set in the data transfer for firstAnchorSource and not overwritten.
     11PASS 'http://webkit.org/setByDataTransfer' was set in the data transfer for secondAnchorSource and not overwritten.
     12PASS 'javascript:alert('Set by data transfer');' was set in the data transfer for firstSvgSource and not overwritten.
     13PASS 'http://webkit.org/setByDataTransfer' was set in the data transfer for secondSvgSource and not overwritten.
     14PASS successfullyParsed is true
    1415
     16TEST COMPLETE
     17
  • trunk/LayoutTests/editing/pasteboard/drag-link-with-data-transfer-adds-trusted-link-to-pasteboard.html

    r216466 r217292  
    22<html>
    33<head>
    4     <script src="../../resources/js-test-pre.js"></script>
     4    <script src="../../resources/js-test.js"></script>
    55</head>
    66<body>
     
    5858
    5959-->
     60<div id="console"></div>
    6061<script>
    6162    var TEXT_TO_SET_IN_DATA_TRANSFER = "javascript:alert('Set by data transfer');";
     
    119120
    120121    if (window.testRunner && eventSender) {
    121         testRunner.dumpAsText();
    122         testRunner.waitUntilDone();
     122        jsTestIsAsync = true;
    123123
    124124        dragAndDropElement("firstAnchorSource");
     
    138138        });
    139139
    140         testRunner.notifyDone();
     140        finishJSTest();
    141141    }
    142142</script>
  • trunk/LayoutTests/editing/selection/ios/absolute-selection-after-scroll.html

    r209967 r217292  
    33<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    44<head>
    5     <script src="../../../resources/js-test-pre.js"></script>
     5    <script src="../../../resources/js-test.js"></script>
    66    <style>
    77        body {
     
    2424    </style>
    2525    <script>
    26     if (window.testRunner) {
    27         testRunner.dumpAsText();
    28         testRunner.waitUntilDone();
    29     }
     26    jsTestIsAsync = true;
    3027
    3128    function toString(rect)
     
    8279                shouldBe("finalSelectionRects[0].width", "initialSelectionRects[0].width");
    8380                shouldBe("finalSelectionRects[0].height", "initialSelectionRects[0].height");
    84                 testRunner.notifyDone();
     81                finishJSTest();
    8582            });
    8683        });
     
    9188    <div id="fixed">WebKit</div>
    9289    <div id="content"></div>
    93     <script src="../../../resources/js-test-post.js"></script>
    9490</body>
    9591</html>
  • trunk/LayoutTests/editing/selection/ios/fixed-selection-after-scroll.html

    r209967 r217292  
    33<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    44<head>
    5     <script src="../../../resources/js-test-pre.js"></script>
     5    <script src="../../../resources/js-test.js"></script>
    66    <style>
    77        body {
     
    2424    </style>
    2525    <script>
    26     if (window.testRunner) {
    27         testRunner.dumpAsText();
    28         testRunner.waitUntilDone();
    29     }
     26    jsTestIsAsync = true;
    3027
    3128    function toString(rect)
     
    8178                shouldBe("finalSelectionRects.length", "1");
    8279                shouldBe("finalSelectionRects[0].top - initialSelectionRects[0].top", "1000");
    83                 testRunner.notifyDone();
     80                finishJSTest();
    8481            });
    8582        });
     
    9087    <div id="fixed">WebKit</div>
    9188    <div id="content"></div>
    92     <script src="../../../resources/js-test-post.js"></script>
    9389</body>
    9490</html>
  • trunk/LayoutTests/editing/spelling/copy-paste-crash-expected.txt

    r203249 r217292  
    11Spell check does not crash after Ctrl-X/Ctrl-V/type text in ASAN. To test manually, type 'A', Ctrl-A, Ctrl-X, Ctrl-V, and start typing again. The test succeeds when there's no crash in the last step.
    2 
    3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
    4 
    5 
     2Spell wellcome. Is it broken?A simple test for a spell check.AA
    63PASS internals.markerCountForNode(destination.childNodes[0], "spelling") became different from 0
    74PASS Did not crash
    8 Spell wellcome. Is it broken?A simple test for a spell check.AA
     5PASS successfullyParsed is true
    96
     7TEST COMPLETE
     8
  • trunk/LayoutTests/editing/spelling/copy-paste-crash.html

    r203249 r217292  
    22<html>
    33<head>
    4 <script src="../../resources/js-test-pre.js"></script>
     4<script src="../../resources/js-test.js"></script>
    55<script src="resources/util.js"></script>
    66</head>
    77<body>
     8<div>Spell check does not crash after Ctrl-X/Ctrl-V/type text in ASAN. To test manually, type 'A', Ctrl-A, Ctrl-X, Ctrl-V, and start typing again. The test succeeds when there's no crash in the last step.</div>
    89<div id="container">
    910  <div id="destination" contentEditable>
     
    1112  </div>
    1213</div>
     14<div id="console"></div>
    1315<script>
    14 if (window.testRunner)
    15     testRunner.waitUntilDone();
    16 
    17 description("Spell check does not crash after Ctrl-X/Ctrl-V/type text in ASAN. "
    18     + "To test manually, type 'A', Ctrl-A, Ctrl-X, Ctrl-V, and start typing again. "
    19     + "The test succeeds when there's no crash in the last step.");
    20 
    21 initSpellTest("destination", "Spell wellcome. Is it broken?", function(textNode) {
     16onload = initSpellTest("destination", "Spell wellcome. Is it broken?", function(textNode) {
    2217    var behaviors = ["win", "mac"];
    2318    for (var i = 0; i < behaviors.length; i++) {
     
    2924    }
    3025
    31     log("PASS Did not crash");
    32     if (window.testRunner)
    33         testRunner.notifyDone();
     26    testPassed("Did not crash");
     27    finishJSTest();
    3428});
    3529</script>
    36 <div id="console"></div>
    37 <script src="../../resources/js-test-post.js"></script>
    3830</body>
    3931</html>
  • trunk/LayoutTests/editing/style/apply-style-join-child-text-nodes-crash.html

    r155276 r217292  
    22<html>
    33<body>
    4 <script src="../../resources/js-test-pre.js"></script>
     4<script src="../../resources/js-test.js"></script>
    55<script id="script1">
    66document.addEventListener("DOMCharacterDataModified",function(){
     
    1313window.jsTestIsAsync = true;
    1414
    15 if (window.testRunner)
    16     testRunner.waitUntilDone();
    17 
    1815var scriptElement = document.getElementById('script1');
    1916scriptElement.parentNode.appendChild(scriptElement.firstChild);
     
    2320document.execCommand("FontSizeDelta", false, 3);
    2421</script>
    25 <script src="../../resources/js-test-post.js"></script>
    2622</body>
    2723</html>
Note: See TracChangeset for help on using the changeset viewer.