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

Side by Side Diff: LayoutTests/svg/custom/script-tests/getSubStringLength.js

Issue 22798002: Make SVGTextContentElement methods behave consistently with Firefox and IE (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix nits Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 var svgNS = "http://www.w3.org/2000/svg"; 1 var svgNS = "http://www.w3.org/2000/svg";
2 2
3 var svgRoot = document.createElementNS(svgNS, "svg"); 3 var svgRoot = document.createElementNS(svgNS, "svg");
4 document.documentElement.appendChild(svgRoot); 4 document.documentElement.appendChild(svgRoot);
5 5
6 var svgText = document.createElementNS(svgNS, "text"); 6 var svgText = document.createElementNS(svgNS, "text");
7 svgText.style.fontFamily = "Ahem"; 7 svgText.style.fontFamily = "Ahem";
8 svgText.style.fontSize = "20px"; 8 svgText.style.fontSize = "20px";
9 svgText.appendChild(document.createTextNode("abc")); 9 svgText.appendChild(document.createTextNode("abc"));
10 svgRoot.appendChild(svgText); 10 svgRoot.appendChild(svgText);
11 11
12 shouldThrow("svgText.getSubStringLength(-1, 2)"); 12 shouldThrow("svgText.getSubStringLength(-1, 2)");
13 shouldThrow("svgText.getSubStringLength(-1, 0)"); 13 shouldThrow("svgText.getSubStringLength(-1, 0)");
14 shouldBe("svgText.getSubStringLength(1, 3)", "40"); 14 shouldBe("svgText.getSubStringLength(1, 3)", "40");
15 shouldBe("svgText.getSubStringLength(0, 4)", "60"); 15 shouldBe("svgText.getSubStringLength(0, 4)", "60");
16 shouldThrow("svgText.getSubStringLength(3, 0)"); 16 shouldThrow("svgText.getSubStringLength(3, 0)");
17 17
18 shouldBe("svgText.getSubStringLength(0, 0)", "0"); 18 shouldBe("svgText.getSubStringLength(0, 0)", "0");
19 shouldBe("svgText.getSubStringLength(2, 0)", "0"); 19 shouldBe("svgText.getSubStringLength(2, 0)", "0");
20 20
21 shouldBe("svgText.getSubStringLength(0, 1)", "20"); 21 shouldBe("svgText.getSubStringLength(0, 1)", "20");
22 shouldBe("svgText.getSubStringLength(1, 1)", "20"); 22 shouldBe("svgText.getSubStringLength(1, 1)", "20");
23 shouldBe("svgText.getSubStringLength(2, 1)", "20"); 23 shouldBe("svgText.getSubStringLength(2, 1)", "20");
24 shouldBe("svgText.getSubStringLength(0, 3)", "60"); 24 shouldBe("svgText.getSubStringLength(0, 3)", "60");
25 25
26 shouldThrow("svgText.getSubStringLength(1, -1)"); 26 shouldNotThrow("svgText.getSubStringLength(1, -1)");
27 shouldThrow("svgText.getSubStringLength(2, -1)"); 27 shouldNotThrow("svgText.getSubStringLength(2, -1)");
28 shouldThrow("svgText.getSubStringLength(3, -1)"); 28 shouldThrow("svgText.getSubStringLength(3, -1)", "'IndexSizeError: Index or size was negative, or greater than the allowed value.'");
29 shouldThrow("svgText.getSubStringLength(3, -3)"); 29 shouldThrow("svgText.getSubStringLength(3, -3)", "'IndexSizeError: Index or size was negative, or greater than the allowed value.'");
30 30
31 // cleanup 31 // cleanup
32 document.documentElement.removeChild(svgRoot); 32 document.documentElement.removeChild(svgRoot);
33 33
34 var successfullyParsed = true; 34 var successfullyParsed = true;
OLDNEW
« no previous file with comments | « LayoutTests/svg/custom/getSubStringLength-expected.txt ('k') | LayoutTests/svg/custom/script-tests/selectSubString.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698