Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(315)

Unified Diff: LayoutTests/http/tests/serviceworker/resources/client-focus.js

Issue 779563003: [POC-WIP] Link window focus tokens with ExecutionContext. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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');
+ });
+ });
+ });
+}
« no previous file with comments | « LayoutTests/http/tests/serviceworker/client-focus.html ('k') | Source/bindings/core/v8/CallbackPromiseAdapter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698