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

Unified Diff: third_party/WebKit/LayoutTests/svg/animations/script-tests/animate-path-animation-Ll-Vv-Hh.js

Issue 1417593003: Use getAttribute in path animation tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
Index: third_party/WebKit/LayoutTests/svg/animations/script-tests/animate-path-animation-Ll-Vv-Hh.js
diff --git a/third_party/WebKit/LayoutTests/svg/animations/script-tests/animate-path-animation-Ll-Vv-Hh.js b/third_party/WebKit/LayoutTests/svg/animations/script-tests/animate-path-animation-Ll-Vv-Hh.js
index 641a4bc78cf30ea8462b29a87916fd16e1a0af7f..c68e4cdad33c00795a79395d4da4a08803c08dd0 100644
--- a/third_party/WebKit/LayoutTests/svg/animations/script-tests/animate-path-animation-Ll-Vv-Hh.js
+++ b/third_party/WebKit/LayoutTests/svg/animations/script-tests/animate-path-animation-Ll-Vv-Hh.js
@@ -20,84 +20,21 @@ 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", "-30");
- shouldBe("path.pathSegList.getItem(0).y", "-30");
- shouldBeEqualToString("path.pathSegList.getItem(1).pathSegTypeAsLetter", "L");
- shouldBe("path.pathSegList.getItem(1).x", "30");
- shouldBe("path.pathSegList.getItem(1).y", "0");
- shouldBeEqualToString("path.pathSegList.getItem(2).pathSegTypeAsLetter", "V");
- shouldBe("path.pathSegList.getItem(2).y", "30");
- shouldBeEqualToString("path.pathSegList.getItem(3).pathSegTypeAsLetter", "H");
- shouldBe("path.pathSegList.getItem(3).x", "0");
- 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", "-30");
- shouldBeCloseEnough("path.animatedPathSegList.getItem(0).y", "-30");
- shouldBeEqualToString("path.animatedPathSegList.getItem(1).pathSegTypeAsLetter", "L");
- shouldBeCloseEnough("path.animatedPathSegList.getItem(1).x", "30");
- shouldBeCloseEnough("path.animatedPathSegList.getItem(1).y", "0");
- shouldBeEqualToString("path.animatedPathSegList.getItem(2).pathSegTypeAsLetter", "V");
- shouldBeCloseEnough("path.animatedPathSegList.getItem(2).y", "30");
- shouldBeEqualToString("path.animatedPathSegList.getItem(3).pathSegTypeAsLetter", "H");
- shouldBeCloseEnough("path.animatedPathSegList.getItem(3).x", "0");
- shouldBeEqualToString("path.animatedPathSegList.getItem(4).pathSegTypeAsLetter", "Z");
- checkBaseVal();
+ shouldBeEqualToString("path.getAttribute('d')", "M -30 -30 L 30 0 V 30 H 0 Z");
}
function sample2() {
- shouldBe("path.animatedPathSegList.numberOfItems", "5");
- shouldBeEqualToString("path.animatedPathSegList.getItem(0).pathSegTypeAsLetter", "M");
- shouldBeCloseEnough("path.animatedPathSegList.getItem(0).x", "-15");
- shouldBeCloseEnough("path.animatedPathSegList.getItem(0).y", "-15");
- shouldBeEqualToString("path.animatedPathSegList.getItem(1).pathSegTypeAsLetter", "L");
- shouldBeCloseEnough("path.animatedPathSegList.getItem(1).x", "15");
- shouldBeCloseEnough("path.animatedPathSegList.getItem(1).y", "0");
- shouldBeEqualToString("path.animatedPathSegList.getItem(2).pathSegTypeAsLetter", "V");
- shouldBeCloseEnough("path.animatedPathSegList.getItem(2).y", "15");
- shouldBeEqualToString("path.animatedPathSegList.getItem(3).pathSegTypeAsLetter", "H");
- shouldBeCloseEnough("path.animatedPathSegList.getItem(3).x", "0");
- shouldBeEqualToString("path.animatedPathSegList.getItem(4).pathSegTypeAsLetter", "Z");
- checkBaseVal();
+ shouldBeEqualToString("path.getAttribute('d')", "M -15 -15 L 15 0 V 15 H 0 Z");
}
function sample3() {
- shouldBe("path.animatedPathSegList.numberOfItems", "5");
- shouldBeEqualToString("path.animatedPathSegList.getItem(0).pathSegTypeAsLetter", "M");
- shouldBeCloseEnough("path.animatedPathSegList.getItem(0).x", "15");
- shouldBeCloseEnough("path.animatedPathSegList.getItem(0).y", "15");
- shouldBeEqualToString("path.animatedPathSegList.getItem(1).pathSegTypeAsLetter", "l");
- shouldBeCloseEnough("path.animatedPathSegList.getItem(1).x", "-30");
- shouldBeCloseEnough("path.animatedPathSegList.getItem(1).y", "-15");
- shouldBeEqualToString("path.animatedPathSegList.getItem(2).pathSegTypeAsLetter", "v");
- shouldBeCloseEnough("path.animatedPathSegList.getItem(2).y", "-15");
- shouldBeEqualToString("path.animatedPathSegList.getItem(3).pathSegTypeAsLetter", "h");
- shouldBeCloseEnough("path.animatedPathSegList.getItem(3).x", "15");
- shouldBeEqualToString("path.animatedPathSegList.getItem(4).pathSegTypeAsLetter", "Z");
- checkBaseVal();
+ shouldBeEqualToString("path.getAttribute('d')", "M 15 15 l -30 -15 v -15 h 15 Z");
}
function sample4() {
- shouldBe("path.animatedPathSegList.numberOfItems", "5");
- shouldBeEqualToString("path.animatedPathSegList.getItem(0).pathSegTypeAsLetter", "M");
- shouldBeCloseEnough("path.animatedPathSegList.getItem(0).x", "30");
- shouldBeCloseEnough("path.animatedPathSegList.getItem(0).y", "30");
- shouldBeEqualToString("path.animatedPathSegList.getItem(1).pathSegTypeAsLetter", "l");
- shouldBeCloseEnough("path.animatedPathSegList.getItem(1).x", "-60");
- shouldBeCloseEnough("path.animatedPathSegList.getItem(1).y", "-30");
- shouldBeEqualToString("path.animatedPathSegList.getItem(2).pathSegTypeAsLetter", "v");
- shouldBeCloseEnough("path.animatedPathSegList.getItem(2).y", "-30");
- shouldBeEqualToString("path.animatedPathSegList.getItem(3).pathSegTypeAsLetter", "h");
- shouldBeCloseEnough("path.animatedPathSegList.getItem(3).x", "30");
- shouldBeEqualToString("path.animatedPathSegList.getItem(4).pathSegTypeAsLetter", "Z");
- checkBaseVal();
+ shouldBeEqualToString("path.getAttribute('d')", "M 29.985 29.985 l -59.97 -29.985 v -29.985 h 29.985 Z");
}
function executeTest() {

Powered by Google App Engine
This is Rietveld 408576698