summaryrefslogtreecommitdiffstats
path: root/devtools/client/application/test/browser/resources/service-workers/controlled-install.html
diff options
context:
space:
mode:
Diffstat (limited to 'devtools/client/application/test/browser/resources/service-workers/controlled-install.html')
-rw-r--r--devtools/client/application/test/browser/resources/service-workers/controlled-install.html27
1 files changed, 27 insertions, 0 deletions
diff --git a/devtools/client/application/test/browser/resources/service-workers/controlled-install.html b/devtools/client/application/test/browser/resources/service-workers/controlled-install.html
new file mode 100644
index 0000000000..300ee1fde7
--- /dev/null
+++ b/devtools/client/application/test/browser/resources/service-workers/controlled-install.html
@@ -0,0 +1,27 @@
+<!-- Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ -->
+<!DOCTYPE HTML>
+<html>
+<head>
+ <meta charset="UTF-8">
+ <title>Service worker test</title>
+</head>
+<body>
+<script type="text/javascript">
+"use strict";
+
+let registration;
+
+window.registerServiceWorker = async function() {
+ registration = await navigator.serviceWorker.register(
+ "controlled-install-sw.js"
+ );
+ window.sw = registration;
+};
+
+window.installServiceWorker = function() {
+ registration.installing.postMessage("install-service-worker");
+};
+</script>
+</body>
+</html>