Bug 1852740: add tests for the `fetchpriority` attribute in Link headers. r=necko...
[gecko.git] / dom / xul / test / test_bug445177.xhtml
blobd188f192412fb6ff159ba5001befafe29939a456
1 <?xml version="1.0"?>
2 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
3 <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
4 <!--
5 https://bugzilla.mozilla.org/show_bug.cgi?id=445177
6 -->
7 <window title="Test for Bug 445177"
8 id="test_bug445177.xhtml"
9 xmlns:html="http://www.w3.org/1999/xhtml"
10 xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
11 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
13 <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
15 <body id="body" xmlns="http://www.w3.org/1999/xhtml">
16 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=445177">Mozilla Bug 445177</a>
19 <xul:hbox id="b1" value="foo"/>
20 <xul:hbox id="o1" observes="b1"/>
22 <pre id="test">
23 <script class="testbody" type="text/javascript">
24 <![CDATA[
25 SimpleTest.waitForExplicitFinish();
26 function do_test() {
27 var b1 = document.getElementById("b1");
28 var o1 = document.getElementById("o1");
30 is(o1.getAttribute("value"), b1.getAttribute("value"), "Wrong value (1)");
32 b1.setAttribute("value", "bar");
33 is(o1.getAttribute("value"), b1.getAttribute("value"), "Wrong value (2)");
35 b1.removeAttribute("value");
36 is(o1.hasAttribute("value"), b1.hasAttribute("value"), "Wrong value (3)");
38 o1.setAttribute("value", "foo");
39 isnot(o1.getAttribute("value"), b1.getAttribute("value"), "Wrong value (4)");
41 b1.setAttribute("value", "foobar");
42 is(o1.getAttribute("value"), b1.getAttribute("value"), "Wrong value (5)");
44 //After removing listener, changes to broadcaster shouldn't have any effect.
45 o1.remove();
46 b1.setAttribute("value", "foo");
47 isnot(o1.getAttribute("value"), b1.getAttribute("value"), "Wrong value (6)");
49 b1.parentNode.appendChild(o1);
50 is(o1.getAttribute("value"), b1.getAttribute("value"), "Wrong value (7)");
52 o1.remove();
53 o1.removeAttribute("observes");
54 o1.removeAttribute("value");
55 b1.parentNode.appendChild(o1);
56 isnot(o1.getAttribute("value"), b1.getAttribute("value"), "Wrong value (8)");
58 SimpleTest.finish();
61 addLoadEvent(do_test);
62 ]]>
63 </script>
64 </pre>
65 </body>
66 </window>