Bug 1506089 [wpt PR 14002] - ServiceWorker: Add t.add_cleanup() in WPT tests., a=testonly

Automatic update from web-platform-testsServiceWorker: 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 <nhiroki@chromium.org>
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Reviewed-by: Matt Falkenhagen <falken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#608693}

--

wpt-commits: ab42c6d20fe627c4580ca1f0d5f6fbd106cbe04f
wpt-pr: 14002
This commit is contained in:
Asami Doi 2018-11-19 18:46:03 +00:00 committed by moz-wptsync-bot
parent 72300c2a58
commit ccf4c80cca

View File

@ -13,6 +13,7 @@ function import_test(testCase) {
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' });