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

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

Issue 930053002: Apply TypeChecking=Unrestricted to SVG{Number,Length,Transform,Angle} (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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 | Annotate | Revision Log
OLDNEW
1 description("This test checks the SVGAnimatedNumber API - utilizing the surfaceS cale property of SVGFESpecularLightingElement"); 1 description("This test checks the SVGAnimatedNumber API - utilizing the surfaceS cale property of SVGFESpecularLightingElement");
2 2
3 var feSpecularLightingElement = document.createElementNS("http://www.w3.org/2000 /svg", "feSpecularLighting"); 3 var feSpecularLightingElement = document.createElementNS("http://www.w3.org/2000 /svg", "feSpecularLighting");
4 4
5 debug(""); 5 debug("");
6 debug("Check initial surfaceScale value"); 6 debug("Check initial surfaceScale value");
7 shouldBeEqualToString("feSpecularLightingElement.surfaceScale.toString()", "[obj ect SVGAnimatedNumber]"); 7 shouldBeEqualToString("feSpecularLightingElement.surfaceScale.toString()", "[obj ect SVGAnimatedNumber]");
8 shouldBeEqualToString("typeof(feSpecularLightingElement.surfaceScale.baseVal)", "number"); 8 shouldBeEqualToString("typeof(feSpecularLightingElement.surfaceScale.baseVal)", "number");
9 shouldBe("feSpecularLightingElement.surfaceScale.baseVal", "1"); 9 shouldBe("feSpecularLightingElement.surfaceScale.baseVal", "1");
10 10
11 debug(""); 11 debug("");
12 debug("Check that integers are static, caching value in a local variable and mod ifying it, should have no effect"); 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; 13 var numRef = feSpecularLightingElement.surfaceScale.baseVal;
14 numRef = 100; 14 numRef = 100;
15 shouldBe("numRef", "100"); 15 shouldBe("numRef", "100");
16 shouldBe("feSpecularLightingElement.surfaceScale.baseVal", "1"); 16 shouldBe("feSpecularLightingElement.surfaceScale.baseVal", "1");
17 17
18 debug(""); 18 debug("");
19 debug("Check assigning various valid and invalid values"); 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) 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"); 21 shouldBe("feSpecularLightingElement.surfaceScale.baseVal = 300", "300");
22 // ECMA-262, 9.3, "ToNumber" 22 // ECMA-262, 9.3, "ToNumber"
23 shouldBe("feSpecularLightingElement.surfaceScale.baseVal = 'aString'", "'aString '"); 23 shouldThrow("feSpecularLightingElement.surfaceScale.baseVal = 'aString'");
24 shouldBe("feSpecularLightingElement.surfaceScale.baseVal", "NaN"); 24 shouldBe("feSpecularLightingElement.surfaceScale.baseVal", "300");
25 shouldBe("feSpecularLightingElement.surfaceScale.baseVal = 0", "0"); 25 shouldBe("feSpecularLightingElement.surfaceScale.baseVal = 0", "0");
26 shouldBe("feSpecularLightingElement.surfaceScale.baseVal = feSpecularLightingEle ment", "feSpecularLightingElement"); 26 shouldThrow("feSpecularLightingElement.surfaceScale.baseVal = NaN");
27 shouldBe("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");
28 shouldBe("feSpecularLightingElement.surfaceScale.baseVal = 300", "300"); 32 shouldBe("feSpecularLightingElement.surfaceScale.baseVal = 300", "300");
29 33
30 debug(""); 34 debug("");
31 debug("Check that the surfaceScale value remained 300"); 35 debug("Check that the surfaceScale value remained 300");
32 shouldBe("feSpecularLightingElement.surfaceScale.baseVal", "300"); 36 shouldBe("feSpecularLightingElement.surfaceScale.baseVal", "300");
33 37
34 successfullyParsed = true; 38 successfullyParsed = true;
OLDNEW
« no previous file with comments | « LayoutTests/svg/dom/script-tests/SVGAngle.js ('k') | LayoutTests/svg/dom/script-tests/SVGLength.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698