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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/fetch-request-html-imports-worker.js

Issue 2858093002: Upstream service worker `fetch` test to WPT (Closed)
Patch Set: Incorporate review feedback Created 3 years, 7 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/fetch-request-html-imports-iframe.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 importScripts('../../resources/get-host-info.js');
2 var host_info = get_host_info();
3
4 self.addEventListener('fetch', function(event) {
5 var url = event.request.url;
6 if (url.indexOf('dummy-dir') == -1) {
7 return;
8 }
9 var result = 'mode=' + event.request.mode +
10 ' credentials=' + event.request.credentials;
11 if (url == host_info.HTTP_ORIGIN + '/dummy-dir/same.html') {
12 event.respondWith(new Response(
13 result +
14 '<link id="same-same" rel="import" ' +
15 'href="' + host_info.HTTP_ORIGIN + '/dummy-dir/same-same.html">' +
16 '<link id="same-other" rel="import" ' +
17 ' href="' + host_info.HTTP_REMOTE_ORIGIN +
18 '/dummy-dir/same-other.html">'));
19 } else if (url == host_info.HTTP_REMOTE_ORIGIN + '/dummy-dir/other.html') {
20 event.respondWith(new Response(
21 result +
22 '<link id="other-same" rel="import" ' +
23 ' href="' + host_info.HTTP_ORIGIN + '/dummy-dir/other-same.html">' +
24 '<link id="other-other" rel="import" ' +
25 ' href="' + host_info.HTTP_REMOTE_ORIGIN +
26 '/dummy-dir/other-other.html">'));
27 } else {
28 event.respondWith(new Response(result));
29 }
30 });
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/fetch-request-html-imports-iframe.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698