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

Unified Diff: LayoutTests/fast/dom/script-tests/unsigned-long-attribute-reflection.js

Issue 64173002: Align HTMLAppletElement IDL with spec (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: drop logging Created 7 years, 1 month 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 | « LayoutTests/fast/dom/element-attribute-js-null-expected.txt ('k') | Source/core/html/HTMLAppletElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/dom/script-tests/unsigned-long-attribute-reflection.js
diff --git a/LayoutTests/fast/dom/script-tests/unsigned-long-attribute-reflection.js b/LayoutTests/fast/dom/script-tests/unsigned-long-attribute-reflection.js
new file mode 100644
index 0000000000000000000000000000000000000000..45a35159b1f57aaa43ade3eede78db6591b86ef0
--- /dev/null
+++ b/LayoutTests/fast/dom/script-tests/unsigned-long-attribute-reflection.js
@@ -0,0 +1,49 @@
+// http://whatwg.org/html#reflecting-content-attributes-in-idl-attributes
+// http://whatwg.org/html#rules-for-parsing-non-negative-integers
+function testUnsignedLong(interface, createElement, attribute)
+{
+ test(function()
+ {
+ var element = createElement();
+
+ assert_equals(element[attribute], 0);
+
+ function t(input, output)
+ {
+ element.setAttribute(attribute, input);
+ assert_equals(element[attribute], output);
+ }
+
+ t("", 0);
+ t("0", 0);
+ t("1", 1);
+ t("2147483647", 2147483647);
+ t("2147483648", 0);
+ t("-1", 0);
+ t("+42", 42);
+ t(" 42", 42);
+ t("42!", 42);
+ }, "get " + interface + "." + attribute);
+
+ test(function()
+ {
+ var element = createElement();
+
+ assert_false(element.hasAttribute(attribute));
+
+ function t(input, output)
+ {
+ element[attribute] = input;
+ assert_equals(element.getAttribute(attribute), output);
+ }
+
+ t(0, "0");
+ t(2147483647, "2147483647");
+ // per spec:
+ //t(2147483648, "0");
+ //t(-1, "0");
+ // per implementation <http://crbug.com/316122>:
+ t(2147483648, "2147483648");
+ t(-1, "4294967295");
+ }, "set " + interface + "." + attribute);
+}
« no previous file with comments | « LayoutTests/fast/dom/element-attribute-js-null-expected.txt ('k') | Source/core/html/HTMLAppletElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698