tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

test_keyframe_effect_xrays.html (1809B)


      1 <!doctype html>
      2 <head>
      3 <meta charset=utf-8>
      4 <script type="application/javascript" src="../testharness.js"></script>
      5 <script type="application/javascript" src="../testharnessreport.js"></script>
      6 <script type="application/javascript" src="../testcommon.js"></script>
      7 </head>
      8 <body>
      9 <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1414674"
     10  target="_blank">Mozilla Bug 1414674</a>
     11 <div id="log"></div>
     12 <iframe id="iframe"
     13  src="http://example.org/tests/dom/animation/test/chrome/file_animate_xrays.html"></iframe>
     14 <script>
     15 'use strict';
     16 
     17 var win = document.getElementById('iframe').contentWindow;
     18 
     19 async_test(function(t) {
     20  window.addEventListener('load', t.step_func(function() {
     21    var target = win.document.getElementById('target');
     22    var effect = new win.KeyframeEffect(target, [
     23      {opacity: 1, offset: 0},
     24      {opacity: 0, offset: 1},
     25    ], {duration: 100 * MS_PER_SEC, fill: "forwards"});
     26    // The frames object should be accessible via x-ray.
     27    var frames = effect.getKeyframes();
     28    assert_equals(frames.length, 2,
     29                  "frames for KeyframeEffect ctor should be non-zero");
     30    assert_equals(frames[0].opacity, "1",
     31                  "first frame opacity for KeyframeEffect ctor should be specified value");
     32    assert_equals(frames[0].computedOffset, 0,
     33                  "first frame offset for KeyframeEffect ctor should be 0");
     34    assert_equals(frames[1].opacity, "0",
     35                  "last frame opacity for KeyframeEffect ctor should be specified value");
     36    assert_equals(frames[1].computedOffset, 1,
     37                  "last frame offset for KeyframeEffect ctor should be 1");
     38    var animation = new win.Animation(effect, document.timeline);
     39    animation.play();
     40    t.done();
     41  }));
     42 }, 'Calling KeyframeEffect() ctor across x-rays');
     43 
     44 </script>
     45 </body>