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

Unified Diff: third_party/WebKit/LayoutTests/imported/web-platform-tests/web-animations/animation-node/animation-node-parent.html

Issue 1866333004: Import web-platform-tests@5a8700479d98852455bee6117558897867eb278a (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@wpt-sync
Patch Set: Add Failure option for two TestExpectations entries Created 4 years, 8 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/imported/web-platform-tests/web-animations/animation-node/animation-node-parent.html
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/web-animations/animation-node/animation-node-parent.html b/third_party/WebKit/LayoutTests/imported/web-platform-tests/web-animations/animation-node/animation-node-parent.html
new file mode 100644
index 0000000000000000000000000000000000000000..1c4ac6f00b2c13af30844e0d310a087a8ee7ee9b
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/web-animations/animation-node/animation-node-parent.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>AnimationNode parent attribute tests</title>
+<meta name="assert" content="The parent animation group of this animation node or null if this animation node does not have a parent animation group">
+<link rel="help" href="http://w3c.github.io/web-animations/#dom-animationnode-parent">
+<link rel="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
+<link rel="author" title="Aleksei Yu. Semenov" href="mailto:a.semenov@unipro.ru">
+<script src="../../../../resources/testharness.js"></script>
+<script src="../../../../resources/testharnessreport.js"></script>
+<script src="../testcommon.js"></script>
+<body>
+<div id="log"></div>
+<script>
+test(function() {
+ var nodes = [newAnimation(createDiv(this)), new AnimationGroup([]), new AnimationSequence([])];
+ nodes.forEach(function(node) {
+ assert_equals(node.parent, null, type(node) + '.parent should be null');
+ });
+}, 'AnimationNode.parent is null if animation node does not have a parent animation group');
+
+test(function() {
+ var test = this;
+ var parents = [AnimationGroup, AnimationSequence];
+ parents.forEach(function(parentCtor) {
+ var nodes = [newAnimation(createDiv(test)), new AnimationGroup([]), new AnimationSequence([])];
+ nodes.forEach(function(node) {
+ var parent = new parentCtor([node]);
+
+ assert_equals(node.parent, parent, type(node) + '.parent should return ' +
+ 'parent animation group of this animation node');
+ });
+ });
+}, 'AnimationNode.parent returns parent animation group of this animation node');
+
+test(function() {
+ var test = this;
+ var parents = [AnimationGroup, AnimationSequence];
+ parents.forEach(function(parentCtor) {
+ var nodes = [newAnimation(createDiv(test)), new AnimationGroup([]), new AnimationSequence([])];
+ var parent = new parentCtor([nodes[0], nodes[1], nodes[2]]);
+ nodes.forEach(function(node) {
+ assert_equals(node.parent, parent, type(node) + '.parent should return ' +
+ 'parent animation group of this animation node');
+ });
+ });
+}, 'AnimationNode.parent returns parent animation group of this animation node. ' +
+ 'The group has several children nodes');
+
+// The rest is tested in mutator methods: AnimationNode.before(), AnimationNode.after(),
+// AnimationNode.replace(), AnimationNode.remove(),
+// AnimationGroup.prepend(), AnimationGroup.append(), AnimationGroup.clone()
+</script>
+</body>

Powered by Google App Engine
This is Rietveld 408576698