From 43a97878ce14b72f0981164f87f2e35e14151312 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 11:22:09 +0200 Subject: Adding upstream version 110.0.1. Signed-off-by: Daniel Baumann --- netwerk/test/unit_ipc/test_is_proxy_used.js | 32 +++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 netwerk/test/unit_ipc/test_is_proxy_used.js (limited to 'netwerk/test/unit_ipc/test_is_proxy_used.js') diff --git a/netwerk/test/unit_ipc/test_is_proxy_used.js b/netwerk/test/unit_ipc/test_is_proxy_used.js new file mode 100644 index 0000000000..2678ffa1b8 --- /dev/null +++ b/netwerk/test/unit_ipc/test_is_proxy_used.js @@ -0,0 +1,32 @@ +"use strict"; +/* global NodeHTTPServer, NodeHTTPProxyServer*/ + +add_task(async function run_test() { + let proxy = new NodeHTTPProxyServer(); + await proxy.start(); + registerCleanupFunction(async () => { + await proxy.stop(); + }); + + let server = new NodeHTTPServer(); + + await server.start(); + registerCleanupFunction(async () => { + await server.stop(); + }); + + await server.registerPathHandler("/test", (req, resp) => { + let content = "content"; + resp.writeHead(200); + resp.end(content); + }); + + do_await_remote_message("start-test").then(() => { + do_send_remote_message( + "start-test-done", + `http://localhost:${server.port()}/test` + ); + }); + + run_test_in_child("child_is_proxy_used.js"); +}); -- cgit v1.2.3