|
1 <!DOCTYPE HTML> |
|
2 <html> |
|
3 <!-- |
|
4 https://bugzilla.mozilla.org/show_bug.cgi?id=448564 |
|
5 --> |
|
6 <head> |
|
7 <title>Test for Bug 448564</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=448564">Mozilla Bug 448564</a> |
|
13 <p id="display"> |
|
14 <iframe src="bug448564-iframe-1.html"></iframe> |
|
15 <iframe src="bug448564-iframe-2.html"></iframe> |
|
16 <iframe src="bug448564-iframe-3.html"></iframe> |
|
17 </p> |
|
18 <div id="content" style="display: none"> |
|
19 </div> |
|
20 <pre id="test"> |
|
21 <script class="testbody" type="text/javascript"> |
|
22 |
|
23 SimpleTest.expectAssertions(3); |
|
24 |
|
25 /** Test for Bug 448564 **/ |
|
26 |
|
27 /** |
|
28 * The three iframes are going to be loaded with some dirty constructed forms. |
|
29 * Each of them will be submitted before the load event and a SJS will replace |
|
30 * the frame content with the query string. |
|
31 * Then, on the load event, our test file will check the content of each iframes |
|
32 * and check if the query string were correctly formatted (implying that all |
|
33 * iframes were correctly submitted. |
|
34 */ |
|
35 |
|
36 function checkQueryString(frame) { |
|
37 var queryString = frame.document.body.textContent; |
|
38 is(queryString.split("&").sort().join("&"), |
|
39 "a=aval&b=bval&c=cval&d=dval", |
|
40 "Not all form fields were properly submitted."); |
|
41 } |
|
42 |
|
43 SimpleTest.waitForExplicitFinish(); |
|
44 |
|
45 addLoadEvent(function() { |
|
46 checkQueryString(frames[0]); |
|
47 checkQueryString(frames[1]); |
|
48 checkQueryString(frames[2]); |
|
49 SimpleTest.finish(); |
|
50 }); |
|
51 |
|
52 </script> |
|
53 </pre> |
|
54 </body> |
|
55 </html> |