content/base/test/test_bug300992.html

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 <!DOCTYPE HTML>
     2 <html>
     3 <!--
     4 https://bugzilla.mozilla.org/show_bug.cgi?id=300992
     5 -->
     6 <head>
     7   <title>Test for Bug 300992</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=300992">Mozilla Bug 300992</a>
    13 <p id="display"></p>
    14 <div id="content" style="display: none">
    15 </div>
    16 <pre id="test">
    17 <script type="application/javascript">
    19 /** Test for Bug 300992 **/
    20 SimpleTest.waitForExplicitFinish();
    22 var i = 0;
    23 var states = ['loading',
    24   'interactive1', 'interactive2',
    25   'complete1', 'complete2'];
    27 is(document.readyState, states[i++], 'initial readyState');
    28 document.onreadystatechange = function (event) {
    29   is(document.readyState + '1', states[i++], 'readystatechange event "on" handler');
    30 };
    31 document.addEventListener('readystatechange', function(event) {
    32   is(document.readyState + '2', states[i++], 'readystatechange event document listener');
    33 }, false);
    34 window.addEventListener('readystatechange', function(event) {
    35   ok(false, 'window listener', 'readystatechange event should not bubble to window');
    36 }, false);
    37 addLoadEvent(function() {
    38   is(i, states.length, 'readystatechange event count');
    39   SimpleTest.finish();
    40 });
    42 </script>
    43 </pre>
    44 </body>
    45 </html>

mercurial