Chromium Code Reviews| Index: LayoutTests/http/tests/serviceworker/resources/fetch-request-html-imports-worker.js |
| diff --git a/LayoutTests/http/tests/serviceworker/resources/fetch-request-html-imports-worker.js b/LayoutTests/http/tests/serviceworker/resources/fetch-request-html-imports-worker.js |
| index 12550abb3b4b2b300f7a787d8a4987452f7dd7f6..2e5c99c00a4ade6dcf8190f9f928d4edeb5a9d9a 100644 |
| --- a/LayoutTests/http/tests/serviceworker/resources/fetch-request-html-imports-worker.js |
| +++ b/LayoutTests/http/tests/serviceworker/resources/fetch-request-html-imports-worker.js |
| @@ -1,3 +1,6 @@ |
| +importScripts('../../resources/get-host-info.js'); |
| +var host_info = get_host_info(); |
| + |
| self.addEventListener('fetch', function(event) { |
| var url = event.request.url; |
| if (url.indexOf('dummy-dir') == -1) { |
| @@ -5,20 +8,22 @@ self.addEventListener('fetch', function(event) { |
| } |
| var result = 'mode=' + event.request.mode + |
| ' credentials=' + event.request.credentials; |
| - if (url == 'http://127.0.0.1:8000/dummy-dir/same.html') { |
| + if (url == host_info.HTTP_ORIGIN + '/dummy-dir/same.html') { |
| event.respondWith(new Response( |
| result + |
| '<link id="same-same" rel="import" ' + |
| - 'href="http://127.0.0.1:8000/dummy-dir/same-same.html">' + |
| + 'href="' + host_info.HTTP_ORIGIN + '/dummy-dir/same-same.html">' + |
| '<link id="same-other" rel="import" ' + |
| - ' href="http://localhost:8000/dummy-dir/same-other.html">')); |
| - } else if (url == 'http://localhost:8000/dummy-dir/other.html') { |
| + ' href="' + host_info.HTTP_REMOTE_ORIGIN + |
| + '/dummy-dir/same-other.html">')); |
|
nhiroki
2015/08/26 09:02:28
indent-nit
jeremyarcher
2015/08/27 07:45:43
Done.
|
| + } else if (url == host_info.HTTP_REMOTE_ORIGIN + '/dummy-dir/other.html') { |
| event.respondWith(new Response( |
| result + |
| '<link id="other-same" rel="import" ' + |
| - ' href="http://127.0.0.1:8000/dummy-dir/other-same.html">' + |
| + ' href="' + host_info.HTTP_ORIGIN + '/dummy-dir/other-same.html">' + |
| '<link id="other-other" rel="import" ' + |
| - ' href="http://localhost:8000/dummy-dir/other-other.html">')); |
| + ' href="' + host_info.HTTP_REMOTE_ORIGIN + |
| + '/dummy-dir/other-other.html">')); |
|
nhiroki
2015/08/26 09:02:28
indent-nit
jeremyarcher
2015/08/27 07:45:43
Done.
|
| } else { |
| event.respondWith(new Response(result)); |
| } |