Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(318)

Unified Diff: LayoutTests/editing/spelling/spelling-linebreak.html

Issue 197403002: Verify misspellings after lines merge/split asynchronously (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix expectations to meet new target names (should have been done in the patch #2) Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/editing/spelling/spelling-linebreak.html
diff --git a/LayoutTests/editing/spelling/spelling-linebreak.html b/LayoutTests/editing/spelling/spelling-linebreak.html
index 70e52bff69568b998bc538ecf456c775135d1dcf..b49e6f7a22928e39684e5fc07dd6ddaf7b60236f 100644
--- a/LayoutTests/editing/spelling/spelling-linebreak.html
+++ b/LayoutTests/editing/spelling/spelling-linebreak.html
@@ -8,17 +8,20 @@
font-size: 24px;
}
</style>
+<script src="../../resources/js-test.js"></script>
<script src=../editing.js language="JavaScript" type="text/JavaScript" ></script>
<script>
-function log(msg) {
- document.getElementById("console").innerHTML += (msg + "\n");
+
+jsTestIsAsync = true;
+
+if (window.internals) {
+ internals.settings.setUnifiedTextCheckerEnabled(true);
+ internals.settings.setAsynchronousSpellCheckingEnabled(true);
}
function editingTest() {
- if (window.testRunner)
- testRunner.dumpAsText();
var elem = document.getElementById("test");
var selection = window.getSelection();
selection.setPosition(elem, 6);
@@ -34,11 +37,10 @@ function editingTest() {
if (window.testRunner) {
selection.setPosition(elem, 0);
- if (internals.hasSpellingMarker(document, 6, 2))
- log("PASS");
- else
- log("FAIL");
- document.getElementById("root").style.display = "none";
+ shouldBecomeEqual("internals.hasSpellingMarker(document, 6, 2)", "true", function() {
+ document.getElementById("root").style.display = "none";
+ finishJSTest();
+ });
}
}
@@ -48,15 +50,18 @@ function editingTest() {
<title>Editing Test</title>
</head>
<body>
-<div>You should see 'zz a' on the first line below, and 'a' on the second line. 'zz' (and only 'zz') should be marked as misspelled.</div>
+<script>
+description("Misspellings should be preserved when a line-break command "
+ + "splits a text node. You should see 'Hello,zz a' on the first line below, "
+ + "and 'a' on the second line. "
+ + "This test succeeds when 'zz' (and only 'zz') is marked as misspelled.");
+</script>
<div contenteditable id="root" class="editing">
-<!-- wee need leading "Hello," to preserve the marker even after setPosition() -->
+<!-- we need to lead "Hello," to preserve the marker even after setPosition() -->
<span id="test">Hello,</span>
</div>
-<pre id="console"></pre>
<script>
editingTest();
</script>
-
</body>
</html>

Powered by Google App Engine
This is Rietveld 408576698