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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // http://whatwg.org/html#reflecting-content-attributes-in-idl-attributes
2 // http://whatwg.org/html#rules-for-parsing-non-negative-integers
3 function testUnsignedLong(interface, createElement, attribute)
4 {
5 test(function()
6 {
7 var element = createElement();
8
9 assert_equals(element[attribute], 0);
10
11 function t(input, output)
12 {
13 element.setAttribute(attribute, input);
14 assert_equals(element[attribute], output);
15 }
16
17 t("", 0);
18 t("0", 0);
19 t("1", 1);
20 t("2147483647", 2147483647);
21 t("2147483648", 0);
22 t("-1", 0);
23 t("+42", 42);
24 t(" 42", 42);
25 t("42!", 42);
26 }, "get " + interface + "." + attribute);
27
28 test(function()
29 {
30 var element = createElement();
31
32 assert_false(element.hasAttribute(attribute));
33
34 function t(input, output)
35 {
36 element[attribute] = input;
37 assert_equals(element.getAttribute(attribute), output);
38 }
39
40 t(0, "0");
41 t(2147483647, "2147483647");
42 // per spec:
43 //t(2147483648, "0");
44 //t(-1, "0");
45 // per implementation <http://crbug.com/316122>:
46 t(2147483648, "2147483648");
47 t(-1, "4294967295");
48 }, "set " + interface + "." + attribute);
49 }
OLDNEW
« 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