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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/script-tests/unsigned-long-attribute-reflection.js

Issue 2667393002: Stop using script-tests in fast/dom/. (Closed)
Patch Set: . Created 3 years, 10 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 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 t(2147483648, "0");
43 t(2147483700, "0");
44 t(-1, "0");
45 t(-3, "0");
46 }, "set " + interface + "." + attribute);
47 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698