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

Unified Diff: third_party/WebKit/LayoutTests/svg/animations/script-tests/animate-path-animation-Qq-Tt.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-Qq-Tt.js
diff --git a/third_party/WebKit/LayoutTests/svg/animations/script-tests/animate-path-animation-Qq-Tt.js b/third_party/WebKit/LayoutTests/svg/animations/script-tests/animate-path-animation-Qq-Tt.js
index dd974befee6240ad9cc2d87d86eeacac4d728d46..268f9ce9ce4cf2619d3fe20cad28601e0dd95da5 100644
--- a/third_party/WebKit/LayoutTests/svg/animations/script-tests/animate-path-animation-Qq-Tt.js
+++ b/third_party/WebKit/LayoutTests/svg/animations/script-tests/animate-path-animation-Qq-Tt.js
@@ -20,89 +20,21 @@ path.appendChild(animate);
rootSVGElement.appendChild(path);
// Setup animation test
-function checkBaseVal() {
- shouldBe("path.pathSegList.numberOfItems", "4");
- 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", "Q");
- shouldBe("path.pathSegList.getItem(1).x", "30");
- shouldBe("path.pathSegList.getItem(1).y", "0");
- shouldBe("path.pathSegList.getItem(1).x1", "30");
- shouldBe("path.pathSegList.getItem(1).y1", "-30");
- shouldBeEqualToString("path.pathSegList.getItem(2).pathSegTypeAsLetter", "T");
- shouldBe("path.pathSegList.getItem(2).x", "-30");
- shouldBe("path.pathSegList.getItem(2).y", "30");
- shouldBeEqualToString("path.pathSegList.getItem(3).pathSegTypeAsLetter", "Z");
-}
-
function sample1() {
// Check initial/end conditions
- shouldBe("path.animatedPathSegList.numberOfItems", "4");
- 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", "Q");
- shouldBeCloseEnough("path.animatedPathSegList.getItem(1).x", "30");
- shouldBeCloseEnough("path.animatedPathSegList.getItem(1).y", "0");
- shouldBeCloseEnough("path.animatedPathSegList.getItem(1).x1", "30");
- shouldBeCloseEnough("path.animatedPathSegList.getItem(1).y1", "-30");
- shouldBeEqualToString("path.animatedPathSegList.getItem(2).pathSegTypeAsLetter", "T");
- shouldBeCloseEnough("path.animatedPathSegList.getItem(2).x", "-30");
- shouldBeCloseEnough("path.animatedPathSegList.getItem(2).y", "30");
- shouldBeEqualToString("path.animatedPathSegList.getItem(3).pathSegTypeAsLetter", "Z");
- checkBaseVal();
+ shouldBeEqualToString("path.getAttribute('d')", "M -30 -30 Q 30 -30 30 0 T -30 30 Z");
}
function sample2() {
- shouldBe("path.animatedPathSegList.numberOfItems", "4");
- 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", "Q");
- shouldBeCloseEnough("path.animatedPathSegList.getItem(1).x", "22.5");
- shouldBeCloseEnough("path.animatedPathSegList.getItem(1).y", "0");
- shouldBeCloseEnough("path.animatedPathSegList.getItem(1).x1", "22.5");
- shouldBeCloseEnough("path.animatedPathSegList.getItem(1).y1", "-30");
- shouldBeEqualToString("path.animatedPathSegList.getItem(2).pathSegTypeAsLetter", "T");
- shouldBeCloseEnough("path.animatedPathSegList.getItem(2).x", "-30");
- shouldBeCloseEnough("path.animatedPathSegList.getItem(2).y", "30");
- shouldBeEqualToString("path.animatedPathSegList.getItem(3).pathSegTypeAsLetter", "Z");
- checkBaseVal();
+ shouldBeEqualToString("path.getAttribute('d')", "M -30 -30 Q 22.5 -30 22.5 0 T -30 30 Z");
}
function sample3() {
- shouldBe("path.animatedPathSegList.numberOfItems", "4");
- 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", "q");
- shouldBeCloseEnough("path.animatedPathSegList.getItem(1).x", "37.5");
- shouldBeCloseEnough("path.animatedPathSegList.getItem(1).y", "30");
- shouldBeCloseEnough("path.animatedPathSegList.getItem(1).x1", "37.5");
- shouldBeCloseEnough("path.animatedPathSegList.getItem(1).y1", "0");
- shouldBeEqualToString("path.animatedPathSegList.getItem(2).pathSegTypeAsLetter", "t");
- shouldBeCloseEnough("path.animatedPathSegList.getItem(2).x", "-37.5");
- shouldBeCloseEnough("path.animatedPathSegList.getItem(2).y", "30");
- shouldBeEqualToString("path.animatedPathSegList.getItem(3).pathSegTypeAsLetter", "Z");
- checkBaseVal();
+ shouldBeEqualToString("path.getAttribute('d')", "M -30 -30 q 37.5 0 37.5 30 t -37.5 30 Z");
}
function sample4() {
- shouldBe("path.animatedPathSegList.numberOfItems", "4");
- 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", "q");
- shouldBeCloseEnough("path.animatedPathSegList.getItem(1).x", "30");
- shouldBeCloseEnough("path.animatedPathSegList.getItem(1).y", "30");
- shouldBeCloseEnough("path.animatedPathSegList.getItem(1).x1", "30");
- shouldBeCloseEnough("path.animatedPathSegList.getItem(1).y1", "0");
- shouldBeEqualToString("path.animatedPathSegList.getItem(2).pathSegTypeAsLetter", "t");
- shouldBeCloseEnough("path.animatedPathSegList.getItem(2).x", "-30");
- shouldBeCloseEnough("path.animatedPathSegList.getItem(2).y", "30");
- shouldBeEqualToString("path.animatedPathSegList.getItem(3).pathSegTypeAsLetter", "Z");
- checkBaseVal();
+ shouldBeEqualToString("path.getAttribute('d')", "M -30 -30 q 30.0075 0 30.0075 30 t -30.0075 30 Z");
}
function executeTest() {

Powered by Google App Engine
This is Rietveld 408576698