content/html/document/test/test_bug448564.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/content/html/document/test/test_bug448564.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,55 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<html>
     1.6 +<!--
     1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=448564
     1.8 +-->
     1.9 +<head>
    1.10 +  <title>Test for Bug 448564</title>
    1.11 +  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    1.12 +  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
    1.13 +</head>
    1.14 +<body>
    1.15 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=448564">Mozilla Bug 448564</a>
    1.16 +<p id="display">
    1.17 +  <iframe src="bug448564-iframe-1.html"></iframe>
    1.18 +  <iframe src="bug448564-iframe-2.html"></iframe>
    1.19 +  <iframe src="bug448564-iframe-3.html"></iframe>
    1.20 +</p>
    1.21 +<div id="content" style="display: none">
    1.22 +</div>
    1.23 +<pre id="test">
    1.24 +<script class="testbody" type="text/javascript">
    1.25 +
    1.26 +SimpleTest.expectAssertions(3);
    1.27 +
    1.28 +/** Test for Bug 448564 **/
    1.29 +
    1.30 +/**
    1.31 + * The three iframes are going to be loaded with some dirty constructed forms.
    1.32 + * Each of them will be submitted before the load event and a SJS will replace
    1.33 + * the frame content with the query string.
    1.34 + * Then, on the load event, our test file will check the content of each iframes
    1.35 + * and check if the query string were correctly formatted (implying that all
    1.36 + * iframes were correctly submitted.
    1.37 + */
    1.38 +
    1.39 +function checkQueryString(frame) {
    1.40 +  var queryString = frame.document.body.textContent;
    1.41 +  is(queryString.split("&").sort().join("&"),
    1.42 +     "a=aval&b=bval&c=cval&d=dval",
    1.43 +     "Not all form fields were properly submitted.");
    1.44 +}
    1.45 +
    1.46 +SimpleTest.waitForExplicitFinish();
    1.47 +
    1.48 +addLoadEvent(function() {
    1.49 +  checkQueryString(frames[0]);
    1.50 +  checkQueryString(frames[1]);
    1.51 +  checkQueryString(frames[2]);
    1.52 +  SimpleTest.finish();
    1.53 +});
    1.54 +
    1.55 +</script>
    1.56 +</pre>
    1.57 +</body>
    1.58 +</html>

mercurial