test_bug448564.html 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. /** Test for Bug 448564 **/
  23. /**
  24. * The three iframes are going to be loaded with some dirty constructed forms.
  25. * Each of them will be submitted before the load event and a SJS will replace
  26. * the frame content with the query string.
  27. * Then, on the load event, our test file will check the content of each iframes
  28. * and check if the query string were correctly formatted (implying that all
  29. * iframes were correctly submitted.
  30. */
  31. function checkQueryString(frame) {
  32. var queryString = frame.document.body.textContent;
  33. is(queryString.split("&").sort().join("&"),
  34. "a=aval&b=bval&c=cval&d=dval",
  35. "Not all form fields were properly submitted.");
  36. }
  37. SimpleTest.waitForExplicitFinish();
  38. addLoadEvent(function() {
  39. checkQueryString(frames[0]);
  40. checkQueryString(frames[1]);
  41. checkQueryString(frames[2]);
  42. SimpleTest.finish();
  43. });
  44. </script>
  45. </pre>
  46. </body>
  47. </html>