From ab42c6d20fe627c4580ca1f0d5f6fbd106cbe04f Mon Sep 17 00:00:00 2001 From: Asami Doi Date: Fri, 16 Nov 2018 00:03:03 -0800 Subject: [PATCH] ServiceWorker: Add t.add_cleanup() in WPT tests. This CL adds t.add_cleanup() that calls service_worker_unregister() in WPT tests to ensure registrations are removed on test completion. Bug: 824647 Change-Id: Ieb790d4d7f63fc4810f6062d7e288aad1e88f45d Reviewed-on: https://chromium-review.googlesource.com/c/1328545 Commit-Queue: Hiroki Nakagawa Reviewed-by: Hiroki Nakagawa Reviewed-by: Matt Falkenhagen Cr-Commit-Position: refs/heads/master@{#608693} --- service-workers/service-worker/import-module-scripts.https.html | 1 + 1 file changed, 1 insertion(+) diff --git a/service-workers/service-worker/import-module-scripts.https.html b/service-workers/service-worker/import-module-scripts.https.html index e82911a1bd002d..7bca8de64f5bc9 100644 --- a/service-workers/service-worker/import-module-scripts.https.html +++ b/service-workers/service-worker/import-module-scripts.https.html @@ -13,6 +13,7 @@ navigator.serviceWorker.onmessage = resolve; }); await service_worker_unregister(t, testCase.scriptURL); + t.add_cleanup(() => service_worker_unregister(t, testCase.scriptURL)); const registration = await navigator.serviceWorker.register( testCase.scriptURL, { scope: testCase.scriptURL, type: 'module' });