Skip to content

Commit

Permalink
ServiceWorker: Add t.add_cleanup() in WPT tests.
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Hiroki Nakagawa <[email protected]>
Reviewed-by: Matt Falkenhagen <[email protected]>
Cr-Commit-Position: refs/heads/master@{#608693}
  • Loading branch information
Asami Doi authored and chromium-wpt-export-bot committed Nov 16, 2018
1 parent 706ee77 commit ab42c6d
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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' });
Expand Down

0 comments on commit ab42c6d

Please sign in to comment.