Index: third_party/WebKit/LayoutTests/svg/animations/script-tests/animate-path-to-animation.js |
diff --git a/third_party/WebKit/LayoutTests/svg/animations/script-tests/animate-path-to-animation.js b/third_party/WebKit/LayoutTests/svg/animations/script-tests/animate-path-to-animation.js |
index fe901962b8565f365b97cbe2bfd1429a3f0a6fc9..235cecb058b7de222aba5dd45ddbcd1f03db4112 100644 |
--- a/third_party/WebKit/LayoutTests/svg/animations/script-tests/animate-path-to-animation.js |
+++ b/third_party/WebKit/LayoutTests/svg/animations/script-tests/animate-path-to-animation.js |
@@ -4,7 +4,7 @@ createSVGTestCase(); |
// Setup test document |
var path = createSVGElement("path"); |
path.setAttribute("id", "path"); |
-path.setAttribute("d", "M 40 40 L 60 40 L 60 60 L 40 60 z"); |
+path.setAttribute("d", "M 40 40 L 60 40 L 60 60 L 40 60 Z"); |
path.setAttribute("fill", "green"); |
path.setAttribute("onclick", "executeTest()"); |
@@ -18,76 +18,17 @@ path.appendChild(animate); |
rootSVGElement.appendChild(path); |
// Setup animation test |
-function checkBaseVal() { |
- shouldBe("path.pathSegList.numberOfItems", "5"); |
- shouldBeEqualToString("path.pathSegList.getItem(0).pathSegTypeAsLetter", "M"); |
- shouldBe("path.pathSegList.getItem(0).x", "40"); |
- shouldBe("path.pathSegList.getItem(0).y", "40"); |
- shouldBeEqualToString("path.pathSegList.getItem(1).pathSegTypeAsLetter", "L"); |
- shouldBe("path.pathSegList.getItem(1).x", "60"); |
- shouldBe("path.pathSegList.getItem(1).y", "40"); |
- shouldBeEqualToString("path.pathSegList.getItem(2).pathSegTypeAsLetter", "L"); |
- shouldBe("path.pathSegList.getItem(2).x", "60"); |
- shouldBe("path.pathSegList.getItem(2).y", "60"); |
- shouldBeEqualToString("path.pathSegList.getItem(3).pathSegTypeAsLetter", "L"); |
- shouldBe("path.pathSegList.getItem(3).x", "40"); |
- shouldBe("path.pathSegList.getItem(3).y", "60"); |
- shouldBeEqualToString("path.pathSegList.getItem(4).pathSegTypeAsLetter", "Z"); |
-} |
- |
function sample1() { |
// Check initial/end conditions |
- shouldBe("path.animatedPathSegList.numberOfItems", "5"); |
- shouldBeEqualToString("path.animatedPathSegList.getItem(0).pathSegTypeAsLetter", "M"); |
- shouldBeCloseEnough("path.animatedPathSegList.getItem(0).x", "40"); |
- shouldBeCloseEnough("path.animatedPathSegList.getItem(0).y", "40"); |
- shouldBeEqualToString("path.animatedPathSegList.getItem(1).pathSegTypeAsLetter", "L"); |
- shouldBeCloseEnough("path.animatedPathSegList.getItem(1).x", "60"); |
- shouldBeCloseEnough("path.animatedPathSegList.getItem(1).y", "40"); |
- shouldBeEqualToString("path.animatedPathSegList.getItem(2).pathSegTypeAsLetter", "L"); |
- shouldBeCloseEnough("path.animatedPathSegList.getItem(2).x", "60"); |
- shouldBeCloseEnough("path.animatedPathSegList.getItem(2).y", "60"); |
- shouldBeEqualToString("path.animatedPathSegList.getItem(3).pathSegTypeAsLetter", "L"); |
- shouldBeCloseEnough("path.animatedPathSegList.getItem(3).x", "40"); |
- shouldBeCloseEnough("path.animatedPathSegList.getItem(3).y", "60"); |
- shouldBeEqualToString("path.animatedPathSegList.getItem(4).pathSegTypeAsLetter", "Z"); |
- checkBaseVal(); |
+ shouldBeEqualToString("path.getAttribute('d')", "M 40 40 L 60 40 L 60 60 L 40 60 Z"); |
} |
function sample2() { |
- shouldBe("path.animatedPathSegList.numberOfItems", "5"); |
- shouldBeEqualToString("path.animatedPathSegList.getItem(0).pathSegTypeAsLetter", "M"); |
- shouldBeCloseEnough("path.animatedPathSegList.getItem(0).x", "20"); |
- shouldBeCloseEnough("path.animatedPathSegList.getItem(0).y", "20"); |
- shouldBeEqualToString("path.animatedPathSegList.getItem(1).pathSegTypeAsLetter", "L"); |
- shouldBeCloseEnough("path.animatedPathSegList.getItem(1).x", "80"); |
- shouldBeCloseEnough("path.animatedPathSegList.getItem(1).y", "20"); |
- shouldBeEqualToString("path.animatedPathSegList.getItem(2).pathSegTypeAsLetter", "L"); |
- shouldBeCloseEnough("path.animatedPathSegList.getItem(2).x", "80"); |
- shouldBeCloseEnough("path.animatedPathSegList.getItem(2).y", "80"); |
- shouldBeEqualToString("path.animatedPathSegList.getItem(3).pathSegTypeAsLetter", "L"); |
- shouldBeCloseEnough("path.animatedPathSegList.getItem(3).x", "20"); |
- shouldBeCloseEnough("path.animatedPathSegList.getItem(3).y", "80"); |
- shouldBeEqualToString("path.animatedPathSegList.getItem(4).pathSegTypeAsLetter", "Z"); |
- checkBaseVal(); |
+ shouldBeEqualToString("path.getAttribute('d')", "M 20 20 L 80 20 L 80 80 L 20 80 Z"); |
} |
function sample3() { |
- shouldBe("path.animatedPathSegList.numberOfItems", "5"); |
- shouldBeEqualToString("path.animatedPathSegList.getItem(0).pathSegTypeAsLetter", "M"); |
- shouldBeCloseEnough("path.animatedPathSegList.getItem(0).x", "0"); |
- shouldBeCloseEnough("path.animatedPathSegList.getItem(0).y", "0"); |
- shouldBeEqualToString("path.animatedPathSegList.getItem(1).pathSegTypeAsLetter", "L"); |
- shouldBeCloseEnough("path.animatedPathSegList.getItem(1).x", "100"); |
- shouldBeCloseEnough("path.animatedPathSegList.getItem(1).y", "0"); |
- shouldBeEqualToString("path.animatedPathSegList.getItem(2).pathSegTypeAsLetter", "L"); |
- shouldBeCloseEnough("path.animatedPathSegList.getItem(2).x", "100"); |
- shouldBeCloseEnough("path.animatedPathSegList.getItem(2).y", "100"); |
- shouldBeEqualToString("path.animatedPathSegList.getItem(3).pathSegTypeAsLetter", "L"); |
- shouldBeCloseEnough("path.animatedPathSegList.getItem(3).x", "0"); |
- shouldBeCloseEnough("path.animatedPathSegList.getItem(3).y", "100"); |
- shouldBeEqualToString("path.animatedPathSegList.getItem(4).pathSegTypeAsLetter", "Z"); |
- checkBaseVal(); |
+ shouldBeEqualToString("path.getAttribute('d')", "M 0.00999928 0.00999928 L 99.99 0.00999928 L 99.99 99.99 L 0.00999928 99.99 Z"); |
} |
function executeTest() { |