Bug 1275449 - Part 2: Add a test. r=hiro
authorDaisuke Akatsuka <daisuke@mozilla-japan.org>
Wed, 01 Jun 2016 17:49:01 +0900
changeset 324440 f746d2a857b8f5bca06a999822c085011c30f58c
parent 324439 f6cde20f6294f7ad98fc1372dade8557a80a935c
child 324441 3a48b194e35bea1b0939791e3b46ac033d7a85a1
push id9671
push userraliiev@mozilla.com
push dateMon, 06 Jun 2016 20:27:52 +0000
treeherdermozilla-aurora@cea65ca3d0bd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershiro
bugs1275449
milestone49.0a1
Bug 1275449 - Part 2: Add a test. r=hiro MozReview-Commit-ID: 2Cv806FSBU6
dom/animation/test/mochitest.ini
dom/animation/test/sandbox/test_set-easing.html
--- 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>