Bug 1303793 - Part 2: Run test which uses the Web Animations API in an iframe with the Web Animations API preference. r=birtles, a=testonly
authorHiroyuki Ikezoe <hiikezoe@mozilla-japan.org>
Thu, 22 Sep 2016 10:18:32 +0900
changeset 355675 f93ac29ad106222f2cd7e55a1d24795f89425dd4
parent 355674 271c91111de4c58e4945a81be808b90a8a042abb
child 355676 a0df4a410db7a4f1fe6ea6503db11209eb8b6fc6
push id6570
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:26:13 +0000
treeherdermozilla-beta@f455459b2ae5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbirtles, testonly
bugs1303793
milestone51.0a2
Bug 1303793 - Part 2: Run test which uses the Web Animations API in an iframe with the Web Animations API preference. r=birtles, a=testonly 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
@@ -40,16 +40,17 @@ support-files =
   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_spacing_property_order.html
   mozilla/file_transform_limits.html
   mozilla/file_underlying-discrete-value.html
+  mozilla/file_set-easing.html
   style/file_animation-seeking-with-current-time.html
   style/file_animation-seeking-with-start-time.html
   style/file_animation-setting-effect.html
   style/file_animation-setting-spacing.html
   testcommon.js
 
 [css-animations/test_animations-dynamic-changes.html]
 [css-animations/test_animation-cancel.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>