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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/serviceworker/navigation-preload/chromium/resources/preload-response-after-gc-worker.js

Issue 2764293002: Add LayoutTests for the fixed multithread GC bug of ServiceWorker Navigation Preload (Closed)
Patch Set: incorporated falken's comment Created 3 years, 9 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/chromium/resources/preload-response-after-gc-worker.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/navigation-preload/chromium/resources/preload-response-after-gc-worker.js b/third_party/WebKit/LayoutTests/http/tests/serviceworker/navigation-preload/chromium/resources/preload-response-after-gc-worker.js
new file mode 100644
index 0000000000000000000000000000000000000000..c31c1c3a21c4e66bb56e98e5bbd61199bee01efc
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/serviceworker/navigation-preload/chromium/resources/preload-response-after-gc-worker.js
@@ -0,0 +1,12 @@
+
+self.addEventListener('activate', e => {
+ e.waitUntil(self.registration.navigationPreload.enable());
+ });
+
+self.addEventListener('fetch', e => {
+ internals.collectGarbage();
+ // Sleeps 100 ms.
+ var end = Date.now() + 100;
+ while (Date.now() < end);
+ e.respondWith(new Response("hello"));
+ });

Powered by Google App Engine
This is Rietveld 408576698