b=450088 backing out (new reftest failed)
[wine-gecko.git] / testing / mochitest / tests / test_bug339494.xul
blobe17c2927f84c6b0be9f98cf463f76dc0147236e3
1 <?xml version="1.0"?>
2 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
3 <?xml-stylesheet href="/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:html="http://www.w3.org/1999/xhtml"
9 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
10 xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
12 <title>Test for Bug 339494</title>
13 <script type="application/javascript" src="/MochiKit/packed.js"></script>
14 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
16 <body xmlns="http://www.w3.org/1999/xhtml">
17 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=339494">Mozilla Bug 339494</a>
18 <p id="display"></p>
19 <div id="content" style="display: none">
20 <xul:hbox id="d"/>
21 <xul:hbox id="s"/>
22 </div>
23 <pre id="test">
24 </pre>
25 </body>
27 <script class="testbody" type="application/javascript">
29 /** Test for Bug 339494 **/
31 var d = document.getElementById("d");
33 d.setAttribute("hhh", "testvalue");
35 document.addEventListener("DOMAttrModified", removeItAgain, false);
36 d.removeAttribute("hhh");
37 document.removeEventListener("DOMAttrModified", removeItAgain, false);
39 function removeItAgain()
41 ok(!d.hasAttribute("hhh"), "Value check 1",
42 "There should be no value");
43 isnot(d.getAttribute("hhh"), "testvalue", "Value check 2");
44 document.removeEventListener("DOMAttrModified", removeItAgain, false);
45 d.removeAttribute("hhh");
46 ok(true, "Reachability", "We shouldn't have crashed");
49 var s = document.getElementById("s");
51 s.setAttribute("ggg", "testvalue");
53 document.addEventListener("DOMAttrModified", compareVal, false);
54 s.setAttribute("ggg", "othervalue");
55 document.removeEventListener("DOMAttrModified", compareVal, false);
57 function compareVal()
59 ok(s.hasAttribute("ggg"), "Value check 3",
60 "There should be a value");
61 isnot(s.getAttribute("ggg"), "testvalue", "Value check 4");
62 is(s.getAttribute("ggg"), "othervalue", "Value check 5");
65 </script>
67 </window>