docshell/test/test_bug634834.html

Wed, 31 Dec 2014 13:27:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 13:27:57 +0100
branch
TOR_BUG_3246
changeset 6
8bccb770b82d
permissions
-rw-r--r--

Ignore runtime configuration files generated during quality assurance.

     1 <!DOCTYPE HTML>
     2 <html>
     3 <!--
     4 https://bugzilla.mozilla.org/show_bug.cgi?id=634834
     5 -->
     6 <head>
     7   <title>Test for Bug 634834</title>
     8   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     9   <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
    10   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    11 </head>
    12 <body>
    13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=634834">Mozilla Bug 634834</a>
    15 <script type='application/javascript;version=1.7'>
    16 SimpleTest.waitForExplicitFinish();
    18 function iframe_loaded() {
    19   var loadedAfterPushstate = false;
    20   $('iframe').onload = function() {
    21     loadedAfterPushstate = true;
    22   }
    24   var obj = { name: 'name' };
    25   obj.__defineGetter__('a', function() {
    26     $('iframe').contentWindow.location = 'http://example.com';
    28     // Wait until we've loaded example.com.
    29     do {
    30         var r = new XMLHttpRequest();
    31         r.open("GET", location.href, false);
    32         r.overrideMimeType("text/plain");
    33         try { r.send(null); }
    34         catch (e) {}
    35     } while (!loadedAfterPushstate);
    36   });
    38   try {
    39     $('iframe').contentWindow.history.pushState(obj, '');
    40     ok(false, 'pushState should throw exception.');
    41   }
    42   catch(e) {
    43     ok(true, 'pushState threw an exception.');
    44   }
    45   SimpleTest.finish();
    46 }
    48 </script>
    50 <iframe id='iframe' src='file_bug634834.html' onload='iframe_loaded()'></iframe>
    52 </body>
    53 </html>

mercurial