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

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

Issue 2705293005: Convert LayoutTests/svg/dom/SVGAnimated*.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
OLDNEW
(Empty)
1 description("This test checks the SVGAnimatedPreserveAspectRatio API - utilizing the preserveAspectRatio property of SVGSVGElement");
2
3 var svgElement = document.createElementNS("http://www.w3.org/2000/svg", "svg");
4
5 debug("");
6 debug("Check initial preserveAspectRatio value");
7 shouldBeEqualToString("svgElement.preserveAspectRatio.toString()", "[object SVGA nimatedPreserveAspectRatio]");
8 shouldBeEqualToString("svgElement.preserveAspectRatio.baseVal.toString()", "[obj ect SVGPreserveAspectRatio]");
9 shouldBe("svgElement.preserveAspectRatio.baseVal.align", "SVGPreserveAspectRatio .SVG_PRESERVEASPECTRATIO_XMIDYMID");
10 shouldBe("svgElement.preserveAspectRatio.baseVal.meetOrSlice", "SVGPreserveAspec tRatio.SVG_MEETORSLICE_MEET");
11
12 debug("");
13 debug("Check that preserveAspectRatios are dynamic, caching value in a local var iable and modifying it, should take effect");
14 var aspectRef = svgElement.preserveAspectRatio.baseVal;
15 aspectRef.align = SVGPreserveAspectRatio.SVG_PRESERVEASPECTRATIO_XMAXYMIN;
16 aspectRef.meetOrSlice = SVGPreserveAspectRatio.SVG_MEETORSLICE_SLICE;
17 shouldBe("aspectRef.align", "SVGPreserveAspectRatio.SVG_PRESERVEASPECTRATIO_XMAX YMIN");
18 shouldBe("aspectRef.meetOrSlice", "SVGPreserveAspectRatio.SVG_MEETORSLICE_SLICE" );
19 shouldBe("svgElement.preserveAspectRatio.baseVal.align", "SVGPreserveAspectRatio .SVG_PRESERVEASPECTRATIO_XMAXYMIN");
20 shouldBe("svgElement.preserveAspectRatio.baseVal.meetOrSlice", "SVGPreserveAspec tRatio.SVG_MEETORSLICE_SLICE");
21
22 debug("");
23 debug("Check that assigning to baseVal has no effect, as no setter is defined");
24 shouldBe("svgElement.preserveAspectRatio.baseVal = -1", "-1");
25 shouldBeEqualToString("svgElement.preserveAspectRatio.baseVal = 'aString'", "aSt ring");
26 shouldBe("svgElement.preserveAspectRatio.baseVal = svgElement", "svgElement");
27
28 debug("");
29 debug("Check that the preserveAspectRatio align/meetOrSlice remained xMaxYMin/sl ice, and the baseVal type has not been changed");
30 shouldBeEqualToString("svgElement.preserveAspectRatio.baseVal.toString()", "[obj ect SVGPreserveAspectRatio]");
31 shouldBe("svgElement.preserveAspectRatio.baseVal.align", "SVGPreserveAspectRatio .SVG_PRESERVEASPECTRATIO_XMAXYMIN");
32 shouldBe("svgElement.preserveAspectRatio.baseVal.meetOrSlice", "SVGPreserveAspec tRatio.SVG_MEETORSLICE_SLICE");
33
34 successfullyParsed = true;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698