layout/generic/test/test_bug719518.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/layout/generic/test/test_bug719518.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,26 @@
     1.4 +<!doctype html>
     1.5 +<!--
     1.6 +https://bugzilla.mozilla.org/show_bug.cgi?id=719518
     1.7 +-->
     1.8 +<title>Test for Bug 719518</title>
     1.9 +<script src="/tests/SimpleTest/SimpleTest.js"></script>
    1.10 +<link rel="stylesheet" href="/tests/SimpleTest/test.css">
    1.11 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=719518">Mozilla Bug 719518</a>
    1.12 +<p id="display"></p>
    1.13 +<div id="content" style="display: none"></div>
    1.14 +<pre id="test">
    1.15 +<script>
    1.16 +var thrown = false;
    1.17 +try {
    1.18 +  getSelection().extend(document.body, 0);
    1.19 +} catch(e) {
    1.20 +  thrown = true;
    1.21 +  is(e.name, "InvalidStateError",
    1.22 +     "Need to throw InvalidStateError for extend() with no ranges");
    1.23 +  ok(e instanceof DOMException,
    1.24 +     "Need to throw DOMException for extend() with no ranges");
    1.25 +  is(e.code, DOMException.INVALID_STATE_ERR,
    1.26 +     "Need to throw INVALID_STATE_ERR for extend() with no ranges");
    1.27 +}
    1.28 +ok(thrown, "Need to throw exception for extend() with no ranges");
    1.29 +</script>

mercurial