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

Unified Diff: third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/multi-globals/url-parsing.https.html

Issue 2695813009: Import wpt@503f5b5f78ec4e87d144f78609f363f0ed0ea8db (Closed)
Patch Set: Skip some tests Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
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;

Powered by Google App Engine
This is Rietveld 408576698