Bug 1302038 part 1 - Add DocumentTimeline constructor tests. r?birtles
MozReview-Commit-ID: 578CGTBiBlv
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/meta/web-animations/interfaces/DocumentTimeline/constructor.html.ini
@@ -0,0 +1,17 @@
+[constructor.html]
+ type: testharness
+ [An origin time of zero is used when none is supplied]
+ expected: FAIL
+ bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1302038
+
+ [A zero origin time produces a document timeline with a current time identical to the default document timeline]
+ expected: FAIL
+ bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1302038
+
+ [A positive origin time makes the document timeline's current time lag behind the default document timeline]
+ expected: FAIL
+ bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1302038
+
+ [A negative origin time makes the document timeline's current time run ahead of the default document timeline]
+ expected: FAIL
+ bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1302038
--- a/testing/web-platform/tests/web-animations/interfaces/DocumentTimeline/constructor.html
+++ b/testing/web-platform/tests/web-animations/interfaces/DocumentTimeline/constructor.html
@@ -6,29 +6,37 @@
<script src="/resources/testharnessreport.js"></script>
<script src="../../testcommon.js"></script>
<body>
<div id="log"></div>
<script>
"use strict";
test(function(t) {
- var timeline = new DocumentTimeline(0);
+ var timeline = new DocumentTimeline();
assert_times_equal(timeline.currentTime, document.timeline.currentTime);
-}, 'zero origin time');
+}, 'An origin time of zero is used when none is supplied');
test(function(t) {
- var timeline = new DocumentTimeline(10 * MS_PER_SEC);
+ var timeline = new DocumentTimeline({ originTime: 0 });
+ assert_times_equal(timeline.currentTime, document.timeline.currentTime);
+}, 'A zero origin time produces a document timeline with a current time ' +
+ 'identical to the default document timeline');
+
+test(function(t) {
+ var timeline = new DocumentTimeline({ originTime: 10 * MS_PER_SEC });
assert_times_equal(timeline.currentTime,
(document.timeline.currentTime - 10 * MS_PER_SEC));
-}, 'positive origin time');
+}, 'A positive origin time makes the document timeline\'s current time lag ' +
+ 'behind the default document timeline');
test(function(t) {
- var timeline = new DocumentTimeline(-10 * MS_PER_SEC);
+ var timeline = new DocumentTimeline({ originTime: -10 * MS_PER_SEC });
assert_times_equal(timeline.currentTime,
(document.timeline.currentTime + 10 * MS_PER_SEC));
-}, 'negative origin time');
+}, 'A negative origin time makes the document timeline\'s current time run ' +
+ 'ahead of the default document timeline');
</script>
</body>