Skip to content

Instantly share code, notes, and snippets.

@jugglinmike
Created May 19, 2017 21:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jugglinmike/30eda43475da2e759d270442f15192bc to your computer and use it in GitHub Desktop.
Save jugglinmike/30eda43475da2e759d270442f15192bc to your computer and use it in GitHub Desktop.
sw-migration-script-url.diff
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/serviceworkerobject-scripturl.html b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/serviceworkerobject-scripturl.https.html
index 2fc512b..95587a5 100644
--- a/third_party/WebKit/LayoutTests/http/tests/serviceworker/serviceworkerobject-scripturl.html
+++ b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/serviceworkerobject-scripturl.https.html
@@ -1,14 +1,14 @@
<!DOCTYPE html>
<title>ServiceWorker object: scriptURL property</title>
-<script src="../resources/testharness.js"></script>
-<script src="../resources/testharnessreport.js"></script>
-<script src="resources/test-helpers.js"></script>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="resources/test-helpers.sub.js"></script>
<script>
function url_test(name, url) {
var scope = 'resources/scope/' + name;
async_test(function(t) {
- var expectedURL = normalizeURL(url);
+ var expectedURL = (new URL(url, window.location)).toString();
service_worker_unregister_and_register(t, url, scope)
.then(function(registration) {
var worker = registration.installing;
@@ -21,8 +21,6 @@ function url_test(name, url) {
}
url_test('relative', 'resources/empty-worker.js');
-url_test('with-fragment', 'resources/empty-worker.js#ref');
-url_test('absolute', window.location.origin +
- '/serviceworker/resources/empty-worker.js');
+url_test('absolute', (new URL('./resources/empty-worker.js', window.location)).href);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment