Skip to content

Instantly share code, notes, and snippets.

@jugglinmike
Created May 10, 2017 20:17
Show Gist options
  • Save jugglinmike/152032e504251f1e3319dd32e02b70ae to your computer and use it in GitHub Desktop.
Save jugglinmike/152032e504251f1e3319dd32e02b70ae to your computer and use it in GitHub Desktop.
sw-migration-onactivate-script-error.diff
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/onactivate-script-error.html b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/onactivate-script-error.https.html
index bbe028e..23a7f2c 100644
--- a/third_party/WebKit/LayoutTests/http/tests/serviceworker/onactivate-script-error.html
+++ b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/onactivate-script-error.https.html
@@ -1,7 +1,8 @@
<!DOCTYPE html>
-<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/testharness-helpers.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="resources/test-helpers.sub.js"></script>
<script>
function wait_for_install(worker) {
return new Promise(function(resolve, reject) {
@@ -36,6 +37,12 @@ function make_test(name, script) {
})
.then(function() {
// Activate should succeed regardless of script errors.
+ if (registration.active && registration.active.state == 'activated') {
+ return Promise.resolve();
+ } else if (registration.active) {
+ return wait_for_activate(registration.active);
+ }
+
return wait_for_activate(registration.waiting);
});
}, name);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment