summaryrefslogtreecommitdiffstats
path: root/dom/serviceworkers/test/nofetch_handler_worker.js
diff options
context:
space:
mode:
Diffstat (limited to 'dom/serviceworkers/test/nofetch_handler_worker.js')
-rw-r--r--dom/serviceworkers/test/nofetch_handler_worker.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/dom/serviceworkers/test/nofetch_handler_worker.js b/dom/serviceworkers/test/nofetch_handler_worker.js
new file mode 100644
index 0000000000..77ba0c734a
--- /dev/null
+++ b/dom/serviceworkers/test/nofetch_handler_worker.js
@@ -0,0 +1,14 @@
+function handleFetch(event) {
+ event.respondWith(new Response("intercepted"));
+}
+
+self.oninstall = function(event) {
+ addEventListener("fetch", handleFetch);
+ self.onfetch = handleFetch;
+};
+
+// Bug 1325101. Make sure adding event listeners for other events
+// doesn't set the fetch flag.
+addEventListener("push", function() {});
+addEventListener("message", function() {});
+addEventListener("non-sw-event", function() {});