tor-browser

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

test_bug514856.html (1890B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <!--
      4 https://bugzilla.mozilla.org/show_bug.cgi?id=514856
      5 -->
      6 <head>
      7  <title>Test for Bug 514856</title>
      8  <script src="/tests/SimpleTest/SimpleTest.js"></script>
      9  <script 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=514856">Mozilla Bug 514856</a>
     14 <p id="display"></p>
     15 <div id="content">
     16  <iframe id="testFrame" src="bug514856_iframe.html"></iframe>
     17 </div>
     18 <pre id="test">
     19 <script type="application/javascript">
     20 
     21 /** Test for Bug 514856 */
     22 
     23 function beginTest() {
     24  var ifr = document.getElementById("testFrame");
     25  var win = ifr.contentWindow;
     26 
     27  // After the click, the load event should be fired.
     28  ifr.addEventListener('load', function() {
     29    testDone();
     30  });
     31 
     32  // synthesizeMouse adds getBoundingClientRect left and top to the offsets but
     33  // in that particular case, we don't want that.
     34  var rect = ifr.getBoundingClientRect();
     35  var left = rect.left;
     36  var top = rect.top;
     37 
     38  synthesizeMouse(ifr, 10 - left, 10 - top, { type: "mousemove" }, win);
     39  synthesizeMouse(ifr, 12 - left, 12 - top, { type: "mousemove" }, win);
     40  synthesizeMouse(ifr, 14 - left, 14 - top, { type: "mousemove" }, win);
     41  synthesizeMouse(ifr, 16 - left, 16 - top, { }, win);
     42 }
     43 
     44 function testDone() {
     45  var ifr = document.getElementById("testFrame");
     46  var url = new String(ifr.contentWindow.location);
     47 
     48  is(url.indexOf("?10,10"), -1, "Shouldn't have ?10,10 in the URL!");
     49  is(url.indexOf("?12,12"), -1, "Shouldn't have ?12,12 in the URL!");
     50  is(url.indexOf("?14,14"), -1, "Shouldn't have ?14,14 in the URL!");
     51  isnot(url.indexOf("?16,16"), -1, "Should have ?16,16 in the URL!");
     52  SimpleTest.finish();
     53 }
     54 
     55 SimpleTest.waitForExplicitFinish();
     56 SimpleTest.waitForFocus(beginTest);
     57 
     58 </script>
     59 </pre>
     60 </body>
     61 </html>