Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
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=339494
6 -->
7 <window title="Mozilla Bug 339494"
8 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
9 xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
11 <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
13 <body xmlns="http://www.w3.org/1999/xhtml">
14 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=339494">Mozilla Bug 339494</a>
15 <p id="display"></p>
16 <div id="content" style="display: none">
17 <xul:hbox id="d"/>
18 <xul:hbox id="s"/>
19 </div>
20 <pre id="test">
21 </pre>
22 </body>
24 <script class="testbody" type="application/javascript">
26 /** Test for Bug 339494 **/
28 var d = document.getElementById("d");
30 d.setAttribute("hhh", "testvalue");
32 document.addEventListener("DOMAttrModified", removeItAgain, false);
33 d.removeAttribute("hhh");
34 document.removeEventListener("DOMAttrModified", removeItAgain, false);
36 function removeItAgain()
37 {
38 ok(!d.hasAttribute("hhh"), "Value check 1",
39 "There should be no value");
40 isnot(d.getAttribute("hhh"), "testvalue", "Value check 2");
41 document.removeEventListener("DOMAttrModified", removeItAgain, false);
42 d.removeAttribute("hhh");
43 ok(true, "Reachability", "We shouldn't have crashed");
44 }
46 var s = document.getElementById("s");
48 s.setAttribute("ggg", "testvalue");
50 document.addEventListener("DOMAttrModified", compareVal, false);
51 s.setAttribute("ggg", "othervalue");
52 document.removeEventListener("DOMAttrModified", compareVal, false);
54 function compareVal()
55 {
56 ok(s.hasAttribute("ggg"), "Value check 3",
57 "There should be a value");
58 isnot(s.getAttribute("ggg"), "testvalue", "Value check 4");
59 is(s.getAttribute("ggg"), "othervalue", "Value check 5");
60 }
62 </script>
64 </window>