Bug 1852740: add tests for the `fetchpriority` attribute in Link headers. r=necko...
[gecko.git] / dom / base / test / test_bug737612.html
blob9a17ab06e66a8baac726399e16d91f8ca5e77e9d
1 <!doctype html>
2 <!--
3 https://bugzilla.mozilla.org/show_bug.cgi?id=737612
4 -->
5 <title>Test for Bug 737612</title>
6 <script src="/tests/SimpleTest/SimpleTest.js"></script>
7 <link rel="stylesheet" href="/tests/SimpleTest/test.css"/>
8 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=737612">Mozilla Bug 737612</a>
9 <script>
11 /** Test for Bug 737612 **/
12 var text = document.createTextNode("abc");
13 var range = document.createRange();
14 range.setStart(text, 1);
15 var threw = false;
16 try {
17 range.insertNode(document.head);
18 } catch(e) {
19 var threw = true;
20 is(e.name, "HierarchyRequestError",
21 "Must throw HierarchyRequestError");
22 is(Object.getPrototypeOf(e), DOMException.prototype,
23 "Must throw DOMException");
24 is(e.code, DOMException.HIERARCHY_REQUEST_ERR,
25 "Must throw HIERARCHY_REQUEST_ERR");
27 ok(threw, "Must throw when insertNode()ing into detached text node");
29 </script>