layout/base/tests/test_bug607529.html

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 <!DOCTYPE HTML>
     2 <html>
     3 <!--
     4 https://bugzilla.mozilla.org/show_bug.cgi?id=607529
     5 -->
     6 <head>
     7   <title>Test for Bug 607529</title>
     8   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     9   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    10 </head>
    11 <body>
    12 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=607529">Mozilla Bug 607529</a>
    13 <p id="display"></p>
    14 <div id="content" style="display: none">
    16 </div>
    17 <pre id="test">
    18 <script type="application/javascript">
    19   SimpleTest.waitForExplicitFinish();
    21   /* General idea: Open a new window (needed because we don't bfcache
    22      subframes) that uses mozRequestAnimationFrame, navigate it, navigate it
    23      back, and verify that the animations are still running.  */
    25   var doneOneLoad = false;
    27   /** Test for Bug 607529 **/
    28   var done = false;
    29   window.onmessage = function(e) {
    30     isnot(e.data, "notcached", "Should never end up not being cached");
    32     if (e.data == "loaded" && !doneOneLoad) {
    33       doneOneLoad = true;
    34       w.location = "data:text/html,<script>window.onload = function() { opener.postMessage('goback', '*'); }</" + "script>";
    35     }
    36     else if (e.data == "goback") {
    37       w.history.back();
    38     }
    39     else if (e.data == "revived") {
    40       w.postMessage("report", "*");
    41     }
    42     else if (e.data == "callbackHappened") {
    43       // We might get this message more than once, if the other page queues up
    44       // more than one callbackHappened message before we manage to close it.
    45       // Protect against calling SimpleTest.finish() more than once.
    46       if (!done) {
    47 	w.close();
    48 	SimpleTest.finish();
    49 	done = true;
    50       }
    51     } else {
    52       var msg = JSON.parse(e.data);
    53       if (msg.error) {
    54         window.onerror(msg.msg, msg.url, msg.line);
    55       }
    56     }
    57   };
    59   var w = window.open("file_bug607529.html");
    60 </script>
    61 </pre>
    62 </body>
    63 </html>

mercurial