<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[161952] trunk/LayoutTests</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/161952">161952</a></dd>
<dt>Author</dt> <dd>g.czajkowski@samsung.com</dd>
<dt>Date</dt> <dd>2014-01-13 23:48:38 -0800 (Mon, 13 Jan 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Make spelling tests added in <a href="http://trac.webkit.org/projects/webkit/changeset/141354">r141354</a> to be able to run asynchronously
https://bugs.webkit.org/show_bug.cgi?id=126895

Reviewed by Ryosuke Niwa.

As we started running spelling tests asynchronously, invoke 'finishJSTest()'
when all operations are completed, for example, required spelling markers have appeared.
It might happen later then during 'initSpellTest'  testing callback.

Due to the tests perform other checks that do not affect expectation order (selection,
context menu suggestion items), the asynchronous operations were pushed back to the end of
the tests to be sure that those won't break expectation order.

* editing/spelling/context-menu-suggestions-multiword-selection-expected.txt:
* editing/spelling/context-menu-suggestions-multiword-selection.html:
* editing/spelling/context-menu-suggestions-subword-selection-expected.txt:
* editing/spelling/context-menu-suggestions-subword-selection.html:
* editing/spelling/resources/util.js:
* editing/spelling/spelling-changed-text-expected.txt:
* editing/spelling/spelling-changed-text.html:
* editing/spelling/spelling-double-clicked-word-expected.txt:
* editing/spelling/spelling-double-clicked-word.html:
* editing/spelling/spelling-exactly-selected-word-expected.txt:
* editing/spelling/spelling-exactly-selected-word.html:

* editing/spelling/spelling-with-whitespace-selection-expected.txt:
* editing/spelling/spelling-with-whitespace-selection.html:
* editing/spelling/spelling-with-punctuation-selection-expected.txt:
* editing/spelling/spelling-with-punctuation-selection.html:
Additionally fix description format and get rid of context click, needless after <a href="http://trac.webkit.org/projects/webkit/changeset/148282">r148282</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestseditingspellingcontextmenusuggestionsmultiwordselectionexpectedtxt">trunk/LayoutTests/editing/spelling/context-menu-suggestions-multiword-selection-expected.txt</a></li>
<li><a href="#trunkLayoutTestseditingspellingcontextmenusuggestionsmultiwordselectionhtml">trunk/LayoutTests/editing/spelling/context-menu-suggestions-multiword-selection.html</a></li>
<li><a href="#trunkLayoutTestseditingspellingcontextmenusuggestionssubwordselectionexpectedtxt">trunk/LayoutTests/editing/spelling/context-menu-suggestions-subword-selection-expected.txt</a></li>
<li><a href="#trunkLayoutTestseditingspellingcontextmenusuggestionssubwordselectionhtml">trunk/LayoutTests/editing/spelling/context-menu-suggestions-subword-selection.html</a></li>
<li><a href="#trunkLayoutTestseditingspellingresourcesutiljs">trunk/LayoutTests/editing/spelling/resources/util.js</a></li>
<li><a href="#trunkLayoutTestseditingspellingspellingchangedtextexpectedtxt">trunk/LayoutTests/editing/spelling/spelling-changed-text-expected.txt</a></li>
<li><a href="#trunkLayoutTestseditingspellingspellingchangedtexthtml">trunk/LayoutTests/editing/spelling/spelling-changed-text.html</a></li>
<li><a href="#trunkLayoutTestseditingspellingspellingdoubleclickedwordexpectedtxt">trunk/LayoutTests/editing/spelling/spelling-double-clicked-word-expected.txt</a></li>
<li><a href="#trunkLayoutTestseditingspellingspellingdoubleclickedwordhtml">trunk/LayoutTests/editing/spelling/spelling-double-clicked-word.html</a></li>
<li><a href="#trunkLayoutTestseditingspellingspellingexactlyselectedwordexpectedtxt">trunk/LayoutTests/editing/spelling/spelling-exactly-selected-word-expected.txt</a></li>
<li><a href="#trunkLayoutTestseditingspellingspellingexactlyselectedwordhtml">trunk/LayoutTests/editing/spelling/spelling-exactly-selected-word.html</a></li>
<li><a href="#trunkLayoutTestseditingspellingspellingwithpunctuationselectionexpectedtxt">trunk/LayoutTests/editing/spelling/spelling-with-punctuation-selection-expected.txt</a></li>
<li><a href="#trunkLayoutTestseditingspellingspellingwithpunctuationselectionhtml">trunk/LayoutTests/editing/spelling/spelling-with-punctuation-selection.html</a></li>
<li><a href="#trunkLayoutTestseditingspellingspellingwithwhitespaceselectionexpectedtxt">trunk/LayoutTests/editing/spelling/spelling-with-whitespace-selection-expected.txt</a></li>
<li><a href="#trunkLayoutTestseditingspellingspellingwithwhitespaceselectionhtml">trunk/LayoutTests/editing/spelling/spelling-with-whitespace-selection.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (161951 => 161952)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-01-14 07:15:58 UTC (rev 161951)
+++ trunk/LayoutTests/ChangeLog        2014-01-14 07:48:38 UTC (rev 161952)
</span><span class="lines">@@ -1,3 +1,36 @@
</span><ins>+2014-01-13  Grzegorz Czajkowski  &lt;g.czajkowski@samsung.com&gt;
+
+        Make spelling tests added in r141354 to be able to run asynchronously
+        https://bugs.webkit.org/show_bug.cgi?id=126895
+
+        Reviewed by Ryosuke Niwa.
+
+        As we started running spelling tests asynchronously, invoke 'finishJSTest()'
+        when all operations are completed, for example, required spelling markers have appeared.
+        It might happen later then during 'initSpellTest'  testing callback.
+
+        Due to the tests perform other checks that do not affect expectation order (selection,
+        context menu suggestion items), the asynchronous operations were pushed back to the end of
+        the tests to be sure that those won't break expectation order.
+
+        * editing/spelling/context-menu-suggestions-multiword-selection-expected.txt:
+        * editing/spelling/context-menu-suggestions-multiword-selection.html:
+        * editing/spelling/context-menu-suggestions-subword-selection-expected.txt:
+        * editing/spelling/context-menu-suggestions-subword-selection.html:
+        * editing/spelling/resources/util.js:
+        * editing/spelling/spelling-changed-text-expected.txt:
+        * editing/spelling/spelling-changed-text.html:
+        * editing/spelling/spelling-double-clicked-word-expected.txt:
+        * editing/spelling/spelling-double-clicked-word.html:
+        * editing/spelling/spelling-exactly-selected-word-expected.txt:
+        * editing/spelling/spelling-exactly-selected-word.html:
+
+        * editing/spelling/spelling-with-whitespace-selection-expected.txt:
+        * editing/spelling/spelling-with-whitespace-selection.html:
+        * editing/spelling/spelling-with-punctuation-selection-expected.txt:
+        * editing/spelling/spelling-with-punctuation-selection.html:
+        Additionally fix description format and get rid of context click, needless after r148282.
+
</ins><span class="cx"> 2014-01-13  Commit Queue  &lt;commit-queue@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, rolling out r161907.
</span></span></pre></div>
<a id="trunkLayoutTestseditingspellingcontextmenusuggestionsmultiwordselectionexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/editing/spelling/context-menu-suggestions-multiword-selection-expected.txt (161951 => 161952)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/editing/spelling/context-menu-suggestions-multiword-selection-expected.txt        2014-01-14 07:15:58 UTC (rev 161951)
+++ trunk/LayoutTests/editing/spelling/context-menu-suggestions-multiword-selection-expected.txt        2014-01-14 07:48:38 UTC (rev 161952)
</span><span class="lines">@@ -7,9 +7,9 @@
</span><span class="cx"> PASS spellingMarkerRange.toString() is &quot;wellcome&quot;
</span><span class="cx"> PASS window.getSelection().toString() is &quot;&quot;
</span><span class="cx"> PASS window.getSelection().toString() is &quot;wellcome home&quot;
</span><del>-PASS spellingMarkerRange.toString() is &quot;wellcome&quot;
</del><span class="cx"> PASS window.getSelection().toString() is &quot;wellcome home&quot;
</span><span class="cx"> PASS contextMenuItemsWithoutSpellingSuggestions &lt; contextMenuItemsWithSpellingSuggestions is true
</span><ins>+PASS spellingMarkerRange.toString() became &quot;wellcome&quot;
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestseditingspellingcontextmenusuggestionsmultiwordselectionhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/editing/spelling/context-menu-suggestions-multiword-selection.html (161951 => 161952)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/editing/spelling/context-menu-suggestions-multiword-selection.html        2014-01-14 07:15:58 UTC (rev 161951)
+++ trunk/LayoutTests/editing/spelling/context-menu-suggestions-multiword-selection.html        2014-01-14 07:48:38 UTC (rev 161952)
</span><span class="lines">@@ -45,10 +45,10 @@
</span><span class="cx">     // Esc key to hide the context menu.
</span><span class="cx">     eventSender.keyDown(String.fromCharCode(0x001B), null);
</span><span class="cx"> 
</span><del>-    spellingMarkerRange = internals.markerRangeForNode(textNode, &quot;spelling&quot;, 0);
-    shouldBeEqualToString(&quot;spellingMarkerRange.toString()&quot;, &quot;wellcome&quot;);
</del><span class="cx">     shouldBeEqualToString(&quot;window.getSelection().toString()&quot;, &quot;wellcome home&quot;);
</span><span class="cx">     shouldBeTrue(&quot;contextMenuItemsWithoutSpellingSuggestions &lt; contextMenuItemsWithSpellingSuggestions&quot;);
</span><ins>+    spellingMarkerRange = internals.markerRangeForNode(textNode, &quot;spelling&quot;, 0);
+    shouldBecomeEqualToString(&quot;spellingMarkerRange.toString()&quot;, &quot;wellcome&quot;, finishJSTest);
</ins><span class="cx"> });
</span><span class="cx"> 
</span><span class="cx"> &lt;/script&gt;
</span></span></pre></div>
<a id="trunkLayoutTestseditingspellingcontextmenusuggestionssubwordselectionexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/editing/spelling/context-menu-suggestions-subword-selection-expected.txt (161951 => 161952)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/editing/spelling/context-menu-suggestions-subword-selection-expected.txt        2014-01-14 07:15:58 UTC (rev 161951)
+++ trunk/LayoutTests/editing/spelling/context-menu-suggestions-subword-selection-expected.txt        2014-01-14 07:48:38 UTC (rev 161952)
</span><span class="lines">@@ -7,9 +7,9 @@
</span><span class="cx"> PASS spellingMarkerRange.toString() is &quot;wellcome&quot;
</span><span class="cx"> PASS window.getSelection().toString() is &quot;&quot;
</span><span class="cx"> PASS window.getSelection().toString() is &quot;llco&quot;
</span><del>-PASS spellingMarkerRange.toString() is &quot;wellcome&quot;
</del><span class="cx"> PASS window.getSelection().toString() is &quot;llco&quot;
</span><span class="cx"> PASS contextMenuItemsWithoutSpellingSuggestions &lt; contextMenuItemsWithSpellingSuggestions is true
</span><ins>+PASS spellingMarkerRange.toString() became &quot;wellcome&quot;
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestseditingspellingcontextmenusuggestionssubwordselectionhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/editing/spelling/context-menu-suggestions-subword-selection.html (161951 => 161952)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/editing/spelling/context-menu-suggestions-subword-selection.html        2014-01-14 07:15:58 UTC (rev 161951)
+++ trunk/LayoutTests/editing/spelling/context-menu-suggestions-subword-selection.html        2014-01-14 07:48:38 UTC (rev 161952)
</span><span class="lines">@@ -45,10 +45,10 @@
</span><span class="cx">     // Esc key to hide the context menu.
</span><span class="cx">     eventSender.keyDown(String.fromCharCode(0x001B), null);
</span><span class="cx"> 
</span><del>-    spellingMarkerRange = internals.markerRangeForNode(textNode, &quot;spelling&quot;, 0);
-    shouldBeEqualToString(&quot;spellingMarkerRange.toString()&quot;, &quot;wellcome&quot;);
</del><span class="cx">     shouldBeEqualToString(&quot;window.getSelection().toString()&quot;, &quot;llco&quot;);
</span><span class="cx">     shouldBeTrue(&quot;contextMenuItemsWithoutSpellingSuggestions &lt; contextMenuItemsWithSpellingSuggestions&quot;);
</span><ins>+    spellingMarkerRange = internals.markerRangeForNode(textNode, &quot;spelling&quot;, 0);
+    shouldBecomeEqualToString(&quot;spellingMarkerRange.toString()&quot;, &quot;wellcome&quot;, finishJSTest);
</ins><span class="cx"> });
</span><span class="cx"> 
</span><span class="cx"> &lt;/script&gt;
</span></span></pre></div>
<a id="trunkLayoutTestseditingspellingresourcesutiljs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/editing/spelling/resources/util.js (161951 => 161952)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/editing/spelling/resources/util.js        2014-01-14 07:15:58 UTC (rev 161951)
+++ trunk/LayoutTests/editing/spelling/resources/util.js        2014-01-14 07:48:38 UTC (rev 161952)
</span><span class="lines">@@ -24,6 +24,5 @@
</span><span class="cx">     document.execCommand(&quot;InsertText&quot;, false, testText);
</span><span class="cx">     shouldBecomeDifferent('internals.markerCountForNode(destination.childNodes[0], &quot;spelling&quot;)', '0', function() {
</span><span class="cx">         testFunctionCallback(destination.childNodes[0]);
</span><del>-        finishJSTest();
</del><span class="cx">     });
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkLayoutTestseditingspellingspellingchangedtextexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/editing/spelling/spelling-changed-text-expected.txt (161951 => 161952)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/editing/spelling/spelling-changed-text-expected.txt        2014-01-14 07:15:58 UTC (rev 161951)
+++ trunk/LayoutTests/editing/spelling/spelling-changed-text-expected.txt        2014-01-14 07:48:38 UTC (rev 161952)
</span><span class="lines">@@ -5,7 +5,7 @@
</span><span class="cx"> 
</span><span class="cx"> PASS internals.markerCountForNode(destination.childNodes[0], &quot;spelling&quot;) became different from 0
</span><span class="cx"> PASS window.getSelection().toString() is &quot; Is it broken?&quot;
</span><del>-PASS spellingMarkerRange.toString() is &quot;wellcome&quot;
</del><ins>+PASS spellingMarkerRange.toString() became &quot;wellcome&quot;
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestseditingspellingspellingchangedtexthtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/editing/spelling/spelling-changed-text.html (161951 => 161952)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/editing/spelling/spelling-changed-text.html        2014-01-14 07:15:58 UTC (rev 161951)
+++ trunk/LayoutTests/editing/spelling/spelling-changed-text.html        2014-01-14 07:48:38 UTC (rev 161952)
</span><span class="lines">@@ -27,9 +27,10 @@
</span><span class="cx">     eventSender.keyDown(String.fromCharCode(0x007F), null);
</span><span class="cx"> 
</span><span class="cx">     spellingMarkerRange = internals.markerRangeForNode(textNode, &quot;spelling&quot;, 0);
</span><del>-    shouldBeEqualToString(&quot;spellingMarkerRange.toString()&quot;, &quot;wellcome&quot;);
-
-    document.getElementById(&quot;destination&quot;).innerHTML = &quot;&quot;;
</del><ins>+    shouldBecomeEqualToString(&quot;spellingMarkerRange.toString()&quot;, &quot;wellcome&quot;, function() {
+        document.getElementById(&quot;destination&quot;).innerHTML = &quot;&quot;;
+        finishJSTest();
+    });
</ins><span class="cx"> });
</span><span class="cx"> 
</span><span class="cx"> &lt;/script&gt;
</span></span></pre></div>
<a id="trunkLayoutTestseditingspellingspellingdoubleclickedwordexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/editing/spelling/spelling-double-clicked-word-expected.txt (161951 => 161952)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/editing/spelling/spelling-double-clicked-word-expected.txt        2014-01-14 07:15:58 UTC (rev 161951)
+++ trunk/LayoutTests/editing/spelling/spelling-double-clicked-word-expected.txt        2014-01-14 07:48:38 UTC (rev 161952)
</span><span class="lines">@@ -6,11 +6,11 @@
</span><span class="cx"> PASS internals.markerCountForNode(destination.childNodes[0], &quot;spelling&quot;) became different from 0
</span><span class="cx"> PASS spellingMarkerRange.toString() is &quot;wellcome&quot;
</span><span class="cx"> PASS window.getSelection().toString() is &quot;&quot;
</span><del>-PASS spellingMarkerRange.toString() is &quot;wellcome&quot;
</del><span class="cx"> PASS window.getSelection().toString() is &quot;wellcome&quot;
</span><ins>+PASS spellingMarkerRange.toString() became &quot;wellcome&quot;
</ins><span class="cx"> PASS window.getSelection().toString() is &quot;&quot;
</span><del>-PASS spellingMarkerRange.toString() is &quot;wellcome&quot;
</del><span class="cx"> PASS window.getSelection().toString() is &quot;wellcome &quot;
</span><ins>+PASS spellingMarkerRange.toString() became &quot;wellcome&quot;
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestseditingspellingspellingdoubleclickedwordhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/editing/spelling/spelling-double-clicked-word.html (161951 => 161952)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/editing/spelling/spelling-double-clicked-word.html        2014-01-14 07:15:58 UTC (rev 161951)
+++ trunk/LayoutTests/editing/spelling/spelling-double-clicked-word.html        2014-01-14 07:48:38 UTC (rev 161952)
</span><span class="lines">@@ -21,26 +21,20 @@
</span><span class="cx">     shouldBeEqualToString(&quot;window.getSelection().toString()&quot;, &quot;&quot;);
</span><span class="cx"> 
</span><span class="cx">     // Double-click the misspelled word without trailing whitespace.
</span><del>-    internals.settings.setSmartInsertDeleteEnabled(true);
-    internals.settings.setSelectTrailingWhitespaceEnabled(false);
-    var x = destination.offsetParent.offsetLeft + destination.offsetLeft + 40;
-    var y = destination.offsetParent.offsetTop + destination.offsetTop + destination.offsetHeight / 2;
-    eventSender.mouseMoveTo(x, y);
-    eventSender.mouseDown();
-    eventSender.mouseUp();
-    eventSender.mouseDown();
-    eventSender.mouseUp();
</del><ins>+    verifySpellingMarkersAfterDoubleClick(textNode, false, function() {
+        window.getSelection().removeAllRanges();
+        shouldBeEqualToString(&quot;window.getSelection().toString()&quot;, &quot;&quot;);
</ins><span class="cx"> 
</span><del>-    spellingMarkerRange = internals.markerRangeForNode(textNode, &quot;spelling&quot;, 0);
-    shouldBeEqualToString(&quot;spellingMarkerRange.toString()&quot;, &quot;wellcome&quot;);
-    shouldBeEqualToString(&quot;window.getSelection().toString()&quot;, &quot;wellcome&quot;);
</del><ins>+        // Double-click the misspelled word with trailing whitespace.
+        verifySpellingMarkersAfterDoubleClick(textNode, true, finishJSTest);
+    });
</ins><span class="cx"> 
</span><del>-    window.getSelection().removeAllRanges();
-    shouldBeEqualToString(&quot;window.getSelection().toString()&quot;, &quot;&quot;);
</del><ins>+});
</ins><span class="cx"> 
</span><del>-    // Double-click the misspelled word with trailing whitespace.
-    internals.settings.setSmartInsertDeleteEnabled(false);
-    internals.settings.setSelectTrailingWhitespaceEnabled(true);
</del><ins>+function verifySpellingMarkersAfterDoubleClick(textNode, isSelectTrailingWhitespaceEnabled, completionCallback) {
+    internals.settings.setSelectTrailingWhitespaceEnabled(isSelectTrailingWhitespaceEnabled);
+    internals.settings.setSmartInsertDeleteEnabled(!isSelectTrailingWhitespaceEnabled);
+
</ins><span class="cx">     var x = destination.offsetParent.offsetLeft + destination.offsetLeft + 40;
</span><span class="cx">     var y = destination.offsetParent.offsetTop + destination.offsetTop + destination.offsetHeight / 2;
</span><span class="cx">     eventSender.mouseMoveTo(x, y);
</span><span class="lines">@@ -49,10 +43,10 @@
</span><span class="cx">     eventSender.mouseDown();
</span><span class="cx">     eventSender.mouseUp();
</span><span class="cx"> 
</span><del>-    spellingMarkerRange = internals.markerRangeForNode(textNode, &quot;spelling&quot;, 0);
-    shouldBeEqualToString(&quot;spellingMarkerRange.toString()&quot;, &quot;wellcome&quot;);
-    shouldBeEqualToString(&quot;window.getSelection().toString()&quot;, &quot;wellcome &quot;);
-});
</del><ins>+    shouldBeEqualToString(&quot;window.getSelection().toString()&quot;, isSelectTrailingWhitespaceEnabled ? &quot;wellcome &quot; : &quot;wellcome&quot;);
+    var spellingMarkerRange = internals.markerRangeForNode(textNode, &quot;spelling&quot;, 0);
+    shouldBecomeEqualToString(&quot;spellingMarkerRange.toString()&quot;, &quot;wellcome&quot;, completionCallback);
+}
</ins><span class="cx"> 
</span><span class="cx"> &lt;/script&gt;
</span><span class="cx"> &lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
</span></span></pre></div>
<a id="trunkLayoutTestseditingspellingspellingexactlyselectedwordexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/editing/spelling/spelling-exactly-selected-word-expected.txt (161951 => 161952)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/editing/spelling/spelling-exactly-selected-word-expected.txt        2014-01-14 07:15:58 UTC (rev 161951)
+++ trunk/LayoutTests/editing/spelling/spelling-exactly-selected-word-expected.txt        2014-01-14 07:48:38 UTC (rev 161952)
</span><span class="lines">@@ -7,7 +7,7 @@
</span><span class="cx"> PASS spellingMarkerRange.toString() is &quot;wellcome&quot;
</span><span class="cx"> PASS window.getSelection().toString() is &quot;&quot;
</span><span class="cx"> PASS window.getSelection().toString() is &quot;wellcome&quot;
</span><del>-PASS spellingMarkerRange.toString() is &quot;wellcome&quot;
</del><ins>+PASS spellingMarkerRange.toString() became &quot;wellcome&quot;
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestseditingspellingspellingexactlyselectedwordhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/editing/spelling/spelling-exactly-selected-word.html (161951 => 161952)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/editing/spelling/spelling-exactly-selected-word.html        2014-01-14 07:15:58 UTC (rev 161951)
+++ trunk/LayoutTests/editing/spelling/spelling-exactly-selected-word.html        2014-01-14 07:48:38 UTC (rev 161952)
</span><span class="lines">@@ -30,7 +30,7 @@
</span><span class="cx">     shouldBeEqualToString(&quot;window.getSelection().toString()&quot;, &quot;wellcome&quot;);
</span><span class="cx"> 
</span><span class="cx">     spellingMarkerRange = internals.markerRangeForNode(textNode, &quot;spelling&quot;, 0);
</span><del>-    shouldBeEqualToString(&quot;spellingMarkerRange.toString()&quot;, &quot;wellcome&quot;);
</del><ins>+    shouldBecomeEqualToString(&quot;spellingMarkerRange.toString()&quot;, &quot;wellcome&quot;, finishJSTest);
</ins><span class="cx"> });
</span><span class="cx"> 
</span><span class="cx"> &lt;/script&gt;
</span></span></pre></div>
<a id="trunkLayoutTestseditingspellingspellingwithpunctuationselectionexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/editing/spelling/spelling-with-punctuation-selection-expected.txt (161951 => 161952)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/editing/spelling/spelling-with-punctuation-selection-expected.txt        2014-01-14 07:15:58 UTC (rev 161951)
+++ trunk/LayoutTests/editing/spelling/spelling-with-punctuation-selection-expected.txt        2014-01-14 07:48:38 UTC (rev 161952)
</span><span class="lines">@@ -1,4 +1,4 @@
</span><del>-Punctuation marks should be treated as whitespace: spelling should ignore them. To test manually, type 'wellcome!', select 'wellcome!', and context-click on the selection. The test succeeds when the context menu has spell check suggestions.
</del><ins>+Punctuation marks should be treated as whitespace: spelling should ignore them. To test manually, type 'wellcome!' and select 'wellcome!'. The test succeeds when 'wellcome' has spelling marker.
</ins><span class="cx"> 
</span><span class="cx"> On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
</span><span class="cx"> 
</span><span class="lines">@@ -7,8 +7,7 @@
</span><span class="cx"> PASS spellingMarkerRange.toString() is &quot;wellcome&quot;
</span><span class="cx"> PASS window.getSelection().toString() is &quot;&quot;
</span><span class="cx"> PASS window.getSelection().toString() is &quot;wellcome!&quot;
</span><del>-PASS spellingMarkerRange.toString() is &quot;wellcome&quot;
-PASS window.getSelection().toString() is &quot;wellcome!&quot;
</del><ins>+PASS spellingMarkerRange.toString() became &quot;wellcome&quot;
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestseditingspellingspellingwithpunctuationselectionhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/editing/spelling/spelling-with-punctuation-selection.html (161951 => 161952)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/editing/spelling/spelling-with-punctuation-selection.html        2014-01-14 07:15:58 UTC (rev 161951)
+++ trunk/LayoutTests/editing/spelling/spelling-with-punctuation-selection.html        2014-01-14 07:48:38 UTC (rev 161952)
</span><span class="lines">@@ -11,9 +11,9 @@
</span><span class="cx"> 
</span><span class="cx"> &lt;script&gt;
</span><span class="cx"> 
</span><del>-description(&quot;Punctuation marks should be treated as whitespace: spelling should ignore them. &quot; +
-            &quot;To test manually, type 'wellcome!', select 'wellcome!', and context-click on the selection. &quot; +
-            &quot;The test succeeds when the context menu has spell check suggestions.&quot;);
</del><ins>+description(&quot;Punctuation marks should be treated as whitespace: spelling should ignore them. &quot;
+    + &quot;To test manually, type 'wellcome!' and select 'wellcome!'. &quot;
+    + &quot;The test succeeds when 'wellcome' has spelling marker.&quot;);
</ins><span class="cx"> 
</span><span class="cx"> initSpellTest(&quot;destination&quot;, &quot;wellcome!&quot;, function(textNode) {
</span><span class="cx">     spellingMarkerRange = internals.markerRangeForNode(textNode, &quot;spelling&quot;, 0);
</span><span class="lines">@@ -29,16 +29,8 @@
</span><span class="cx"> 
</span><span class="cx">     shouldBeEqualToString(&quot;window.getSelection().toString()&quot;, &quot;wellcome!&quot;);
</span><span class="cx"> 
</span><del>-    // Context click to show the context menu.
-    var x = destination.offsetParent.offsetLeft + destination.offsetLeft + 40;
-    var y = destination.offsetParent.offsetTop + destination.offsetTop + destination.offsetHeight / 2;
-    eventSender.mouseMoveTo(x, y);
-    // Esc key to hide the context menu.
-    eventSender.keyDown(String.fromCharCode(0x001B), null);
-
</del><span class="cx">     spellingMarkerRange = internals.markerRangeForNode(textNode, &quot;spelling&quot;, 0);
</span><del>-    shouldBeEqualToString(&quot;spellingMarkerRange.toString()&quot;, &quot;wellcome&quot;);
-    shouldBeEqualToString(&quot;window.getSelection().toString()&quot;, &quot;wellcome!&quot;);
</del><ins>+    shouldBecomeEqualToString(&quot;spellingMarkerRange.toString()&quot;, &quot;wellcome&quot;, finishJSTest);
</ins><span class="cx"> });
</span><span class="cx"> 
</span><span class="cx"> &lt;/script&gt;
</span></span></pre></div>
<a id="trunkLayoutTestseditingspellingspellingwithwhitespaceselectionexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/editing/spelling/spelling-with-whitespace-selection-expected.txt (161951 => 161952)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/editing/spelling/spelling-with-whitespace-selection-expected.txt        2014-01-14 07:15:58 UTC (rev 161951)
+++ trunk/LayoutTests/editing/spelling/spelling-with-whitespace-selection-expected.txt        2014-01-14 07:48:38 UTC (rev 161952)
</span><span class="lines">@@ -1,4 +1,4 @@
</span><del>-Spelling should ignore whitespace. To test manually, type 'hello, wellcome home.', select ' wellcome ', and context-click on the selection. The test succeeds when the context menu has spell check suggestions.
</del><ins>+Spelling should ignore whitespace. To test manually, type 'hello, wellcome home.', select ' wellcome '. The test succeeds when 'wellcome' has spelling marker.
</ins><span class="cx"> 
</span><span class="cx"> On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
</span><span class="cx"> 
</span><span class="lines">@@ -6,8 +6,7 @@
</span><span class="cx"> PASS internals.markerCountForNode(destination.childNodes[0], &quot;spelling&quot;) became different from 0
</span><span class="cx"> PASS spellingMarkerRange.toString() is &quot;wellcome&quot;
</span><span class="cx"> PASS window.getSelection().toString() is &quot; wellcome &quot;
</span><del>-PASS spellingMarkerRange.toString() is &quot;wellcome&quot;
-PASS window.getSelection().toString() is &quot; wellcome &quot;
</del><ins>+PASS spellingMarkerRange.toString() became &quot;wellcome&quot;
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestseditingspellingspellingwithwhitespaceselectionhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/editing/spelling/spelling-with-whitespace-selection.html (161951 => 161952)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/editing/spelling/spelling-with-whitespace-selection.html        2014-01-14 07:15:58 UTC (rev 161951)
+++ trunk/LayoutTests/editing/spelling/spelling-with-whitespace-selection.html        2014-01-14 07:48:38 UTC (rev 161952)
</span><span class="lines">@@ -11,9 +11,9 @@
</span><span class="cx"> 
</span><span class="cx"> &lt;script&gt;
</span><span class="cx"> 
</span><del>-description(&quot;Spelling should ignore whitespace. &quot; +
-            &quot;To test manually, type 'hello, wellcome home.', select ' wellcome ', and context-click on the selection. &quot; +
-            &quot;The test succeeds when the context menu has spell check suggestions.&quot;);
</del><ins>+description(&quot;Spelling should ignore whitespace. &quot;
+    + &quot;To test manually, type 'hello, wellcome home.', select ' wellcome '. &quot;
+    + &quot;The test succeeds when 'wellcome' has spelling marker.&quot;);
</ins><span class="cx"> 
</span><span class="cx"> initSpellTest(&quot;destination&quot;, &quot;hello, wellcome home.&quot;, function(textNode) {
</span><span class="cx">     spellingMarkerRange = internals.markerRangeForNode(textNode, &quot;spelling&quot;, 0);
</span><span class="lines">@@ -28,16 +28,8 @@
</span><span class="cx"> 
</span><span class="cx">     shouldBeEqualToString(&quot;window.getSelection().toString()&quot;, &quot; wellcome &quot;);
</span><span class="cx"> 
</span><del>-    // Context click on &quot; wellcome &quot; to show the context menu.
-    var x = destination.offsetParent.offsetLeft + destination.offsetLeft + 80;
-    var y = destination.offsetParent.offsetTop + destination.offsetTop + destination.offsetHeight / 2;
-    eventSender.mouseMoveTo(x, y);
-    // Esc key to hide the context menu.
-    eventSender.keyDown(String.fromCharCode(0x001B), null);
-
</del><span class="cx">     spellingMarkerRange = internals.markerRangeForNode(textNode, &quot;spelling&quot;, 0);
</span><del>-    shouldBeEqualToString(&quot;spellingMarkerRange.toString()&quot;, &quot;wellcome&quot;);
-    shouldBeEqualToString(&quot;window.getSelection().toString()&quot;, &quot; wellcome &quot;);
</del><ins>+    shouldBecomeEqualToString(&quot;spellingMarkerRange.toString()&quot;, &quot;wellcome&quot;, finishJSTest);
</ins><span class="cx"> });
</span><span class="cx"> 
</span><span class="cx"> &lt;/script&gt;
</span></span></pre>
</div>
</div>

</body>
</html>