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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/credentialmanager/resources/respond-with-body.js

Issue 1847383003: CREDENTIAL: Rework the integration with Fetch (2/2) Base URL: https://chromium.googlesource.com/chromium/src.git@pass-serialized
Patch Set: unittest Created 4 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/credentialmanager/resources/respond-with-body.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/credentialmanager/resources/respond-with-body.js b/third_party/WebKit/LayoutTests/http/tests/credentialmanager/resources/respond-with-body.js
new file mode 100644
index 0000000000000000000000000000000000000000..aca09eda2e4729992754de91cdb1772b9c097382
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/credentialmanager/resources/respond-with-body.js
@@ -0,0 +1,15 @@
+self.addEventListener('fetch', e => {
+ if (new URL(e.request.url).search != '?respond-with-body') {
+ return;
+ }
+ e.respondWith(new Promise(r => {
+ e.request.text().then(t => {
+ var data = {
+ 'credentials': e.request.credentials,
+ 'body': t
+ };
+ r(new Response(JSON.stringify(data)));
+ })
+ }));
+});
+

Powered by Google App Engine
This is Rietveld 408576698