4 https://bugzilla.mozilla.org/show_bug.cgi?id=345339
7 <title>Test for Bug
345339</title>
8 <script type=
"text/javascript" src=
"/MochiKit/MochiKit.js"></script>
9 <script type=
"text/javascript" src=
"/tests/SimpleTest/SimpleTest.js"></script>
10 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css" />
13 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=345339">Mozilla Bug
345339</a>
15 <div id=
"content" style=
"display: none">
17 <iframe id=
"testframe"
18 src=
"http://localhost:8888/tests/content/base/test/345339_iframe.html">
21 <script class=
"testbody" type=
"text/javascript">
22 /** Test for Bug
345339 **/
23 SimpleTest.waitForExplicitFinish();
25 function afterLoad() {
26 var iframeDoc = $(
"testframe").contentDocument;
28 /* change all the form controls */
29 iframeDoc.getElementById(
"select").selectedIndex =
1;
30 iframeDoc.getElementById(
"radio2").checked = true;
31 iframeDoc.getElementById(
"password").value =
"123456";
32 iframeDoc.getElementById(
"hidden").value =
"gecko";
34 netscape.security.PrivilegeManager.enablePrivilege(
"UniversalFileRead");
35 iframeDoc.getElementById(
"file").value =
"dummyfile.txt";
38 $(
"testframe").setAttribute(
"onload",
"afterReload()");
39 iframeDoc.location.reload();
42 addLoadEvent(afterLoad);
44 function afterReload() {
45 var iframeDoc = $(
"testframe").contentDocument;
47 is(iframeDoc.getElementById(
"select").selectedIndex,
1,
48 "select element selected index preserved");
49 is(iframeDoc.getElementById(
"radio1").checked, false,
50 "radio button #1 value preserved");
51 is(iframeDoc.getElementById(
"radio2").checked, true,
52 "radio button #2 value preserved");
53 isnot(iframeDoc.getElementById(
"password").value,
"123456",
54 "password field value forgotten");
55 is(iframeDoc.getElementById(
"hidden").value,
"gecko",
56 "hidden field value preserved");
57 netscape.security.PrivilegeManager.enablePrivilege(
"UniversalFileRead");
58 is(iframeDoc.getElementById(
"file").value,
"dummyfile.txt",
59 "file field value preserved");