Index: third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/get-host-info.sub.js |
diff --git a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/get-host-info.sub.js b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/get-host-info.sub.js |
index b64334df667d7f9784722699e08290b89888cc29..e6edccfbaa83ecb97bb03856d6df8912a4e7d4fb 100644 |
--- a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/get-host-info.sub.js |
+++ b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/get-host-info.sub.js |
@@ -1,19 +1,9 @@ |
function get_host_info() { |
- var ORIGINAL_HOST = '127.0.0.1'; |
- var REMOTE_HOST = 'localhost'; |
- var UNAUTHENTICATED_HOST = 'example.test'; |
- var HTTP_PORT = 8000; |
- var HTTPS_PORT = 8443; |
- try { |
- // In W3C test, we can get the hostname and port number in config.json |
- // using wptserve's built-in pipe. |
- // http://wptserve.readthedocs.org/en/latest/pipes.html#built-in-pipes |
- HTTP_PORT = eval('{{ports[http][0]}}'); |
- HTTPS_PORT = eval('{{ports[https][0]}}'); |
- ORIGINAL_HOST = eval('\'{{host}}\''); |
- REMOTE_HOST = 'www1.' + ORIGINAL_HOST; |
- } catch (e) { |
- } |
+ const HTTP_PORT = '{{ports[http][0]}}'; |
+ const HTTPS_PORT = '{{ports[https][0]}}'; |
+ const ORIGINAL_HOST = '{{host}}'; |
+ const REMOTE_HOST = '{{domains[www1]}}'; |
+ const OTHER_HOST = '{{domains[www2]}}'; |
return { |
HTTP_ORIGIN: 'http://' + ORIGINAL_HOST + ':' + HTTP_PORT, |
HTTPS_ORIGIN: 'https://' + ORIGINAL_HOST + ':' + HTTPS_PORT, |
@@ -21,6 +11,7 @@ function get_host_info() { |
HTTP_REMOTE_ORIGIN: 'http://' + REMOTE_HOST + ':' + HTTP_PORT, |
HTTPS_REMOTE_ORIGIN: 'https://' + REMOTE_HOST + ':' + HTTPS_PORT, |
HTTPS_REMOTE_ORIGIN_WITH_CREDS: 'https://foo:bar@' + REMOTE_HOST + ':' + HTTPS_PORT, |
- UNAUTHENTICATED_ORIGIN: 'http://' + UNAUTHENTICATED_HOST + ':' + HTTP_PORT |
+ UNAUTHENTICATED_ORIGIN: 'http://' + OTHER_HOST + ':' + HTTP_PORT, |
+ AUTHENTICATED_ORIGIN: 'https://' + OTHER_HOST + ':' + HTTPS_PORT |
}; |
} |