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

Side by Side Diff: LayoutTests/svg/dynamic-updates/script-tests/SVGMarkerElement-svgdom-setOrientToAngle-call.js

Issue 36843003: Improve remaining TypeErrors in bindings code. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: vibration. 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 | Annotate | Revision Log
OLDNEW
1 // [Name] SVGMarkerElement-svgdom-setOrientToAngle-call.js 1 // [Name] SVGMarkerElement-svgdom-setOrientToAngle-call.js
2 // [Expected rendering result] start & end markers are visible (and not rotated, compared to the other SVGMarkerElement* tests) - and a series of PASS messages 2 // [Expected rendering result] start & end markers are visible (and not rotated, compared to the other SVGMarkerElement* tests) - and a series of PASS messages
3 3
4 description("Tests dynamic updates of the SVGMarkerElement object by using it's 'setOrientToAngle' method") 4 description("Tests dynamic updates of the SVGMarkerElement object by using it's 'setOrientToAngle' method")
5 createSVGTestCase(); 5 createSVGTestCase();
6 6
7 var markerElement = createSVGElement("marker"); 7 var markerElement = createSVGElement("marker");
8 markerElement.setAttribute("id", "marker"); 8 markerElement.setAttribute("id", "marker");
9 markerElement.setAttribute("viewBox", "0 0 10 10"); 9 markerElement.setAttribute("viewBox", "0 0 10 10");
10 markerElement.setAttribute("markerWidth", "2"); 10 markerElement.setAttribute("markerWidth", "2");
(...skipping 17 matching lines...) Expand all
28 pathElement.setAttribute("stroke", "green"); 28 pathElement.setAttribute("stroke", "green");
29 pathElement.setAttribute("stroke-width", "10"); 29 pathElement.setAttribute("stroke-width", "10");
30 pathElement.setAttribute("marker-start", "url(#marker)"); 30 pathElement.setAttribute("marker-start", "url(#marker)");
31 pathElement.setAttribute("marker-end", "url(#marker)"); 31 pathElement.setAttribute("marker-end", "url(#marker)");
32 pathElement.setAttribute("d", "M 130 135 L 180 135 L 180 185"); 32 pathElement.setAttribute("d", "M 130 135 L 180 135 L 180 185");
33 rootSVGElement.appendChild(pathElement); 33 rootSVGElement.appendChild(pathElement);
34 34
35 shouldBe("markerElement.orientType.baseVal", "SVGMarkerElement.SVG_MARKER_ORIENT _AUTO"); 35 shouldBe("markerElement.orientType.baseVal", "SVGMarkerElement.SVG_MARKER_ORIENT _AUTO");
36 shouldBe("markerElement.orientAngle.baseVal.value", "0"); 36 shouldBe("markerElement.orientAngle.baseVal.value", "0");
37 37
38 shouldThrow("markerElement.setOrientToAngle()", "'TypeError: Type error'"); 38 var typeError = '"TypeError: Failed to execute \'setOrientToAngle\' on \'SVGMark erElement\': parameter 1 is not of type \'SVGAngle\'."';
39 shouldThrow("markerElement.setOrientToAngle(true)", "'TypeError: Type error'"); 39 shouldThrow("markerElement.setOrientToAngle()", typeError);
40 shouldThrow("markerElement.setOrientToAngle(2)", "'TypeError: Type error'"); 40 shouldThrow("markerElement.setOrientToAngle(true)", typeError);
41 shouldThrow("markerElement.setOrientToAngle('aString')", "'TypeError: Type error '"); 41 shouldThrow("markerElement.setOrientToAngle(2)", typeError);
42 shouldThrow("markerElement.setOrientToAngle(markerElement)", "'TypeError: Type e rror'"); 42 shouldThrow("markerElement.setOrientToAngle('aString')", typeError);
43 shouldThrow("markerElement.setOrientToAngle(markerElement)", typeError);
43 44
44 function repaintTest() { 45 function repaintTest() {
45 markerElement.setOrientToAngle(rootSVGElement.createSVGAngle()); 46 markerElement.setOrientToAngle(rootSVGElement.createSVGAngle());
46 47
47 shouldBe("markerElement.orientType.baseVal", "SVGMarkerElement.SVG_MARKER_OR IENT_ANGLE"); 48 shouldBe("markerElement.orientType.baseVal", "SVGMarkerElement.SVG_MARKER_OR IENT_ANGLE");
48 shouldBe("markerElement.orientAngle.baseVal.value", "0"); 49 shouldBe("markerElement.orientAngle.baseVal.value", "0");
49 50
50 completeTest(); 51 completeTest();
51 } 52 }
52 53
53 var successfullyParsed = true; 54 var successfullyParsed = true;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698