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

Side by Side Diff: LayoutTests/svg/text/svgtextcontentelement-methods-parameters.html

Issue 24203002: Improve generated "Not enough arguments." TypeError exceptions. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: NeedsRebaseline Created 7 years, 3 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 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <link rel="help" href="http://www.w3.org/TR/SVG2/text.html#InterfaceSVGTextConte ntElement"> 4 <link rel="help" href="http://www.w3.org/TR/SVG2/text.html#InterfaceSVGTextConte ntElement">
5 <script src="../../fast/js/resources/js-test-pre.js"></script> 5 <script src="../../fast/js/resources/js-test-pre.js"></script>
6 </head> 6 </head>
7 <body> 7 <body>
8 <script> 8 <script>
9 description("Check that SVGTextContentElement methods' parameters are correctly validated"); 9 description("Check that SVGTextContentElement methods' parameters are correctly validated");
10 10
(...skipping 22 matching lines...) Expand all
33 { 33 {
34 actualTestRect = actualRect; 34 actualTestRect = actualRect;
35 expectedTestRect = expectedRect; 35 expectedTestRect = expectedRect;
36 shouldBe("actualTestRect.x", "expectedTestRect.x"); 36 shouldBe("actualTestRect.x", "expectedTestRect.x");
37 shouldBe("actualTestRect.y", "expectedTestRect.y"); 37 shouldBe("actualTestRect.y", "expectedTestRect.y");
38 shouldBe("actualTestRect.width", "expectedTestRect.width"); 38 shouldBe("actualTestRect.width", "expectedTestRect.width");
39 shouldBe("actualTestRect.height", "expectedTestRect.height"); 39 shouldBe("actualTestRect.height", "expectedTestRect.height");
40 } 40 }
41 41
42 // Arguments should be mandatory. 42 // Arguments should be mandatory.
43 shouldThrow("svgText.getSubStringLength()", "'TypeError: Not enough arguments'") ; 43 shouldThrow("svgText.getSubStringLength()", '"TypeError: Failed to execute \'get SubStringLength\' on \'SVGTextContentElement\': 2 arguments required, but only 0 present."');
44 shouldThrow("svgText.getSubStringLength(2)", "'TypeError: Not enough arguments'" ); 44 shouldThrow("svgText.getSubStringLength(2)", '"TypeError: Failed to execute \'ge tSubStringLength\' on \'SVGTextContentElement\': 2 arguments required, but only 1 present."');
45 shouldThrow("svgText.getStartPositionOfChar()", "'TypeError: Not enough argument s'"); 45 shouldThrow("svgText.getStartPositionOfChar()", '"TypeError: Failed to execute \ 'getStartPositionOfChar\' on \'SVGTextContentElement\': 1 argument required, but only 0 present."');
46 shouldThrow("svgText.getEndPositionOfChar()", "'TypeError: Not enough arguments' "); 46 shouldThrow("svgText.getEndPositionOfChar()", '"TypeError: Failed to execute \'g etEndPositionOfChar\' on \'SVGTextContentElement\': 1 argument required, but onl y 0 present."');
47 shouldThrow("svgText.getExtentOfChar()", "'TypeError: Not enough arguments'"); 47 shouldThrow("svgText.getExtentOfChar()", '"TypeError: Failed to execute \'getExt entOfChar\' on \'SVGTextContentElement\': 1 argument required, but only 0 presen t."');
48 shouldThrow("svgText.getRotationOfChar()", "'TypeError: Not enough arguments'"); 48 shouldThrow("svgText.getRotationOfChar()", '"TypeError: Failed to execute \'getR otationOfChar\' on \'SVGTextContentElement\': 1 argument required, but only 0 pr esent."');
49 shouldThrow("svgText.getCharNumAtPosition()", "'TypeError: Not enough arguments' "); 49 shouldThrow("svgText.getCharNumAtPosition()", '"TypeError: Failed to execute \'g etCharNumAtPosition\' on \'SVGTextContentElement\': 1 argument required, but onl y 0 present."');
50 shouldThrow("svgText.selectSubString()", "'TypeError: Not enough arguments'"); 50 shouldThrow("svgText.selectSubString()", '"TypeError: Failed to execute \'select SubString\' on \'SVGTextContentElement\': 2 arguments required, but only 0 prese nt."');
51 shouldThrow("svgText.selectSubString(2)", "'TypeError: Not enough arguments'"); 51 shouldThrow("svgText.selectSubString(2)", '"TypeError: Failed to execute \'selec tSubString\' on \'SVGTextContentElement\': 2 arguments required, but only 1 pres ent."');
52 52
53 // Should throw an IndexSizeError if charnum is greater than or equal to the num ber of characters at this node. 53 // Should throw an IndexSizeError if charnum is greater than or equal to the num ber of characters at this node.
54 shouldThrow("svgText.getSubStringLength(999, 2)", "'IndexSizeError: Index or siz e was negative, or greater than the allowed value.'"); 54 shouldThrow("svgText.getSubStringLength(999, 2)", "'IndexSizeError: Index or siz e was negative, or greater than the allowed value.'");
55 shouldThrow("svgText.getStartPositionOfChar(999)", "'IndexSizeError: Index or si ze was negative, or greater than the allowed value.'"); 55 shouldThrow("svgText.getStartPositionOfChar(999)", "'IndexSizeError: Index or si ze was negative, or greater than the allowed value.'");
56 shouldThrow("svgText.getEndPositionOfChar(999)", "'IndexSizeError: Index or size was negative, or greater than the allowed value.'"); 56 shouldThrow("svgText.getEndPositionOfChar(999)", "'IndexSizeError: Index or size was negative, or greater than the allowed value.'");
57 shouldThrow("svgText.getExtentOfChar(999)", "'IndexSizeError: Index or size was negative, or greater than the allowed value.'"); 57 shouldThrow("svgText.getExtentOfChar(999)", "'IndexSizeError: Index or size was negative, or greater than the allowed value.'");
58 shouldThrow("svgText.getRotationOfChar(999)", "'IndexSizeError: Index or size wa s negative, or greater than the allowed value.'"); 58 shouldThrow("svgText.getRotationOfChar(999)", "'IndexSizeError: Index or size wa s negative, or greater than the allowed value.'");
59 shouldThrow("svgText.selectSubString(999, 2)", "'IndexSizeError: Index or size w as negative, or greater than the allowed value.'"); 59 shouldThrow("svgText.selectSubString(999, 2)", "'IndexSizeError: Index or size w as negative, or greater than the allowed value.'");
60 60
61 // Should not throw if charnum is negative and wraps to a valid positive index ( -4294967294 wraps to 2). 61 // Should not throw if charnum is negative and wraps to a valid positive index ( -4294967294 wraps to 2).
(...skipping 19 matching lines...) Expand all
81 shouldBe("svgText.getSubStringLength(2, -1)", "svgText.getSubStringLength(2, 5)" ); 81 shouldBe("svgText.getSubStringLength(2, -1)", "svgText.getSubStringLength(2, 5)" );
82 shouldBe("svgText.getSubStringLength(2, 2)", "svgText.getSubStringLength(2, -429 4967294)"); 82 shouldBe("svgText.getSubStringLength(2, 2)", "svgText.getSubStringLength(2, -429 4967294)");
83 shouldNotThrow("svgText.selectSubString(2, 999)"); 83 shouldNotThrow("svgText.selectSubString(2, 999)");
84 shouldNotThrow("svgText.selectSubString(2, -1)"); 84 shouldNotThrow("svgText.selectSubString(2, -1)");
85 shouldNotThrow("svgText.selectSubString(2, -4294967294)"); 85 shouldNotThrow("svgText.selectSubString(2, -4294967294)");
86 86
87 </script> 87 </script>
88 <script src="../../fast/js/resources/js-test-post.js"></script> 88 <script src="../../fast/js/resources/js-test-post.js"></script>
89 </body> 89 </body>
90 </html> 90 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698