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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/foreign-fetch-helper-script.js

Issue 2110163002: Correctly set initiated_in_secure_context on requests from shared/service workers, (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@skip-service-worker-foreign-fetch
Patch Set: wrap layout test at 80 columns Created 4 years, 6 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/resources/foreign-fetch-helper-script.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/foreign-fetch-helper-script.js b/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/foreign-fetch-helper-script.js
new file mode 100644
index 0000000000000000000000000000000000000000..5ecaa9e36166395c857f22f1eae7fddba2fca5f1
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/foreign-fetch-helper-script.js
@@ -0,0 +1,11 @@
+function handle_message(e) {
+ fetch(e.data.url)
+ .then(response => response.text())
+ .then(text => e.ports[0].postMessage('Success: ' + text))
+ .catch(error => e.ports[0].postMessage('Error: ' + error));
+}
+
+self.onmessage = handle_message;
+self.onconnect = e => {
+ e.ports[0].onmessage = handle_message;
+};

Powered by Google App Engine
This is Rietveld 408576698