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

Unified Diff: LayoutTests/editing/spelling/grammar.html

Issue 39733005: Use asynchronous spellcheck path in layout tests (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: Created 7 years, 2 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/grammar.html
diff --git a/LayoutTests/editing/spelling/grammar.html b/LayoutTests/editing/spelling/grammar.html
index 040a0fe2ce2cc9339d73cf6d519f55837367cbed..2869729b30b3821f284a9799716b1a42b2cfba8c 100644
--- a/LayoutTests/editing/spelling/grammar.html
+++ b/LayoutTests/editing/spelling/grammar.html
@@ -1,5 +1,6 @@
<html>
<head>
+<script src="../../fast/js/resources/js-test-pre.js"></script>
<style>
.editing {
@@ -11,25 +12,17 @@
<script src=../editing.js language="JavaScript" type="text/JavaScript" ></script>
<script>
-function log(msg) {
- document.getElementById("console").innerHTML += (msg + "\n");
-}
-
function editingTest() {
if (window.testRunner)
testRunner.dumpAsText();
document.getElementById("root").focus();
-
document.execCommand("InsertText", false, "I have a issue.");
- if (window.testRunner) {
- if (internals.hasGrammarMarker(document, 7, 1))
- log("PASS");
- else
- log("FAIL");
+ shouldBecomeEqual('internals.hasGrammarMarker(document, 7, 1)', 'true', function() {
document.getElementById("root").style.display = "none";
- }
+ finishJSTest();
+ });
}
</script>
@@ -37,13 +30,20 @@ function editingTest() {
<title>Editing Test</title>
</head>
<body>
-<div>You should see the text 'I have a issue'. 'a' should have a grammar suggestion marking.</div>
-<div contenteditable id="root" class="editing">
-</div>
-<pre id="console"></pre>
+<div contenteditable id="root" class="editing"></div>
<script>
+description("This tests whether the grammatically-incorrect phrase "
+ + "'I have a issue' has grammar marker on 'a'.");
+
+jsTestIsAsync = true;
+
+if (window.internals) {
+ internals.settings.setUnifiedTextCheckerEnabled(true);
+ internals.settings.setAsynchronousSpellCheckingEnabled(true);
+}
+
editingTest();
</script>
-
+<script src="../../fast/js/resources/js-test-post.js"></script>
</body>
</html>

Powered by Google App Engine
This is Rietveld 408576698