summaryrefslogtreecommitdiffstats
path: root/tests/auto/core/qwebengineurlrequestinterceptor/resources
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/core/qwebengineurlrequestinterceptor/resources')
-rw-r--r--tests/auto/core/qwebengineurlrequestinterceptor/resources/sw.html16
-rw-r--r--tests/auto/core/qwebengineurlrequestinterceptor/resources/sw.js3
2 files changed, 19 insertions, 0 deletions
diff --git a/tests/auto/core/qwebengineurlrequestinterceptor/resources/sw.html b/tests/auto/core/qwebengineurlrequestinterceptor/resources/sw.html
new file mode 100644
index 000000000..af44b45a2
--- /dev/null
+++ b/tests/auto/core/qwebengineurlrequestinterceptor/resources/sw.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <script>
+ if ('serviceWorker' in navigator) {
+ window.addEventListener('load', function() {
+ navigator.serviceWorker.register('/sw.js').then(function(registration) {
+ console.log('ServiceWorker registration successful with scope: ', registration.scope);
+ }, function(err) {
+ console.error('ServiceWorker registration failed: ', err);
+ });
+ });
+ }
+ </script>
+ </body>
+</html>
diff --git a/tests/auto/core/qwebengineurlrequestinterceptor/resources/sw.js b/tests/auto/core/qwebengineurlrequestinterceptor/resources/sw.js
new file mode 100644
index 000000000..2216e2a07
--- /dev/null
+++ b/tests/auto/core/qwebengineurlrequestinterceptor/resources/sw.js
@@ -0,0 +1,3 @@
+self.addEventListener('install', function(event) {
+ console.log('ServiceWorker installed');
+});