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

Side by Side Diff: third_party/WebKit/LayoutTests/svg/dom/script-tests/SVGNumber.js

Issue 2741153003: Convert LayoutTests/svg/dom/*.html js-tests.js to testharness.js based tests. (Closed)
Patch Set: Align with review comments Created 3 years, 9 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 description("This test checks the SVGNumber API");
2
3 var svgElement = document.createElementNS("http://www.w3.org/2000/svg", "svg");
4 var num = svgElement.createSVGNumber();
5
6 debug("");
7 debug("Check initial number value");
8 shouldBe("num.value", "0");
9
10 debug("");
11 debug("Check assigning number");
12 shouldBe("num.value = 100", "100");
13 shouldBe("num.value = -100", "-100");
14 shouldBe("num.value = 12345678", "12345678");
15 shouldBe("num.value = -num.value", "-12345678");
16
17 debug("");
18 debug("Check that numbers are static, caching value in a local variable and modi fying it, should have no effect");
19 var numRef = num.value;
20 numRef = 1000;
21 shouldBe("numRef", "1000");
22 shouldBe("num.value", "-12345678");
23
24 debug("");
25 debug("Check assigning invalid number, number should be 0 afterwards");
26 shouldBe("num.value = 0", "0");
27 shouldThrow("num.value = num");
28 shouldThrow("num.value = 'aString'");
29 shouldThrow("num.value = svgElement");
30 shouldThrow("num.value = NaN");
31 shouldThrow("num.value = Infinity");
32 shouldBe("num.value", "0");
33 shouldBeNull("num.value = null");
34
35 debug("");
36 debug("Check that the number is now null");
37 shouldBe("num.value", "0");
38
39 successfullyParsed = true;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698