mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 10:00:54 +00:00
Bug 1254746 - Fix browser_service_workers_start.js intermittent when the worker is killed sooner than expected. r=jryans
This commit is contained in:
parent
3212a68758
commit
4bc9677f7d
@ -55,12 +55,18 @@ add_task(function* () {
|
||||
ok(name, "Found the service worker in the list");
|
||||
let targetElement = name.parentNode.parentNode;
|
||||
|
||||
// Check that there is a Debug button but not a Start button.
|
||||
ok(targetElement.querySelector(".debug-button"), "Found its debug button");
|
||||
ok(!targetElement.querySelector(".start-button"), "No start button");
|
||||
// The service worker may already be killed with the low 1s timeout
|
||||
if (!targetElement.querySelector(".start-button")) {
|
||||
// Check that there is a Debug button but not a Start button.
|
||||
ok(targetElement.querySelector(".debug-button"), "Found its debug button");
|
||||
|
||||
// Wait for the service worker to be killed due to inactivity.
|
||||
yield waitForMutation(targetElement, { childList: true });
|
||||
// Wait for the service worker to be killed due to inactivity.
|
||||
yield waitForMutation(targetElement, { childList: true });
|
||||
} else {
|
||||
// Check that there is no Debug button when the SW is already shut down.
|
||||
ok(!targetElement.querySelector(".debug-button"), "No debug button when " +
|
||||
"the worker is already killed");
|
||||
}
|
||||
|
||||
// We should now have a Start button but no Debug button.
|
||||
let startBtn = targetElement.querySelector(".start-button");
|
||||
|
Loading…
Reference in New Issue
Block a user