content/base/test/test_bug704063.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/content/base/test/test_bug704063.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,56 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<html>
     1.6 +<!--
     1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=
     1.8 +-->
     1.9 +<head>
    1.10 +  <meta charset="utf-8">
    1.11 +  <title>Test for Bug </title>
    1.12 +  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    1.13 +  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    1.14 +  <script type="application/javascript">
    1.15 +
    1.16 +  /** Test for Bug  **/
    1.17 +  SimpleTest.waitForExplicitFinish();
    1.18 +  var unprefixedRan = false;
    1.19 +  var prefixedRan = false;
    1.20 +  function unprefixed(time) {
    1.21 +    is(prefixedRan, true, "We were called second");
    1.22 +    unprefixedRan = true;
    1.23 +    ok(Math.abs(time - performance.now()) < 3600000,
    1.24 +       "An hour really shouldn't have passed here");
    1.25 +    ok(Math.abs(time - Date.now()) > 3600000,
    1.26 +       "More than an hour should have passed since 1970");
    1.27 +  }
    1.28 +  function prefixed(time) {
    1.29 +    is(unprefixedRan, false, "Prefixed was called first");
    1.30 +    prefixedRan = true;
    1.31 +    ok(Math.abs(time - Date.now()) < 3600000,
    1.32 +       "Our time should be comparable to Date.now()");
    1.33 +    ok(Math.abs(time - performance.now()) > 3600000,
    1.34 +       "Our time should not be comparable to performance.now()");
    1.35 +  }
    1.36 +  function prefixed2() {
    1.37 +    ok(prefixedRan, "We should be after the other prefixed call");
    1.38 +    ok(unprefixedRan, "We should be after the unprefixed call");
    1.39 +    SimpleTest.finish();
    1.40 +  }
    1.41 +
    1.42 +  window.onload = function() {
    1.43 +    window.mozRequestAnimationFrame(prefixed);
    1.44 +    window.requestAnimationFrame(unprefixed);
    1.45 +    window.mozRequestAnimationFrame(prefixed2);
    1.46 +  }
    1.47 +
    1.48 +  </script>
    1.49 +</head>
    1.50 +<body>
    1.51 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=">Mozilla Bug </a>
    1.52 +<p id="display"></p>
    1.53 +<div id="content" style="display: none">
    1.54 +
    1.55 +</div>
    1.56 +<pre id="test">
    1.57 +</pre>
    1.58 +</body>
    1.59 +</html>

mercurial