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

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

Issue 435453002: [ServiceWorker] Update formatting for tests. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 self.addEventListener('fetch', function(event) { 1 self.addEventListener('fetch', function(event) {
2 var url = event.request.url; 2 var url = event.request.url;
3 if (url.indexOf('dummy-dir') == -1) { 3 if (url.indexOf('dummy-dir') == -1) {
4 return; 4 return;
5 } 5 }
6 var result = 'mode=' + event.request.mode + 6 var result = 'mode=' + event.request.mode +
7 ' credentials=' + event.request.credentials; 7 ' credentials=' + event.request.credentials;
8 if (url == 'http://127.0.0.1:8000/dummy-dir/same.html') { 8 if (url == 'http://127.0.0.1:8000/dummy-dir/same.html') {
9 event.respondWith(new Response( 9 event.respondWith(new Response(
10 result + 10 result +
11 '<link id="same-same" rel="import" ' + 11 '<link id="same-same" rel="import" ' +
12 'href="http://127.0.0.1:8000/dummy-dir/same-same.html">' + 12 'href="http://127.0.0.1:8000/dummy-dir/same-same.html">' +
13 '<link id="same-other" rel="import" ' + 13 '<link id="same-other" rel="import" ' +
14 ' href="http://localhost:8000/dummy-dir/same-other.html">')); 14 ' href="http://localhost:8000/dummy-dir/same-other.html">'));
15 } else if (url == 'http://localhost:8000/dummy-dir/other.html') { 15 } else if (url == 'http://localhost:8000/dummy-dir/other.html') {
16 event.respondWith(new Response( 16 event.respondWith(new Response(
17 result + 17 result +
18 '<link id="other-same" rel="import" ' + 18 '<link id="other-same" rel="import" ' +
19 ' href="http://127.0.0.1:8000/dummy-dir/other-same.html">' + 19 ' href="http://127.0.0.1:8000/dummy-dir/other-same.html">' +
20 '<link id="other-other" rel="import" ' + 20 '<link id="other-other" rel="import" ' +
21 ' href="http://localhost:8000/dummy-dir/other-other.html">')); 21 ' href="http://localhost:8000/dummy-dir/other-other.html">'));
22 } else { 22 } else {
23 event.respondWith(new Response(result)); 23 event.respondWith(new Response(result));
24 } 24 }
25 }); 25 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698