Bug 1267510 part 6 - Add animation test of gecko dependent. r?birtles draft
authorMantaroh Yoshinaga <mantaroh@gmail.com>
Wed, 29 Jun 2016 11:14:12 +0900
changeset 382152 91fec810785b06dffcfcd9b0c18b0c125bb36f07
parent 382151 fdfdea6e87c5554828597193d75a3f503f0bee2b
child 382153 f0d988c79b78a2016966f4cb7277942c0983f880
push id21637
push usermantaroh@gmail.com
push dateWed, 29 Jun 2016 02:14:31 +0000
reviewersbirtles
bugs1267510
milestone50.0a1
Bug 1267510 part 6 - Add animation test of gecko dependent. r?birtles MozReview-Commit-ID: 1ZnXUCECMiH
dom/animation/test/mochitest.ini
dom/animation/test/mozilla/file_document-timeline-origin-time-range.html
dom/animation/test/mozilla/test_document-timeline-origin-time-range.html
--- a/dom/animation/test/mochitest.ini
+++ b/dom/animation/test/mochitest.ini
@@ -32,16 +32,17 @@ support-files =
   css-transitions/file_document-get-animations.html
   css-transitions/file_effect-target.html
   css-transitions/file_element-get-animations.html
   css-transitions/file_keyframeeffect-getkeyframes.html
   css-transitions/file_pseudoElement-get-animations.html
   document-timeline/file_document-timeline.html
   mozilla/file_deferred_start.html
   mozilla/file_disabled_properties.html
+  mozilla/file_document-timeline-origin-time-range.html
   mozilla/file_hide_and_show.html
   mozilla/file_partial_keyframes.html
   style/file_animation-seeking-with-current-time.html
   style/file_animation-seeking-with-start-time.html
   testcommon.js
 
 [css-animations/test_animations-dynamic-changes.html]
 [css-animations/test_animation-cancel.html]
@@ -77,13 +78,14 @@ skip-if = buildapp == 'mulet'
 [css-transitions/test_keyframeeffect-getkeyframes.html]
 [css-transitions/test_pseudoElement-get-animations.html]
 [document-timeline/test_document-timeline.html]
 [document-timeline/test_request_animation_frame.html]
 skip-if = buildapp == 'mulet'
 [mozilla/test_deferred_start.html]
 skip-if = (toolkit == 'gonk' && debug)
 [mozilla/test_disabled_properties.html]
+[mozilla/test_document-timeline-origin-time-range.html]
 [mozilla/test_hide_and_show.html]
 [mozilla/test_partial_keyframes.html]
 [style/test_animation-seeking-with-current-time.html]
 [style/test_animation-seeking-with-start-time.html]
 [sandbox/test_set-easing.html]
new file mode 100644
--- /dev/null
+++ b/dom/animation/test/mozilla/file_document-timeline-origin-time-range.html
@@ -0,0 +1,26 @@
+<!doctype html>
+<meta charset=utf-8>
+<script src="../testcommon.js"></script>
+<body>
+<script>
+'use strict';
+
+// If the originTime parameter passed to the DocumentTimeline exceeds
+// the range of the internal storage type (a signed 64-bit integer number
+// of ticks--a platform-dependent unit) then we should throw.
+// Infinity isn't allowed as an origin time value and clamping to just
+// inside the allowed range will just mean we overflow elsewhere.
+
+test(function(t) {
+  assert_throws({name: 'TypeError'},
+    function() { new DocumentTimeline(Number.MAX_SAFE_INTEGER); });
+}, 'Calculated current time is positive infinity');
+
+test(function(t) {
+  assert_throws({name: 'TypeError'},
+    function() { new DocumentTimeline(-1 * Number.MAX_SAFE_INTEGER); });
+}, 'Calculated current time is negative infinity');
+
+done();
+</script>
+</body>
new file mode 100644
--- /dev/null
+++ b/dom/animation/test/mozilla/test_document-timeline-origin-time-range.html
@@ -0,0 +1,14 @@
+<!doctype html>
+<meta charset=utf-8>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+'use strict';
+setup({explicit_done: true});
+SpecialPowers.pushPrefEnv(
+  { "set": [["dom.animations-api.core.enabled", true]]},
+  function() {
+    window.open("file_document-timeline-origin-time-range.html");
+  });
+</script>