Bug 1303793 - Part 2: Run test which uses the Web Animations API in an iframe with the Web Animations API preference. r?birtles
MozReview-Commit-ID: 233vs8Aiw5j
--- 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>