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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/serviceworker/navigation-preload/resources/broken-chunked-encoding-worker.js

Issue 2645493002: Increase the lifetime of Navigation Preload related objects. (Closed)
Patch Set: check fetchEvent in ServiceWorkerGlobalScopeProxy::onNavigationPreloadError Created 3 years, 11 months 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: third_party/WebKit/LayoutTests/http/tests/serviceworker/navigation-preload/resources/broken-chunked-encoding-worker.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/navigation-preload/resources/broken-chunked-encoding-worker.js b/third_party/WebKit/LayoutTests/http/tests/serviceworker/navigation-preload/resources/broken-chunked-encoding-worker.js
new file mode 100644
index 0000000000000000000000000000000000000000..72e763a2a2684c81b2818440db77194160923a9a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/serviceworker/navigation-preload/resources/broken-chunked-encoding-worker.js
@@ -0,0 +1,10 @@
+self.addEventListener('activate', event => {
+ event.waitUntil(
+ self.registration.navigationPreload.enable());
+ });
+
+self.addEventListener('fetch', event => {
+ event.respondWith(event.preloadResponse
+ .then(res => res.text())
+ .then(text => new Response('Done')));
falken 2017/01/18 14:24:59 Do we care what |text| is? Doesn't matter as long
horo 2017/01/18 16:14:57 "event.respondWith(event.preloadResponse)" will re
falken 2017/01/18 16:32:57 You could do something like: if (text === '') retu
horo 2017/01/18 16:52:06 Done.
+ });

Powered by Google App Engine
This is Rietveld 408576698