5 <title>Test for Bug
1916356</title>
6 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
10 SimpleTest
.waitForExplicitFinish();
13 // server.sjs?slow doesn't respond, which results in the
14 // HttpBaseChannel::mResponseHead being nullptr.
15 const slowXHR
= new XMLHttpRequest();
16 slowXHR
.open("GET", "server.sjs?slow");
19 // server.sjs?fast quickly responds.
20 // Perform this and wait for the load, in order to ensure the
21 // network requests performed there reaches necko and the
22 // corresponding resource entry is created for server.sjs?slow as well.
23 const fastXHR
= new XMLHttpRequest();
24 fastXHR
.open("GET", "server.sjs?fast");
25 const fastLoadPromise
= new Promise(resolve
=> {
26 fastXHR
.addEventListener("load", resolve
);
29 await fastLoadPromise
;
31 const slowEntryPromise
= new Promise(resolve
=> {
32 new PerformanceObserver(list
=> {
33 const entries
= list
.getEntries();
34 for (const entry
of entries
) {
35 if (entry
.name
.includes("server.sjs?slow")) {
39 }).observe({ entryTypes
: [ "resource" ] });
44 const slowEntry
= await slowEntryPromise
;
45 is(slowEntry
.responseStatus
, 0,
46 "responseStatus for the request with no response should be 0");