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

Unified Diff: third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/serviceworkerobject-scripturl.https.html

Issue 2894883003: Upstream service worker tests to WPT (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/serviceworker/serviceworkerobject-scripturl.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/serviceworkerobject-scripturl.https.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/serviceworkerobject-scripturl.https.html b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/serviceworkerobject-scripturl.https.html
index 95587a5a42d980435f2d3ca6cc1450b8b0ce6fde..58f25f3a442c01387807300b1a278e71e9254d0a 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/serviceworkerobject-scripturl.https.html
+++ b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/serviceworkerobject-scripturl.https.html
@@ -4,23 +4,28 @@
<script src="/resources/testharnessreport.js"></script>
<script src="resources/test-helpers.sub.js"></script>
<script>
+'use strict';
function url_test(name, url) {
var scope = 'resources/scope/' + name;
- async_test(function(t) {
- var expectedURL = (new URL(url, window.location)).toString();
- service_worker_unregister_and_register(t, url, scope)
- .then(function(registration) {
- var worker = registration.installing;
- assert_equals(worker.scriptURL, expectedURL,
- 'Returned ServiceWorker object should have scriptURL');
- service_worker_unregister_and_done(t, scope);
- })
- .catch(unreached_rejection(t));
- }, 'Verify the scriptURL property: ' + name);
+ var expectedURL = normalizeURL(url);
+
+ promise_test(function(t) {
+ return service_worker_unregister_and_register(t, url, scope)
+ .then(function(registration) {
+ var worker = registration.installing;
+
+ t.add_cleanup(function() {
+ registration.unregister();
+ });
+
+ assert_equals(worker.scriptURL, expectedURL,
+ 'Returned ServiceWorker object should have scriptURL');
+ });
+ }, 'Verify the scriptURL property: ' + name);
}
url_test('relative', 'resources/empty-worker.js');
-url_test('absolute', (new URL('./resources/empty-worker.js', window.location)).href);
-
+url_test('with-fragment', 'resources/empty-worker.js#ref');
+url_test('absolute', normalizeURL('./resources/empty-worker.js'));
</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/serviceworker/serviceworkerobject-scripturl.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698