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

Side by Side Diff: third_party/WebKit/LayoutTests/svg/dom/script-tests/SVGPoint.js

Issue 2741153003: Convert LayoutTests/svg/dom/*.html js-tests.js to testharness.js based tests. (Closed)
Patch Set: Align with review comments Created 3 years, 9 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
« no previous file with comments | « third_party/WebKit/LayoutTests/svg/dom/script-tests/SVGNumber.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 description("This test checks the SVGPoint API");
2
3 var svgElement = document.createElementNS("http://www.w3.org/2000/svg", "svg");
4 var point = svgElement.createSVGPoint();
5
6 debug("");
7 debug("Check initial point values");
8 shouldBe("point.x", "0");
9 shouldBe("point.y", "0");
10
11 debug("");
12 debug("Check assigning points");
13 shouldBe("point.x = 100", "100");
14 shouldBe("point.y = 200", "200");
15
16 debug("");
17 debug("Check assigning invalid points");
18 shouldBe("point.x = point", "point");
19 shouldBeNull("point.y = null");
20
21 debug("");
22 debug("Check that the point contains the correct values");
23 shouldBe("point.x", "NaN");
24 shouldBe("point.y", "0");
25
26 debug("");
27 debug("Reset to -50, 100");
28 point.x = -50;
29 point.y = 100;
30
31 debug("");
32 debug("Check 'matrixTransform' method - multiply with -1,0,0,2,10,10 matrix, sho uld flip x coordinate, multiply y by two and translate each coordinate by 10");
33 var ctm = svgElement.createSVGMatrix();
34 ctm.a = -1;
35 ctm.d = 2;
36 ctm.e = 10;
37 ctm.f = 10;
38 shouldBeEqualToString("(newPoint = point.matrixTransform(ctm)).toString()", "[ob ject SVGPoint]");
39 shouldBe("newPoint.x", "60");
40 shouldBe("newPoint.y", "210");
41
42 debug("");
43 debug("Check invalid arguments for 'matrixTransform'");
44 shouldThrow("point.matrixTransform()");
45 shouldThrow("point.matrixTransform(-1)");
46 shouldThrow("point.matrixTransform(5)");
47 shouldThrow("point.matrixTransform('aString')");
48 shouldThrow("point.matrixTransform(point)");
49 shouldThrow("point.matrixTransform(svgElement)");
50
51 successfullyParsed = true;
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/svg/dom/script-tests/SVGNumber.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698