tenfourfox/dom/workers/test/serviceworkers/close_test.js
Cameron Kaiser c9b2922b70 hello FPR
2017-04-19 00:56:45 -07:00

20 lines
489 B
JavaScript

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 (e) {
ok(e.name === "InvalidAccessError", "close() should throw InvalidAccessError");
}
client.postMessage({status: "done"});
});
}
}