tor-browser

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

test_bug720619.html (1477B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <!--
      4 https://bugzilla.mozilla.org/show_bug.cgi?id=720619
      5 -->
      6 <head>
      7  <title>Test for Bug 629227</title>
      8  <script 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=720619">Mozilla Bug 720619</a>
     13 <p id="display">
     14  <iframe id="testTarget"></iframe>
     15 </p>
     16 <div id="content" style="display: none">
     17  
     18 </div>
     19 <pre id="test">
     20 <script type="application/javascript">
     21 
     22 /** Test for Bug 720619 **/
     23 SimpleTest.waitForExplicitFinish();
     24 
     25 function checkThrows(f, exception) {
     26    try {
     27        f();
     28        ok(false, "should have thrown: " + f);
     29    } catch (e) {
     30        ok(exception.test(e.toString()), "correctly threw");
     31    }
     32 }
     33 
     34 function go() {
     35    var loc = $('ifr').contentWindow.location;
     36    checkThrows(function() {loc + '';}, /Permission denied/);
     37    checkThrows(function() {'' + loc;}, /Permission denied/);
     38    checkThrows(function() {String(loc);}, /Permission denied/);
     39 
     40    var win = $('ifr').contentWindow;
     41    checkThrows(function() {win + '';}, /Permission denied/);
     42    checkThrows(function() {'' + win;}, /Permission denied/);
     43    checkThrows(function() {String(win);}, /Permission denied/);
     44 
     45    SimpleTest.finish();
     46 }
     47 
     48 </script>
     49 
     50 <iframe id="ifr" onload="go()"
     51        src="http://example.org/tests/js/xpconnect/tests/mochitest/file_bug720619.html">
     52 </iframe>
     53 </pre>
     54 </body>
     55 </html>