Index: third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/multi-globals/url-parsing.https.html |
diff --git a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/multi-globals/url-parsing.https.html b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/multi-globals/url-parsing.https.html |
index 1330d07805bb855d3c7ea3ee37cf61c563d7c574..b9dfe3634353382e85dd0f7be4ea5b69c8083e08 100644 |
--- a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/multi-globals/url-parsing.https.html |
+++ b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/multi-globals/url-parsing.https.html |
@@ -26,29 +26,30 @@ promise_test(t => { |
return frames[0].testRegister(); |
}).then(r => { |
registration = r; |
- const newestWorker = r.installing || r.waiting || r.active; |
- return wait_for_state(t, newestWorker, 'activated'); |
- }).then(() => { |
- return fetch('relevant/test.txt'); |
- }) |
- .then(response => response.text()) |
- .then(text => { |
- assert_equals(text, 'relevant', |
- 'the service worker found at relevant/test-sw.js must have been the one to intercept the fetch'); |
+ return wait_for_state(t, registration.installing, 'activated'); |
+ }).then(_ => { |
+ assert_equals(registration.active.scriptURL, normalizeURL('relevant/test-sw.js'), 'the script URL should be parsed against the relevant global'); |
+ assert_equals(registration.scope, normalizeURL('relevant/'), 'the default scope URL should be parsed against the parsed script URL'); |
return registration.unregister(); |
}); |
-}, 'register should use the relevant global of the object it was called on to resolve the script URL'); |
+}, 'register should use the relevant global of the object it was called on to resolve the script URL and the default scope URL'); |
promise_test(t => { |
+ let registration; |
+ |
return loadPromise.then(() => { |
return frames[0].testRegister({ scope: 'scope' }); |
- }).then(registration => { |
- assert_equals(registration.scope, normalizeURL('relevant/scope'), 'the scope URL should be relevant/scope'); |
+ }).then(r => { |
+ registration = r; |
+ return wait_for_state(t, registration.installing, 'activated'); |
+ }).then(_ => { |
+ assert_equals(registration.active.scriptURL, normalizeURL('relevant/test-sw.js'), 'the script URL should be parsed against the relevant global'); |
+ assert_equals(registration.scope, normalizeURL('relevant/scope'), 'the given scope URL should be parsed against the relevant global'); |
return registration.unregister(); |
}); |
-}, 'register should use the relevant global of the object it was called on to resolve the scope URL'); |
+}, 'register should use the relevant global of the object it was called on to resolve the script URL and the given scope URL'); |
promise_test(t => { |
let registration; |