Index: LayoutTests/http/tests/serviceworker/resources/client-focus.js |
diff --git a/LayoutTests/http/tests/serviceworker/resources/client-focus.js b/LayoutTests/http/tests/serviceworker/resources/client-focus.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..27a48443f55870a08edf56bd65ca7c5a7f8a1246 |
--- /dev/null |
+++ b/LayoutTests/http/tests/serviceworker/resources/client-focus.js |
@@ -0,0 +1,12 @@ |
+self.onmessage = function(e) { |
+ self.clients.getAll().then(function(clients) { |
+ clients.forEach(function(client) { |
+ if (('focus' in client) && (typeof(client.focus) == 'function')) |
+ client.postMessage('focus() is present'); |
+ client.focus().then(function(result) { |
+ client.postMessage('focus() succeeded with ' + result); |
+ client.postMessage('quit'); |
+ }); |
+ }); |
+ }); |
+} |