From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- dom/serviceworkers/test/close_test.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 dom/serviceworkers/test/close_test.js (limited to 'dom/serviceworkers/test/close_test.js') diff --git a/dom/serviceworkers/test/close_test.js b/dom/serviceworkers/test/close_test.js new file mode 100644 index 0000000000..07f85617ef --- /dev/null +++ b/dom/serviceworkers/test/close_test.js @@ -0,0 +1,22 @@ +function ok(v, msg) { + client.postMessage({ status: "ok", result: !!v, message: msg }); +} + +var client; +onmessage = function (e) { + if (e.data.message == "start") { + self.clients.matchAll().then(function (clients) { + client = clients[0]; + try { + close(); + ok(false, "close() should throw"); + } catch (ex) { + ok( + ex.name === "InvalidAccessError", + "close() should throw InvalidAccessError" + ); + } + client.postMessage({ status: "done" }); + }); + } +}; -- cgit v1.2.3