content/base/test/test_bug398243.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=398243
     5 -->
     6 <head>
     7   <title>Test for Bug 398243</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=398243">Mozilla Bug 398243</a>
    13 <p id="display"></p>
    14 <div id="content" style="display: none">
    15 </div>
    16  <iframe id="testframe" src="http://mochi.test:8888/tests/content/base/test/formReset.html"></iframe>  
    17 <pre id="test">
    18 <script class="testbody" type="text/javascript">
    19 /** Test for Bug 398243 **/
    20 const enteredText1 = "New value for text input";
    21 const enteredText2 = "New value for texarea";
    22 SimpleTest.waitForExplicitFinish();
    24 function afterLoad() {
    25     var iframeDoc = $("testframe").contentDocument;
    26     /* change all the form controls */
    27     iframeDoc.getElementById("checkbox1").checked = true;
    28     iframeDoc.getElementById("checkbox2").checked = false;
    29     iframeDoc.getElementById("textinput").value = enteredText1;
    30     iframeDoc.getElementById("textarea").value = enteredText2;
    32     /* Reload the page */
    33     $("testframe").setAttribute("onload", "afterReload()");
    34     iframeDoc.location.reload();
    35 }
    37 addLoadEvent(afterLoad);
    39 function afterReload() {
    40     var iframeDoc = $("testframe").contentDocument;
    41     is(iframeDoc.getElementById("checkbox1").checked, true,
    42        "checkbox #1 state preserved");
    43     is(iframeDoc.getElementById("checkbox2").checked, false,
    44        "checkbox #2 state preserved");
    45     is(iframeDoc.getElementById("textinput").value, enteredText1,
    46        "text preserved in <input>");
    47     is(iframeDoc.getElementById("textarea").value, enteredText2,
    48        "text preserved in <textarea>");
    50     SimpleTest.finish();
    51 }
    52 </script>
    53 </pre>
    54 </body>
    55 </html>

mercurial