Merge baf654fbc4
into 3eefa464ee
This commit is contained in:
commit
4f07a47c6c
2 changed files with 10 additions and 2 deletions
|
@ -121,7 +121,15 @@ class HTTPTestServer {
|
|||
}
|
||||
}
|
||||
|
||||
const __httpTestServer = new HTTPTestServer(`http://localhost:${internals.getEchoServerPort()}`);
|
||||
const __httpTestServer = (function () {
|
||||
if (globalThis.internals && globalThis.internals.getEchoServerPort)
|
||||
return new HTTPTestServer(`http://localhost:${internals.getEchoServerPort()}`);
|
||||
|
||||
return null;
|
||||
})();
|
||||
|
||||
function httpTestServer() {
|
||||
if (!__httpTestServer)
|
||||
throw new Error("window.internals must be exposed to use HTTPTestServer");
|
||||
return __httpTestServer;
|
||||
}
|
||||
|
|
|
@ -559,7 +559,7 @@
|
|||
// Tell the ladybird test runner what our preferred timeout is
|
||||
{
|
||||
let timeout = test_environment.test_timeout();
|
||||
if (timeout)
|
||||
if (timeout && window.internals)
|
||||
window.internals.setTestTimeout(timeout);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue