1 <!-- Any copyright is dedicated to the Public Domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ -->
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>
15 <p>Status codes test
</p>
17 <script type=
"text/javascript">
18 /* exported performRequests, performCachedRequests, performOneCachedRequest, performEarlyHintRequest */
21 function get(address
) {
22 return new Promise(resolve
=> {
23 const xhr
= new XMLHttpRequest();
24 xhr
.open("GET", address
, true);
26 xhr
.onreadystatechange = function() {
27 if (this.readyState
== this.DONE
) {
35 async
function performRequests() {
36 await
get("sjs_status-codes-test-server.sjs?sts=100");
37 await
get("sjs_status-codes-test-server.sjs?sts=200");
38 await
get("sjs_status-codes-test-server.sjs?sts=300");
39 await
get("sjs_status-codes-test-server.sjs?sts=400");
40 await
get("sjs_status-codes-test-server.sjs?sts=500");
43 async
function performCachedRequests() {
44 await
get("sjs_status-codes-test-server.sjs?sts=ok&cached");
45 await
get("sjs_status-codes-test-server.sjs?sts=redirect&cached");
48 async
function performOneCachedRequest() {
49 await
get("sjs_status-codes-test-server.sjs?sts=ok&cached");
50 await
get("sjs_status-codes-test-server.sjs?sts=ok&cached");
53 async
function performEarlyHintRequest() {
54 await
get("sjs_early-hint-test-server.sjs?early-hint-pixel.sjs=5ecccd01-dd3f-4bbd-bd3e-0491d7dd78a1");