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

Unified Diff: third_party/WebKit/LayoutTests/fast/dom/HTMLElement/script-tests/spellcheck.js

Issue 2667393002: Stop using script-tests in fast/dom/. (Closed)
Patch Set: . Created 3 years, 11 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/fast/dom/HTMLElement/script-tests/spellcheck.js
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/script-tests/spellcheck.js b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/script-tests/spellcheck.js
deleted file mode 100644
index f1edf3329a2b836a3c96d1a1944548aed045c4f3..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/script-tests/spellcheck.js
+++ /dev/null
@@ -1,100 +0,0 @@
-description('Tests the spellcheck attribute.');
-
-var parent = document.createElement("div");
-document.body.appendChild(parent);
-
-function testFor(initialAttribute, initialExpectation, setValue, lastExpectation, lastAttributeExpectation)
-{
- var target = document.createElement("span");
- parent.appendChild(target);
-
- window.target = target;
- window.initialExpectation = initialExpectation;
- window.lastExpectation = lastExpectation;
- window.lastAttributeExpectation = lastAttributeExpectation;
-
- if (undefined !== initialAttribute)
- target.setAttribute("spellcheck", initialAttribute);
- shouldBe("target.spellcheck", "initialExpectation");
-
- if (undefined !== setValue)
- target.spellcheck = setValue;
- shouldBe("target.spellcheck", "lastExpectation");
- shouldBe("target.getAttribute('spellcheck')", "lastAttributeExpectation");
-
- parent.removeChild(target);
-}
-
-function testUsingSetAttributes()
-{
- var target = document.createElement("span");
- parent.appendChild(target);
- window.target = target;
-
- shouldBe("target.spellcheck", "true");
- shouldBe("target.getAttribute('spellcheck')", "'true'");
- // Set using property.
- target.spellcheck = false;
- shouldBe("target.spellcheck", "false");
- shouldBe("target.getAttribute('spellcheck')", "'false'");
- // Set using setAttribute().
- target.setAttribute("spellcheck", "true");
- shouldBe("target.spellcheck", "true");
- shouldBe("target.getAttribute('spellcheck')", "'true'");
-
- // Set using setAttribute(), valid but non canonical value.
- target.spellcheck = false; // clear at first
- target.setAttribute("spellcheck", "TRUE");
- shouldBe("target.spellcheck", "true");
- shouldBe("target.getAttribute('spellcheck')", "'TRUE'");
- // Set using setAttribute(), invalid value.
- target.spellcheck = false; // clear at first
- target.setAttribute("spellcheck", "INVALID");
- shouldBe("target.spellcheck", "true");
- shouldBe("target.getAttribute('spellcheck')", "'INVALID'");
-
- parent.removeChild(target);
-}
-
-testFor(undefined, true, undefined, true, null);
-testFor(undefined, true, false, false, "false");
-testFor(undefined, true, true, true, "true");
-testFor(undefined, true, 0, false, "false"); // 0 will be coerced to false
-testFor(undefined, true, 1, true, "true"); // 0 will be coerced to true
-testFor(undefined, true, "invalid", true, "true"); // string will be coerced to true
-testFor(undefined, true, "false", true, "true"); // ...even if the string is "false" (as Firefox does).
-
-testFor("true", true, undefined, true, "true");
-testFor("true", true, false, false, "false");
-testFor("true", true, true, true, "true");
-testFor("true", true, 0, false, "false");
-testFor("true", true, 1, true, "true");
-testFor("true", true, "invalid", true, "true");
-testFor("true", true, "false", true, "true");
-
-testFor("false", false, undefined, false, "false");
-testFor("false", false, false, false, "false");
-testFor("false", false, true, true, "true");
-testFor("false", false, 0, false, "false");
-testFor("false", false, 1, true, "true");
-testFor("false", false, "invalid", true, "true");
-testFor("false", false, "false", true, "true");
-
-// various initial values
-testFor("", true, undefined, true, "");
-testFor("", true, 1, true, "true");
-testFor("TRUE", true, undefined, true, "TRUE");
-testFor("TRUE", true, 1, true, "true");
-testFor("FALSE", false, undefined, false, "FALSE");
-testFor("FALSE", false, 0, false, "false");
-testFor("invalid", true, undefined, true, "invalid");
-testFor("invalid", true, 1, true, "true");
-testFor("false ", true, undefined, true, "false ");
-testFor("false ", true, 1, true, "true");
-testFor("false ", true, 0, false, "false");
-testFor("0", true, undefined, true, "0");
-testFor("0", true, 0, false, "false");
-testFor("1", true, undefined, true, "1");
-testFor("1", true, 0, false, "false");
-
-testUsingSetAttributes();

Powered by Google App Engine
This is Rietveld 408576698