Bug 1302038 part 1 - Add DocumentTimeline constructor tests. r?birtles draft
authorMantaroh Yoshinaga <mantaroh@gmail.com>
Wed, 28 Sep 2016 16:56:18 +0900
changeset 418321 e99cd6d7d04df94ee429301a24104059a716af2c
parent 417914 66a77b9bfe5dcacd50eccf85de7c0e7e15ce0ffd
child 418322 fdf464b915d4c61a042afd944cada349c3a6dfcc
push id30663
push usermantaroh@gmail.com
push dateWed, 28 Sep 2016 07:56:52 +0000
reviewersbirtles
bugs1302038
milestone52.0a1
Bug 1302038 part 1 - Add DocumentTimeline constructor tests. r?birtles MozReview-Commit-ID: 578CGTBiBlv
testing/web-platform/meta/web-animations/interfaces/DocumentTimeline/constructor.html.ini
testing/web-platform/tests/web-animations/interfaces/DocumentTimeline/constructor.html
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>