test_bug589623.html (920B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=589623 5 --> 6 <head> 7 <title>Test for Bug 589623</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=589623">Mozilla Bug 589623</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 589623 */ 19 var sel = getSelection(); 20 sel.removeAllRanges(); 21 function t(m) { 22 try { 23 sel[m](); 24 ok(false, "Should not be here"); 25 } catch(e) { 26 is(e.name, "InvalidStateError", "Should be an InvalidStateError"); 27 ok(e instanceof DOMException, "Should be a DOMException"); 28 is(e.code, DOMException.INVALID_STATE_ERR, "Should be an INVALID_STATE_ERR"); 29 } 30 } 31 t("collapseToStart"); 32 t("collapseToEnd"); 33 </script> 34 </pre> 35 </body> 36 </html>