Bug 1267510 part 6 - Add animation test of gecko dependent. r?birtles draft
authorMantaroh Yoshinaga <mantaroh@gmail.com>
Wed, 29 Jun 2016 11:00:55 +0900
changeset 382146 54d6e3eff81a89af47aff60ee346dfc8ed1c60c2
parent 382145 d31fa46b6b94c99e1fa06cee874bcc960426808d
child 382147 48c20fdf3f21dfb55565e9d9759846ecc515942d
push id21636
push usermantaroh@gmail.com
push dateWed, 29 Jun 2016 02:10:27 +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>