| Index: third_party/WebKit/LayoutTests/http/tests/serviceworker/navigation-preload/chromium/resources/navigation-preload-resource-timing-worker.js
|
| diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/navigation-preload/chromium/resources/navigation-preload-resource-timing-worker.js b/third_party/WebKit/LayoutTests/http/tests/serviceworker/navigation-preload/chromium/resources/navigation-preload-resource-timing-worker.js
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..cc0a44f9e64e4bd5edf334c0cf7a61cee916afd7
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/http/tests/serviceworker/navigation-preload/chromium/resources/navigation-preload-resource-timing-worker.js
|
| @@ -0,0 +1,13 @@
|
| +self.addEventListener('activate', event => {
|
| + event.waitUntil(self.registration.navigationPreload.enable());
|
| + });
|
| +
|
| +self.addEventListener('fetch', event => {
|
| + event.respondWith(
|
| + event.preloadResponse
|
| + .then(response => response.text())
|
| + .then(text =>
|
| + new Response(
|
| + JSON.stringify({timingEntries: performance.getEntries()}),
|
| + {headers: {'Content-Type': 'text/html'}})));
|
| + });
|
|
|