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 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=339494
5 -->
6 <head>
7 <title>Test for Bug 339494</title>
8 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
10 </head>
11 <body>
12 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=339494">Mozilla Bug 339494</a>
13 <p id="display"></p>
14 <div id="content" style="display: none">
15 <div id="d"></div>
16 <div id="s"></div>
17 </div>
18 <pre id="test">
19 <script class="testbody" type="text/javascript">
21 /** Test for Bug 339494 **/
23 var d = document.getElementById("d");
25 d.setAttribute("hhh", "testvalue");
27 document.addEventListener("DOMAttrModified", removeItAgain, false);
28 d.removeAttribute("hhh");
29 document.removeEventListener("DOMAttrModified", removeItAgain, false);
31 function removeItAgain()
32 {
33 ok(!d.hasAttribute("hhh"), "Value check 1",
34 "There should be no value");
35 isnot(d.getAttribute("hhh"), "testvalue", "Value check 2");
36 document.removeEventListener("DOMAttrModified", removeItAgain, false);
37 d.removeAttribute("hhh");
38 ok(true, "Reachability", "We shouldn't have crashed");
39 }
41 var s = document.getElementById("s");
43 s.setAttribute("ggg", "testvalue");
45 document.addEventListener("DOMAttrModified", compareVal, false);
46 s.setAttribute("ggg", "othervalue");
47 document.removeEventListener("DOMAttrModified", compareVal, false);
49 function compareVal()
50 {
51 ok(s.hasAttribute("ggg"), "Value check 3",
52 "There should be a value");
53 isnot(s.getAttribute("ggg"), "testvalue", "Value check 4");
54 is(s.getAttribute("ggg"), "othervalue", "Value check 5");
55 }
57 </script>
58 </pre>
59 </body>
60 </html>