browser/devtools/netmonitor/test/html_params-test-page.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/browser/devtools/netmonitor/test/html_params-test-page.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,54 @@
     1.4 +<!-- Any copyright is dedicated to the Public Domain.
     1.5 +     http://creativecommons.org/publicdomain/zero/1.0/ -->
     1.6 +<!doctype html>
     1.7 +
     1.8 +<html>
     1.9 +  <head>
    1.10 +    <meta charset="utf-8"/>
    1.11 +    <title>Network Monitor test page</title>
    1.12 +  </head>
    1.13 +
    1.14 +  <body>
    1.15 +    <p>Request params type test</p>
    1.16 +
    1.17 +    <script type="text/javascript">
    1.18 +      function post(aAddress, aQuery, aContentType, aPostBody) {
    1.19 +        var xhr = new XMLHttpRequest();
    1.20 +        xhr.open("POST", aAddress + aQuery, true);
    1.21 +        xhr.setRequestHeader("content-type", aContentType);
    1.22 +        xhr.send(aPostBody);
    1.23 +      }
    1.24 +
    1.25 +      function performRequests() {
    1.26 +        var urlencoded = "application/x-www-form-urlencoded";
    1.27 +
    1.28 +        setTimeout(function() {
    1.29 +          post("baz", "?a", urlencoded, '{ "foo": "bar" }');
    1.30 +
    1.31 +          setTimeout(function() {
    1.32 +            post("baz", "?a=b", urlencoded, '{ "foo": "bar" }');
    1.33 +
    1.34 +            setTimeout(function() {
    1.35 +              post("baz", "?a=b", urlencoded, '?foo=bar');
    1.36 +
    1.37 +              setTimeout(function() {
    1.38 +                post("baz", "?a", undefined, '{ "foo": "bar" }');
    1.39 +
    1.40 +                setTimeout(function() {
    1.41 +                  post("baz", "?a=b", undefined, '{ "foo": "bar" }');
    1.42 +
    1.43 +                  setTimeout(function() {
    1.44 +                    post("baz", "?a=b", undefined, '?foo=bar');
    1.45 +
    1.46 +                    // Done.
    1.47 +                  }, 10);
    1.48 +                }, 10);
    1.49 +              }, 10);
    1.50 +            }, 10);
    1.51 +          }, 10);
    1.52 +        }, 10);
    1.53 +      }
    1.54 +    </script>
    1.55 +  </body>
    1.56 +
    1.57 +</html>

mercurial