tor-browser

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

test_bug589621.html (922B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <!--
      4 https://bugzilla.mozilla.org/show_bug.cgi?id=589621
      5 -->
      6 <head>
      7  <title>Test for Bug 589621</title>
      8  <script src="/tests/SimpleTest/SimpleTest.js"></script>
      9  <link rel="stylesheet" href="/tests/SimpleTest/test.css"/>
     10 </head>
     11 <body>
     12 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=589621">Mozilla Bug 589621</a>
     13 <p id="display"></p>
     14 <div id="content" style="display: none">
     15 </div>
     16 <pre id="test">
     17 <script>
     18 /** Test for Bug 589621 */
     19 var sel = getSelection();
     20 var range = document.createRange();
     21 sel.addRange(range);
     22 function t(n) {
     23  try {
     24    sel.getRangeAt(n);
     25    ok(false, "Should not be here");
     26  } catch(e) {
     27    ok(e instanceof DOMException, "Should be a DOMException");
     28    is(e.name, "IndexSizeError", "Should be an IndexSizeError");
     29    is(e.code, DOMException.INDEX_SIZE_ERR, "Should be an INDEX_SIZE_ERR");
     30  }
     31 }
     32 t(-1);
     33 t(1);
     34 </script>
     35 </pre>
     36 </body>
     37 </html>