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

Unified Diff: third_party/WebKit/LayoutTests/fast/dom/HTMLInputElement/size-attribute.html

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/HTMLInputElement/size-attribute.html
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLInputElement/size-attribute.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLInputElement/size-attribute.html
index a08cff4fab55486ff3e7bd69fa32d2f7859855bc..b04c7efbed20ad4bcfd1551c1f9c58385862c68b 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLInputElement/size-attribute.html
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLInputElement/size-attribute.html
@@ -4,6 +4,47 @@
<script src="../../../resources/js-test.js"></script>
</head>
<body>
-<script src="script-tests/size-attribute.js"></script>
+<script>
+description("HTMLInputElement size attribute test");
+
+function sizeAttributeEffect(value)
+{
+ var element = document.createElement("input");
+ element.setAttribute("size", value);
+ return element.size;
+}
+
+shouldBe('document.createElement("input").size', '20');
+
+shouldBe('sizeAttributeEffect("")', '20');
+
+shouldBe('sizeAttributeEffect("1")', '1');
+shouldBe('sizeAttributeEffect("2")', '2');
+shouldBe('sizeAttributeEffect("10")', '10');
+
+shouldBe('sizeAttributeEffect("0")', '20');
+
+shouldBe('sizeAttributeEffect("-1")', '20');
+
+shouldBe('sizeAttributeEffect("1x")', '1');
+shouldBe('sizeAttributeEffect("1.")', '1');
+shouldBe('sizeAttributeEffect("1.9")', '1');
+shouldBe('sizeAttributeEffect("2x")', '2');
+shouldBe('sizeAttributeEffect("2.")', '2');
+shouldBe('sizeAttributeEffect("2.9")', '2');
+
+shouldBe('sizeAttributeEffect("a")', '20');
+shouldBe('sizeAttributeEffect("\v7")', '20');
+shouldBe('sizeAttributeEffect(" 7")', '7');
+
+var arabicIndicDigitOne = String.fromCharCode(0x661);
+shouldBe('sizeAttributeEffect(arabicIndicDigitOne)', '20');
+shouldBe('sizeAttributeEffect("2" + arabicIndicDigitOne)', '2');
+
+shouldBe('sizeAttributeEffect("2147483647")', '2147483647');
+shouldBe('sizeAttributeEffect("2147483648")', '20');
+shouldBe('sizeAttributeEffect("4294967295")', '20');
+shouldBe('sizeAttributeEffect("4294967296")', '20');
+</script>
</body>
</html>

Powered by Google App Engine
This is Rietveld 408576698