tor-browser

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

test_bug289384.html (1445B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <!--
      4 https://bugzilla.mozilla.org/show_bug.cgi?id=289384
      5 -->
      6 <head>
      7  <title>Test for Bug 289384</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=289384">Mozilla Bug 289384</a>
     14 <p id="display"></p>
     15 <div id="content" style="display: none">
     16 </div>
     17 <pre id="test">
     18 <script class="testbody" type="text/javascript">
     19 SimpleTest.waitForExplicitFinish();
     20 
     21 addLoadEvent(function() {
     22  var win = window.open("file_bug289384-1.html", "", "test-289384");
     23  win.addEventListener("load", function() {
     24    win.document.querySelector("a").click();
     25  }, {once: true});
     26 });
     27 
     28 function continueTest(win) {
     29  SimpleTest.waitForFocus(function() {
     30    var doc = win.document;
     31    var sel = win.getSelection();
     32    doc.body.focus();
     33    sel.collapse(doc.body.firstChild, 3);
     34    SimpleTest.executeSoon(function() {
     35      synthesizeKey("KEY_ArrowLeft", {accelKey: true}, win);
     36      ok(sel.isCollapsed, "The selection must be collapsed");
     37      is(sel.anchorNode, doc.body.firstChild, "The anchor node should be the body element's text node");
     38      is(sel.anchorOffset, 0, "The anchor offset should be 0");
     39      win.close();
     40      SimpleTest.finish();
     41    });
     42  }, win);
     43 }
     44 
     45 </script>
     46 </pre>
     47 </body>
     48 </html>