| Index: third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/clients-get-worker.js
|
| diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/clients-get-worker.js b/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/clients-get-worker.js
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..6dcc7b04327dc1c99cf2bbcc31e61a87bead7629
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/clients-get-worker.js
|
| @@ -0,0 +1,23 @@
|
| +var actual_client_id;
|
| +
|
| +self.onfetch = function(e) {
|
| + // Get the subresource request from the second iframe.
|
| + if (e.request.url.indexOf('simple.txt') != -1) {
|
| + clients.matchAll().then(function(clients) {
|
| + clients.forEach(function(client) {
|
| + if (client.frameType == "nested" &&
|
| + client.url.indexOf('#2') != -1) {
|
| + actual_client_id = client.id;
|
| + }
|
| + });
|
| + });
|
| + }
|
| +};
|
| +
|
| +self.onmessage = function(e) {
|
| + var port = e.data.port;
|
| +
|
| + clients.get(actual_client_id).then(function(client) {
|
| + port.postMessage(client.url);
|
| + });
|
| +};
|
|
|