Index: third_party/WebKit/LayoutTests/editing/spelling/grammar-markers-hidpi.html |
diff --git a/third_party/WebKit/LayoutTests/editing/spelling/grammar-markers-hidpi.html b/third_party/WebKit/LayoutTests/editing/spelling/grammar-markers-hidpi.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..05a9fc6257da4c7262ff09d9418ad5cd078b12e2 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/editing/spelling/grammar-markers-hidpi.html |
@@ -0,0 +1,40 @@ |
+<!DOCTYPE html> |
+<html> |
+<head> |
+<script src="../../resources/js-test.js"></script> |
+</head> |
+<body> |
+<div id="source" contenteditable="true" spellcheck="false">You has the right.</div> |
+<div id="target" contenteditable="true" spellcheck="true"></div> |
+ |
+<script> |
+description('This tests whether WebKit can render grammar markers when pasting text if it has a grammar-checker. To test manually, copy the text in the first div element and paste it to the second div element. This test succeeds when WebKit renders a grammar marker under a word "has".'); |
+ |
+jsTestIsAsync = true; |
+ |
+function verifyGrammarMarker(destination, ungrammaticalPhrase) |
+{ |
+ if (internals.hasGrammarMarker(document, destination.innerHTML.indexOf(ungrammaticalPhrase), ungrammaticalPhrase.length)) { |
+ testPassed("ungrammatical phrase '" + ungrammaticalPhrase + "' on '" + destination.innerHTML + "'"); |
+ return true; |
+ } else |
+ return false; |
+} |
+ |
+if (window.testRunner) { |
+ testRunner.dumpAsTextWithPixelResults(); |
+ testRunner.setBackingScaleFactor(2, function () { |
+ shouldBecomeEqual('verifyGrammarMarker(target, "has")', 'true', finishJSTest); |
+ }); |
+} |
+ |
+var source = document.getElementById('source'); |
+window.getSelection().selectAllChildren(source); |
+document.execCommand('Copy'); |
+var target = document.getElementById('target'); |
+window.getSelection().selectAllChildren(target); |
+document.execCommand('Paste'); |
+ |
+</script> |
+</body> |
+</html> |