+2011-11-20 Shinya Kawanaka <shinyak@google.com>
+
+ [Chromium] Layout test does not return correct misspelling positions if there are multiple misspelled words.
+ https://bugs.webkit.org/show_bug.cgi?id=72655
+
+ Reviewed by Hajime Morita.
+
+ Fixed the calculation of offset, and added test cases having multiple misspelled words.
+
+ * editing/spelling/script-tests/spellcheck-paste.js:
+ Added test cases having multiple misspelled words.
+ (verifyMarker):
+ (tests):
+ * editing/spelling/spellcheck-paste-expected.txt: Recreated.
+
2011-11-20 Kenichi Ishibashi <bashi@chromium.org>
[Chromium] Remove old getFontFamilyForCharacters() and familyForChars() APIs.
testSourceDecorated.innerHTML = "fo<b>o ba</b>r";
testRoot.appendChild(testSourceDecorated);
+var testSourceMulti = document.createElement("div");
+testSourceMulti.innerHTML = "zz zz zz";
+testRoot.appendChild(testSourceMulti);
+
var sel = window.getSelection();
var tests = [];
} else {
sel.selectAllChildren(node);
}
- return layoutTestController.hasSpellingMarker(expectedMarked[0], expectedMarked[1]);
+
+ var ok = true;
+ for (var i = 0; ok && i < expectedMarked.length; ++i)
+ ok = layoutTestController.hasSpellingMarker(expectedMarked[i][0], expectedMarked[i][1]);
+ return ok;
}
function pasteAndVerify(source, dest, expectedMarked)
if (window.layoutTestController)
layoutTestController.setAsynchronousSpellCheckingEnabled(true);
-tests.push(function() { pasteAndVerify(testSourcePlain, testInput, [0, 3]); });
-tests.push(function() { pasteAndVerify(testSourceDecorated, testInput, [0, 3]); });
-tests.push(function() { pasteAndVerify(testSourcePlain, testTextArea, [0, 3]); });
-tests.push(function() { pasteAndVerify(testSourceDecorated, testTextArea, [0, 3]); });
-tests.push(function() { pasteAndVerify(testSourcePlain, testEditable, [0, 3]); });
-tests.push(function() { pasteAndVerify(testSourceDecorated, testEditable, [0, 2]); }); // To check "fo" part of foo.
+tests.push(function() { pasteAndVerify(testSourcePlain, testInput, [[0, 3]]); });
+tests.push(function() { pasteAndVerify(testSourceDecorated, testInput, [[0, 3]]); });
+tests.push(function() { pasteAndVerify(testSourceMulti, testInput, [[0, 2], [3, 2]]); });
+tests.push(function() { pasteAndVerify(testSourcePlain, testTextArea, [[0, 3]]); });
+tests.push(function() { pasteAndVerify(testSourceDecorated, testTextArea, [[0, 3]]); });
+tests.push(function() { pasteAndVerify(testSourceMulti, testTextArea, [[0, 2], [3, 2]]); });
+tests.push(function() { pasteAndVerify(testSourcePlain, testEditable, [[0, 3]]); });
+tests.push(function() { pasteAndVerify(testSourceDecorated, testEditable, [[0, 2]]); }); // To check "fo" part of foo.
+tests.push(function() { pasteAndVerify(testSourceMulti, testEditable, [[0, 2], [3, 2]]); });
done();
var successfullyParsed = true;