content/base/test/chrome/test_bug339494.xul

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     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>

mercurial