content/base/test/test_bug339494.html

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 <!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>

mercurial