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

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

Issue 2713833002: Convert LayoutTests/svg/dom/SVGAnimated*.html js-tests.js to testharness.js based tests. (Closed)
Patch Set: 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 SVGAnimatedNumber API - utilizing the surfaceS cale property of SVGFESpecularLightingElement");
2
3 var feSpecularLightingElement = document.createElementNS("http://www.w3.org/2000 /svg", "feSpecularLighting");
4
5 debug("");
6 debug("Check initial surfaceScale value");
7 shouldBeEqualToString("feSpecularLightingElement.surfaceScale.toString()", "[obj ect SVGAnimatedNumber]");
8 shouldBeEqualToString("typeof(feSpecularLightingElement.surfaceScale.baseVal)", "number");
9 shouldBe("feSpecularLightingElement.surfaceScale.baseVal", "1");
10
11 debug("");
12 debug("Check that integers are static, caching value in a local variable and mod ifying it, should have no effect");
13 var numRef = feSpecularLightingElement.surfaceScale.baseVal;
14 numRef = 100;
15 shouldBe("numRef", "100");
16 shouldBe("feSpecularLightingElement.surfaceScale.baseVal", "1");
17
18 debug("");
19 debug("Check assigning various valid and invalid values");
20 shouldBe("feSpecularLightingElement.surfaceScale.baseVal = -1", "-1"); // Negati ve values are allowed from SVG DOM, but should lead to an error when rendering ( disable the filter)
21 shouldBe("feSpecularLightingElement.surfaceScale.baseVal = 300", "300");
22 // ECMA-262, 9.3, "ToNumber"
23 shouldThrow("feSpecularLightingElement.surfaceScale.baseVal = 'aString'");
24 shouldBe("feSpecularLightingElement.surfaceScale.baseVal", "300");
25 shouldBe("feSpecularLightingElement.surfaceScale.baseVal = 0", "0");
26 shouldThrow("feSpecularLightingElement.surfaceScale.baseVal = NaN");
27 shouldBe("feSpecularLightingElement.surfaceScale.baseVal", "0");
28 shouldThrow("feSpecularLightingElement.surfaceScale.baseVal = Infinity");
29 shouldBe("feSpecularLightingElement.surfaceScale.baseVal", "0");
30 shouldThrow("feSpecularLightingElement.surfaceScale.baseVal = feSpecularLighting Element");
31 shouldBe("feSpecularLightingElement.surfaceScale.baseVal", "0");
32 shouldBe("feSpecularLightingElement.surfaceScale.baseVal = 300", "300");
33
34 debug("");
35 debug("Check that the surfaceScale value remained 300");
36 shouldBe("feSpecularLightingElement.surfaceScale.baseVal", "300");
37
38 successfullyParsed = true;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698