Index: third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/update.https.html |
diff --git a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/update.https.html b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/update.https.html |
index 213b72ac837309d43112d7965a17e2162e7ffb9b..6717d4d7ac289c8a18b1500e21795fd16c5321e7 100644 |
--- a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/update.https.html |
+++ b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/update.https.html |
@@ -5,12 +5,14 @@ |
<script src="resources/testharness-helpers.js"></script> |
<script src="resources/test-helpers.sub.js"></script> |
<script> |
+'use strict'; |
+ |
promise_test(function(t) { |
var scope = 'resources/simple.txt'; |
var worker_url = 'resources/update-worker.py'; |
var expected_url = normalizeURL(worker_url); |
var registration; |
- var iframe; |
+ |
return service_worker_unregister_and_register(t, worker_url, scope) |
.then(function(r) { |
registration = r; |
@@ -41,13 +43,11 @@ promise_test(function(t) { |
.then(function() { |
assert_equals(registration.installing, null, |
'installing should be null after installing.'); |
- if (registration.waiting) { |
- assert_equals(registration.waiting.scriptURL, expected_url, |
- 'waiting should be set after installing.'); |
- assert_equals(registration.active.scriptURL, expected_url, |
- 'active should still exist after installing.'); |
- return wait_for_state(t, registration.waiting, 'activated'); |
- } |
+ assert_equals(registration.waiting.scriptURL, expected_url, |
+ 'waiting should be set after installing.'); |
+ assert_equals(registration.active.scriptURL, expected_url, |
+ 'active should still exist after installing.'); |
+ return wait_for_state(t, registration.waiting, 'activated'); |
}) |
.then(function() { |
assert_equals(registration.installing, null, |
@@ -107,17 +107,15 @@ promise_test(function(t) { |
return with_iframe(scope); |
}) |
.then(function(frame) { |
- iframe = frame; |
+ t.add_cleanup(function() { |
+ frame.remove(); |
+ }); |
return assert_promise_rejects( |
Promise.all([registration.unregister(), registration.update()]), |
new TypeError(), |
'Calling update() while the uninstalling flag is set ' + |
'should return a promise that rejects with a TypeError.'); |
- }) |
- .then(function() { |
- iframe.remove(); |
- return t.done(); |
}); |
}, 'Update a registration.'); |
</script> |