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

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

Issue 1321783002: Throw exceptions for charnum == getNumberOfChars in get{...}OfChar APIs (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/svg/text/svgtextcontentelement-methods-parameters-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/svg/text/svgtextcontentelement-methods-parameters.html
diff --git a/LayoutTests/svg/text/svgtextcontentelement-methods-parameters.html b/LayoutTests/svg/text/svgtextcontentelement-methods-parameters.html
index 3cbb2df5104e37bf051e9b3ca06dfc1a6452cb06..ea7ac89ad7ae7be421ef0b80303293031860db9f 100644
--- a/LayoutTests/svg/text/svgtextcontentelement-methods-parameters.html
+++ b/LayoutTests/svg/text/svgtextcontentelement-methods-parameters.html
@@ -19,6 +19,9 @@ svgText.style.fontSize = "20px";
svgText.appendChild(document.createTextNode("abcdefg"));
svgRoot.appendChild(svgText);
+var emptySvgText = document.createElementNS(svgNS, "text");
+svgRoot.appendChild(emptySvgText);
+
var actualTestPoint, expectedTestPoint;
function shouldBeEqualToSVGPoint(actualPoint, expectedPoint)
{
@@ -59,6 +62,20 @@ shouldThrow("svgText.getEndPositionOfChar(999)", '"IndexSizeError: Failed to exe
shouldThrow("svgText.getExtentOfChar(999)", '"IndexSizeError: Failed to execute \'getExtentOfChar\' on \'SVGTextContentElement\': The charnum provided (999) is greater than the maximum bound (7)."');
shouldThrow("svgText.getRotationOfChar(999)", '"IndexSizeError: Failed to execute \'getRotationOfChar\' on \'SVGTextContentElement\': The charnum provided (999) is greater than the maximum bound (7)."');
shouldThrow("svgText.selectSubString(999, 2)", '"IndexSizeError: Failed to execute \'selectSubString\' on \'SVGTextContentElement\': The charnum provided (999) is greater than the maximum bound (7)."');
+// Test the equality part of the restriction.
+shouldThrow("svgText.getSubStringLength(7, 2)", '"IndexSizeError: Failed to execute \'getSubStringLength\' on \'SVGTextContentElement\': The charnum provided (7) is greater than or equal to the maximum bound (7)."');
+shouldThrow("svgText.getStartPositionOfChar(7)", '"IndexSizeError: Failed to execute \'getStartPositionOfChar\' on \'SVGTextContentElement\': The charnum provided (7) is greater than or equal to the maximum bound (7)."');
+shouldThrow("svgText.getEndPositionOfChar(7)", '"IndexSizeError: Failed to execute \'getEndPositionOfChar\' on \'SVGTextContentElement\': The charnum provided (7) is greater than or equal to the maximum bound (7)."');
+shouldThrow("svgText.getExtentOfChar(7)", '"IndexSizeError: Failed to execute \'getExtentOfChar\' on \'SVGTextContentElement\': The charnum provided (7) is greater than or equal to the maximum bound (7)."');
+shouldThrow("svgText.getRotationOfChar(7)", '"IndexSizeError: Failed to execute \'getRotationOfChar\' on \'SVGTextContentElement\': The charnum provided (7) is greater than or equal to the maximum bound (7)."');
+shouldThrow("svgText.selectSubString(7, 2)", '"IndexSizeError: Failed to execute \'selectSubString\' on \'SVGTextContentElement\': The charnum provided (7) is greater than or equal to the maximum bound (7)."');
+// Test the equality part of the restriction for the <number of chars> == 0 case.
+shouldThrow("emptySvgText.getSubStringLength(0, 2)", '"IndexSizeError: Failed to execute \'getSubStringLength\' on \'SVGTextContentElement\': The charnum provided (0) is greater than or equal to the maximum bound (0)."');
+shouldThrow("emptySvgText.getStartPositionOfChar(0)", '"IndexSizeError: Failed to execute \'getStartPositionOfChar\' on \'SVGTextContentElement\': The charnum provided (0) is greater than or equal to the maximum bound (0)."');
+shouldThrow("emptySvgText.getEndPositionOfChar(0)", '"IndexSizeError: Failed to execute \'getEndPositionOfChar\' on \'SVGTextContentElement\': The charnum provided (0) is greater than or equal to the maximum bound (0)."');
+shouldThrow("emptySvgText.getExtentOfChar(0)", '"IndexSizeError: Failed to execute \'getExtentOfChar\' on \'SVGTextContentElement\': The charnum provided (0) is greater than or equal to the maximum bound (0)."');
+shouldThrow("emptySvgText.getRotationOfChar(0)", '"IndexSizeError: Failed to execute \'getRotationOfChar\' on \'SVGTextContentElement\': The charnum provided (0) is greater than or equal to the maximum bound (0)."');
+shouldThrow("emptySvgText.selectSubString(0, 2)", '"IndexSizeError: Failed to execute \'selectSubString\' on \'SVGTextContentElement\': The charnum provided (0) is greater than or equal to the maximum bound (0)."');
// Should not throw if charnum is negative and wraps to a valid positive index (-4294967294 wraps to 2).
shouldBe("svgText.getSubStringLength(-4294967294, 2)", "svgText.getSubStringLength(2, 2)");
« no previous file with comments | « no previous file | LayoutTests/svg/text/svgtextcontentelement-methods-parameters-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698