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

Unified Diff: third_party/WebKit/LayoutTests/svg/animations/script-tests/svgpath-animation-1.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/svgpath-animation-1.js
diff --git a/third_party/WebKit/LayoutTests/svg/animations/script-tests/svgpath-animation-1.js b/third_party/WebKit/LayoutTests/svg/animations/script-tests/svgpath-animation-1.js
index c758f3c20d5e25d954d4286956bc8d07c6422399..dea51b4167d00229c5d41d18093a33f037a4ea1b 100644
--- a/third_party/WebKit/LayoutTests/svg/animations/script-tests/svgpath-animation-1.js
+++ b/third_party/WebKit/LayoutTests/svg/animations/script-tests/svgpath-animation-1.js
@@ -20,84 +20,34 @@ 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() {
- 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", "40");
- shouldBeCloseEnough("path.animatedPathSegList.getItem(0).y", "40");
- shouldBeEqualToString("path.animatedPathSegList.getItem(1).pathSegTypeAsLetter", "L");
- shouldBeCloseEnough("path.animatedPathSegList.getItem(1).x", "110");
- shouldBeCloseEnough("path.animatedPathSegList.getItem(1).y", "40");
- shouldBeEqualToString("path.animatedPathSegList.getItem(2).pathSegTypeAsLetter", "L");
- shouldBeCloseEnough("path.animatedPathSegList.getItem(2).x", "110");
- shouldBeCloseEnough("path.animatedPathSegList.getItem(2).y", "110");
- shouldBeEqualToString("path.animatedPathSegList.getItem(3).pathSegTypeAsLetter", "L");
- shouldBeCloseEnough("path.animatedPathSegList.getItem(3).x", "40");
- shouldBeCloseEnough("path.animatedPathSegList.getItem(3).y", "110");
- shouldBeEqualToString("path.animatedPathSegList.getItem(4).pathSegTypeAsLetter", "Z");
- checkBaseVal();
+ shouldBeEqualToString("path.getAttribute('d')", "M 40 40 L 109.975 40 L 109.975 109.975 L 40 109.975 Z");
}
function sample3() {
- 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", "160");
- shouldBeCloseEnough("path.animatedPathSegList.getItem(1).y", "40");
- shouldBeEqualToString("path.animatedPathSegList.getItem(2).pathSegTypeAsLetter", "L");
- shouldBeCloseEnough("path.animatedPathSegList.getItem(2).x", "160");
- shouldBeCloseEnough("path.animatedPathSegList.getItem(2).y", "160");
- shouldBeEqualToString("path.animatedPathSegList.getItem(3).pathSegTypeAsLetter", "L");
- shouldBeCloseEnough("path.animatedPathSegList.getItem(3).x", "40");
- shouldBeCloseEnough("path.animatedPathSegList.getItem(3).y", "160");
- shouldBeEqualToString("path.animatedPathSegList.getItem(4).pathSegTypeAsLetter", "Z");
- checkBaseVal();
+ shouldBeEqualToString("path.getAttribute('d')", "M 40 40 L 110.025 40 L 110.025 110.025 L 40 110.025 Z");
+}
+
+function sample4() {
+ shouldBeEqualToString("path.getAttribute('d')", "M 40 40 L 159.975 40 L 159.975 159.975 L 40 159.975 Z");
}
+
+function sample5() {
+ shouldBeEqualToString("path.getAttribute('d')", "M 40 40 L 160 40 L 160 160 L 40 160 Z");
+}
+
function executeTest() {
const expectedValues = [
// [animationId, time, sampleCallback]
["animation", 0.0, sample1],
["animation", 1.999, sample2],
- ["animation", 2.001, sample2],
- ["animation", 3.999, sample3],
- ["animation", 4.001, sample3]
+ ["animation", 2.001, sample3],
+ ["animation", 3.999, sample4],
+ ["animation", 4.001, sample5]
];
runAnimationTest(expectedValues);

Powered by Google App Engine
This is Rietveld 408576698