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

Unified Diff: third_party/WebKit/LayoutTests/editing/spelling/script-tests/spelling-attribute-change.js

Issue 2453313005: Convert editing/spelling/spelling-attribute-change.html with spellcheck_test (Closed)
Patch Set: Make everything verbose 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/editing/spelling/spelling-attribute-change.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/editing/spelling/script-tests/spelling-attribute-change.js
diff --git a/third_party/WebKit/LayoutTests/editing/spelling/script-tests/spelling-attribute-change.js b/third_party/WebKit/LayoutTests/editing/spelling/script-tests/spelling-attribute-change.js
deleted file mode 100644
index 69f83ebb8d6f56b075205819456b5ddedac4cc7a..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/editing/spelling/script-tests/spelling-attribute-change.js
+++ /dev/null
@@ -1,91 +0,0 @@
-description('Tests if the spellchecker behaves correctly when the spellcheck attribute '
- + 'is being changed by the script.');
-
-jsTestIsAsync = true;
-if (window.testRunner)
- testRunner.setMockSpellCheckerEnabled(true);
-
-var parent = document.createElement("div");
-document.body.appendChild(parent);
-var sel = document.getSelection();
-
-function testSpellCheckingEnabled(target, enabled)
-{
- target.spellcheck = enabled;
-
- if (target.tagName == "SPAN") {
- target.appendChild(document.createTextNode("Hello,"));
- sel.setBaseAndExtent(target, 6, target, 6);
- } else if (target.tagName == "INPUT" || target.tagName == "TEXTAREA") {
- target.focus();
- document.execCommand("InsertText", false, "Hello,");
- }
-
- document.execCommand("InsertText", false, 'z');
- document.execCommand("InsertText", false, 'z');
- document.execCommand("InsertText", false, ' ');
-
- window.target = target;
- shouldBe("target.spellcheck", enabled ? "true" : "false");
- if (window.internals)
- shouldBecomeEqual("internals.hasSpellingMarker(document, 6, 2)", enabled ? "true" : "false", done);
- else
- done();
-}
-
-function createElement(tagName, spellcheck)
-{
- var target = document.createElement(tagName);
- if (tagName == "SPAN")
- target.setAttribute("contentEditable", "true");
- if (spellcheck)
- target.setAttribute("spellcheck", spellcheck);
- return target;
-}
-
-function testFor(tagName, spellCheckAttribueValues)
-{
- var target = createElement(tagName, spellCheckAttribueValues.initialValue);
- parent.appendChild(target);
-
- testSpellCheckingEnabled(target, spellCheckAttribueValues.destinationValue);
-}
-
-var testElements = [
- "SPAN",
- "INPUT",
- "TEXTAREA"
-];
-
-const spellcheckAttributeVariances = [
- { initialValue: undefined, destinationValue: true },
- { initialValue: undefined, destinationValue: false },
- { initialValue: true, destinationValue: true },
- { initialValue: true, destinationValue: false },
- { initialValue: false, destinationValue: true },
- { initialValue: false, destinationValue: false }
-];
-
-var iterator = 0;
-var currentElement = null;
-
-function done()
-{
- if (!currentElement) {
- currentElement = testElements.shift();
- // All elements have been already taken.
- if (!currentElement)
- return finishJSTest();
- }
-
- if (iterator != spellcheckAttributeVariances.length)
- setTimeout(testFor(currentElement, spellcheckAttributeVariances[iterator++]), 0);
- else {
- iterator = 0;
- currentElement = null;
- done();
- }
-}
-done();
-
-var successfullyParsed = true;
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/editing/spelling/spelling-attribute-change.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698