Bug 1275449 - Part 2: Add a test. r=hiro
MozReview-Commit-ID: 2Cv806FSBU6
--- a/dom/animation/test/mochitest.ini
+++ b/dom/animation/test/mochitest.ini
@@ -81,8 +81,9 @@ skip-if = buildapp == 'mulet'
skip-if = buildapp == 'mulet'
[mozilla/test_deferred_start.html]
skip-if = (toolkit == 'gonk' && debug)
[mozilla/test_disabled_properties.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/sandbox/test_set-easing.html
@@ -0,0 +1,32 @@
+<!doctype html>
+<head>
+<meta charset=utf-8>
+<title>Tests AnimationTimingFunction::SetEasing in sandbox</title>
+<script src="/tests/SimpleTest/SimpleTest.js"></script>
+<script src="/tests/SimpleTest/SpawnTask.js"></script>
+<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css">
+</head>
+<body>
+
+<script>
+"use strict";
+
+add_task(function* set_easing() {
+ const div = document.createElement("div");
+ document.body.appendChild(div);
+ div.animate({ opacity: [0, 1] }, 100000 );
+
+ const contentScript = function() {
+ doesThrow(() => {
+ document.getAnimations()[0].effect.timing.easing = "linear";
+ }, "AnimationTimingFunction::SetEasing should throw in sandbox.");
+ };
+
+ const sandbox = new SpecialPowers.Cu.Sandbox(window);
+ sandbox.importFunction(document, "document");
+ sandbox.importFunction(SimpleTest.doesThrow, "doesThrow");
+ SpecialPowers.Cu.evalInSandbox(`(${contentScript.toSource()})()`, sandbox);
+});
+
+</script>
+</body>