tor-browser

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

test_bug583889.html (1449B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <!--
      4 https://bugzilla.mozilla.org/show_bug.cgi?id=583889
      5 -->
      6 <head>
      7  <title>Test for Bug 583889</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=583889">Mozilla Bug 583889</a>
     13 <iframe id="inner" style="width: 10px; height: 10px;"></iframe>
     14 <pre id="test">
     15 <script type="application/javascript">
     16 
     17 /** Test for Bug 583889 */
     18 SimpleTest.waitForExplicitFinish();
     19 
     20 function grabEventAndGo(event) {
     21  gen.next(event);
     22 }
     23 
     24 function* runTest() {
     25  window.onload = grabEventAndGo;
     26  // Wait for onLoad event.
     27  yield;
     28 
     29  SpecialPowers.pushPrefEnv({
     30    set: [ ["layout.disable-pixel-alignment", true] ]
     31  }).then(grabEventAndGo);
     32  // Wait for the pref change.
     33  yield;
     34 
     35  var inner = $("inner");
     36  inner.src = "bug583889_inner1.html";
     37  window.onmessage = grabEventAndGo;
     38  // Wait for message from 'inner' iframe.
     39  event = yield;
     40 
     41  while (event.data != "done") {
     42    data = JSON.parse(event.data);
     43    is(data.top, 300, "should remain at same top");
     44    is(data.left, 300, "should remain at same left");
     45 
     46    // Wait for message from 'inner' iframe.
     47    event = yield;
     48  }
     49 
     50  // finish(), yet let the test actually end first, to be safe.
     51  SimpleTest.executeSoon(SimpleTest.finish);
     52 }
     53 
     54 var gen = runTest();
     55 gen.next();
     56 </script>
     57 </pre>
     58 </body>
     59 </html>