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

Unified Diff: third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/skip-waiting-using-registration.https.html

Issue 2900183002: Upstream service wrkr "skipWaiting" tests to WPT (Closed)
Patch Set: Improve assertion message 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
Index: third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/skip-waiting-using-registration.https.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/skip-waiting-using-registration.https.html b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/skip-waiting-using-registration.https.html
index 68deae7b01155363f0dd13caf7fe40be59110c74..a9c398a260676d976f0aac0ca495aa1a6c94e631 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/skip-waiting-using-registration.https.html
+++ b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/skip-waiting-using-registration.https.html
@@ -1,10 +1,10 @@
<!DOCTYPE html>
<title>Service Worker: Skip waiting using registration</title>
<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>
+'use strict';
promise_test(function(t) {
var scope = 'resources/blank.html?skip-waiting-using-registration';
@@ -13,19 +13,22 @@ promise_test(function(t) {
var frame, frame_sw, sw_registration, oncontrollerchanged;
var saw_controllerchanged = new Promise(function(resolve) {
oncontrollerchanged = function(e) {
- assert_equals(e.type, 'controllerchange',
- 'Event name should be "controllerchange"');
- assert_true(
- e.target instanceof frame.contentWindow.ServiceWorkerContainer,
- 'Event target should be a ServiceWorkerContainer');
- assert_equals(e.target.controller.state, 'activating',
- 'Controller state should be activating');
- assert_equals(
- frame_sw.controller.scriptURL, normalizeURL(url2),
- 'Controller scriptURL should change to the second one');
- resolve();
- };
- });
+ resolve(e);
+ };
+ })
+ .then(function(e) {
+ assert_equals(e.type, 'controllerchange',
+ 'Event name should be "controllerchange"');
+ assert_true(
+ e.target instanceof frame.contentWindow.ServiceWorkerContainer,
+ 'Event target should be a ServiceWorkerContainer');
+ assert_equals(e.target.controller.state, 'activating',
+ 'Controller state should be activating');
+ assert_equals(
+ frame_sw.controller.scriptURL, normalizeURL(url2),
+ 'Controller scriptURL should change to the second one');
+ });
+
return service_worker_unregister_and_register(t, url1, scope)
.then(function(registration) {
return wait_for_state(t, registration.installing, 'activated');
@@ -34,6 +37,9 @@ promise_test(function(t) {
return with_iframe(scope);
})
.then(function(f) {
+ t.add_cleanup(function() {
+ f.remove();
+ });
frame = f;
frame_sw = f.contentWindow.navigator.serviceWorker;
assert_equals(
@@ -44,8 +50,7 @@ promise_test(function(t) {
})
.then(function(registration) {
sw_registration = registration;
- add_completion_callback(function() {
- frame.remove();
+ t.add_cleanup(function() {
registration.unregister();
});
return saw_controllerchanged;

Powered by Google App Engine
This is Rietveld 408576698