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

Unified Diff: third_party/WebKit/LayoutTests/editing/spelling/mixed-paste-short.html

Issue 2449743002: Convert editing/spelling/mixed-paste-*.html with spellcheck_test (Closed)
Patch Set: Wed Oct 26 14:57:43 JST 2016 Created 4 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: third_party/WebKit/LayoutTests/editing/spelling/mixed-paste-short.html
diff --git a/third_party/WebKit/LayoutTests/editing/spelling/mixed-paste-short.html b/third_party/WebKit/LayoutTests/editing/spelling/mixed-paste-short.html
deleted file mode 100644
index f7e934d80f756ef9be740a207c450dd5cb65ac5f..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/editing/spelling/mixed-paste-short.html
+++ /dev/null
@@ -1,89 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-<head>
-<script src="../../resources/js-test.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-<script>
-
-description('For bug cr571988: Spell checking for pasted mixed content.');
-
-jsTestIsAsync = true;
-if (window.testRunner)
- testRunner.setMockSpellCheckerEnabled(true);
-
-var testRoot = document.createElement("div");
-document.body.insertBefore(testRoot, document.body.firstChild);
-
-var testEditable = document.createElement("div");
-testEditable.setAttribute("contentEditable", "true");
-testRoot.appendChild(testEditable);
-
-var testSourceDecorated = document.createElement("div");
-testSourceDecorated.innerHTML = "<img src='../resources/abe.png'> zz zz.";
-testRoot.appendChild(testSourceDecorated);
-
-var sel = window.getSelection();
-
-var tests = [];
-
-function done()
-{
- var next = tests.shift();
- if (next)
- return window.setTimeout(next, 0);
- testRoot.style.display = "none";
- finishJSTest();
-}
-
-function verifyMarker(node, expectedMarked)
-{
- if (node instanceof HTMLInputElement || node instanceof HTMLTextAreaElement) {
- node.focus();
- } else {
- sel.selectAllChildren(node);
- }
-
- var count = 0;
- for (var i = 0; i < node.childNodes.length; ++i)
- count += internals.markerCountForNode(node.childNodes[i], 'spelling');
-
- if (count == expectedMarked) {
- var nodeContent = node instanceof HTMLInputElement || node instanceof HTMLTextAreaElement ? node.value : node.innerHTML;
- testPassed(node.tagName + " has " + expectedMarked + " markers on '" + nodeContent + "'");
- }
-
- return count == expectedMarked;
-}
-
-var destination = null;
-var misspelledCount = null;
-function pasteAndVerify(source, dest, expectedMarked)
-{
- sel.selectAllChildren(source);
- document.execCommand("Copy");
- if (dest instanceof HTMLInputElement || dest instanceof HTMLTextAreaElement) {
- dest.value = "";
- dest.focus();
- } else {
- dest.innerHTML = "";
- sel.selectAllChildren(dest);
- }
- document.execCommand("Paste");
-
- if (window.internals) {
- destination = dest;
- misspelledCount = expectedMarked;
- shouldBecomeEqual('verifyMarker(destination, misspelledCount)', 'true', done);
- }
-};
-
-tests.push(function() { pasteAndVerify(testSourceDecorated, testEditable, testSourceDecorated.innerHTML.match(/zz/g).length); });
-done();
-
-var successfullyParsed = true;
-</script>
-</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698