tor-browser

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

test_bug377539.html (1298B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <!--
      4 https://bugzilla.mozilla.org/show_bug.cgi?id=377539
      5 -->
      6 <head>
      7    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
      8    <title>Testcase for bug 377539</title>
      9 
     10  <script src="/tests/SimpleTest/SimpleTest.js"></script>
     11  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
     12 </head>
     13 <body>
     14 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=377539">Mozilla Bug 377539</a>
     15 
     16 <p id="display"></p>
     17 <div id="content" style="display: none">
     18 
     19 </div>
     20 
     21 <script type="text/javascript">
     22 var sw;
     23 var child_sw = -1;
     24 
     25 function test(){
     26        var t = '<div style="display: none;"><iframe onload="doChecks()" srcdoc="<body><scr'+'ipt>try {parent.child_sw=screen.width}catch(e){}</scr'+'ipt>"></iframe></div>';
     27        var div = document.createElement('div');
     28        div.innerHTML = t;
     29        document.getElementsByTagName('body')[0].appendChild(div);
     30 }
     31 
     32 try {
     33  sw = screen.width;
     34 } catch (e) {
     35  sw = -1;
     36 }
     37 
     38 </script>
     39 
     40 <pre id="test">
     41 <script class="testbody" type="text/javascript">
     42 function doChecks() {
     43  isnot(sw, -1, "screen.width threw an exception");
     44  is(child_sw, sw, "iframe got wrong screen.width");
     45  SimpleTest.finish();
     46 }
     47 
     48 SimpleTest.waitForExplicitFinish();
     49 
     50 test();
     51 
     52 </script>
     53 </pre>
     54 </body>
     55 </html>