This commit is contained in:
Tim Ledbetter 2025-01-02 11:40:22 +00:00 committed by GitHub
commit 4f07a47c6c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 2 deletions

View file

@ -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;
}

View file

@ -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);
}