Index: LayoutTests/editing/spelling/grammar.html |
diff --git a/LayoutTests/editing/spelling/grammar.html b/LayoutTests/editing/spelling/grammar.html |
index 040a0fe2ce2cc9339d73cf6d519f55837367cbed..109b5c8f67355f2c8381ff3bc7dd58ec6b1bd8d5 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,24 +12,18 @@ |
<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"); |
- document.getElementById("root").style.display = "none"; |
+ if (window.internals) { |
+ shouldBecomeEqual('internals.hasGrammarMarker(document, 7, 1)', 'true', function() { |
+ document.getElementById("root").style.display = "none"; |
+ finishJSTest(); |
+ }); |
} |
} |
@@ -37,13 +32,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> |