| Index: third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/mint-new-worker.php
|
| diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/mint-new-worker.php b/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/mint-new-worker.php
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..2189e99fd00fa71351242ebe711d81de1476fb15
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/mint-new-worker.php
|
| @@ -0,0 +1,23 @@
|
| +<?php
|
| +// Mint a new worker each load.
|
| +header("Cache-Control: no-cache, must-revalidate");
|
| +header("Pragma: no-cache");
|
| +header('Content-Type:application/javascript');
|
| +echo "// " . microtime() . "\n";
|
| +
|
| +if ($_SERVER['QUERY_STRING'] == 'skip-waiting') {
|
| + echo "skipWaiting();\n";
|
| +}
|
| +?>
|
| +onactivate = (e) => e.waitUntil(clients.claim());
|
| +
|
| +var resolve_wait_until;
|
| +var wait_until = new Promise(resolve => {
|
| + resolve_wait_until = resolve;
|
| + });
|
| +onmessage = (e) => {
|
| + if (e.data == 'wait')
|
| + e.waitUntil(wait_until);
|
| + if (e.data == 'go')
|
| + resolve_wait_until();
|
| + };
|
|
|