Backed out changeset b71c8c052463 (bug 1943846) for causing mass failures. CLOSED...
[gecko.git] / devtools / client / netmonitor / test / html_json-basic.html
blob2f48d8fab6c124dce52e82b1be83153394d219ab
1 <!-- Any copyright is dedicated to the Public Domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ -->
3 <!doctype html>
5 <html>
6 <head>
7 <meta charset="utf-8"/>
8 <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
9 <meta http-equiv="Pragma" content="no-cache" />
10 <meta http-equiv="Expires" content="0" />
11 <title>Network Monitor test page</title>
12 </head>
14 <body>
15 <p>JSON request test page</p>
16 <p>Pass the JSON name (as supported by sjs_json-test-server.sjs) as a query parameter</p>
18 <script type="text/javascript">
19 /* exported performRequests */
20 "use strict";
22 function get(address) {
23 return new Promise(resolve => {
24 const xhr = new XMLHttpRequest();
25 xhr.open("GET", address, true);
27 xhr.onreadystatechange = function() {
28 if (this.readyState == this.DONE) {
29 resolve();
32 xhr.send(null);
33 });
36 async function performRequests() {
37 // Forward the query parameter for this page to sjs_json-test-server
38 await get("sjs_json-test-server.sjs" + window.location.search);
40 </script>
41 </body>
43 </html>