Bug 1303793 - Part 2: Run test which uses the Web Animations API in an iframe with the Web Animations API preference on a CLOSED TREE. r=birtles, a=test-only
authorHiroyuki Ikezoe <hiikezoe@mozilla-japan.org>
Tue, 20 Sep 2016 02:57:00 +0200
changeset 350309 50a24c86a83a0237bb77c1b5cfe49254f670a082
parent 350308 763ecbe1877e75b853f0bad50d6c224a1645ef3d
child 350310 ae6b5bd79419f47b99ba4735bb5dd22d203f3333
push id1230
push userjlund@mozilla.com
push dateMon, 31 Oct 2016 18:13:35 +0000
treeherdermozilla-release@5e06e3766db2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbirtles, test-only
bugs1303793
milestone50.0
Bug 1303793 - Part 2: Run test which uses the Web Animations API in an iframe with the Web Animations API preference on a CLOSED TREE. r=birtles, a=test-only MozReview-Commit-ID: 233vs8Aiw5j
dom/animation/test/mochitest.ini
dom/animation/test/mozilla/file_set-easing.html
dom/animation/test/mozilla/test_set-easing.html
--- a/dom/animation/test/mochitest.ini
+++ b/dom/animation/test/mochitest.ini
@@ -36,16 +36,17 @@ support-files =
   css-transitions/file_pseudoElement-get-animations.html
   document-timeline/file_document-timeline.html
   mozilla/file_cubic_bezier_limits.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
+  mozilla/file_set-easing.html
   mozilla/file_transform_limits.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]
 [css-animations/test_animation-computed-timing.html]
copy from dom/animation/test/mozilla/test_set-easing.html
copy to dom/animation/test/mozilla/file_set-easing.html
--- a/dom/animation/test/mozilla/test_set-easing.html
+++ b/dom/animation/test/mozilla/file_set-easing.html
@@ -1,17 +1,15 @@
 <!doctype html>
 <head>
 <meta charset=utf-8>
 <title>Test setting easing in sandbox</title>
-<script src="/resources/testharness.js"></script>
-<script src="/resources/testharnessreport.js"></script>
+<script src="../testcommon.js"></script>
 </head>
 <body>
-<div id="log"></div>
 <script>
 "use strict";
 
 test(function(t) {
   const div = document.createElement("div");
   document.body.appendChild(div);
   div.animate({ opacity: [0, 1] }, 100000 );
 
@@ -26,10 +24,11 @@ test(function(t) {
 
   const sandbox = new SpecialPowers.Cu.Sandbox(window);
   sandbox.importFunction(document, "document");
   sandbox.importFunction(assert_true, "assert_true");
   sandbox.importFunction(assert_unreached, "assert_unreached");
   SpecialPowers.Cu.evalInSandbox(`(${contentScript.toSource()})()`, sandbox);
 }, 'Setting easing should not throw any exceptions in sandbox');
 
+done();
 </script>
 </body>
--- a/dom/animation/test/mozilla/test_set-easing.html
+++ b/dom/animation/test/mozilla/test_set-easing.html
@@ -1,35 +1,14 @@
 <!doctype html>
-<head>
 <meta charset=utf-8>
-<title>Test setting easing in sandbox</title>
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
-</head>
-<body>
 <div id="log"></div>
 <script>
-"use strict";
-
-test(function(t) {
-  const div = document.createElement("div");
-  document.body.appendChild(div);
-  div.animate({ opacity: [0, 1] }, 100000 );
-
-  const contentScript = function() {
-    try {
-      document.getAnimations()[0].effect.timing.easing = "linear";
-      assert_true(true, 'Setting easing should not throw in sandbox');
-    } catch (e) {
-      assert_unreached('Setting easing threw ' + e);
-    }
-  };
-
-  const sandbox = new SpecialPowers.Cu.Sandbox(window);
-  sandbox.importFunction(document, "document");
-  sandbox.importFunction(assert_true, "assert_true");
-  sandbox.importFunction(assert_unreached, "assert_unreached");
-  SpecialPowers.Cu.evalInSandbox(`(${contentScript.toSource()})()`, sandbox);
-}, 'Setting easing should not throw any exceptions in sandbox');
-
+'use strict';
+setup({explicit_done: true});
+SpecialPowers.pushPrefEnv(
+  { "set": [["dom.animations-api.core.enabled", true]]},
+  function() {
+    window.open("file_set-easing.html");
+  });
 </script>
-</body>