mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 15:23:51 +00:00
Bug 1434599 - Enable test_workerupdatefoundevent.html. r=bkelly
--HG-- extra : rebase_source : 3e5e40dec9190a3f359c2dd51c0634ab93b9a757
This commit is contained in:
parent
974faf875d
commit
fb0b064981
@ -341,7 +341,6 @@ tags = openwindow
|
||||
[test_workerUnregister.html]
|
||||
[test_workerUpdate.html]
|
||||
[test_workerupdatefoundevent.html]
|
||||
skip-if = !e10s # Bug 1433276
|
||||
[test_xslt.html]
|
||||
[test_async_waituntil.html]
|
||||
[test_worker_reference_gc_timeout.html]
|
||||
|
@ -22,6 +22,17 @@
|
||||
registration = await navigator.serviceWorker.register("worker_updatefoundevent.js",
|
||||
{ scope: "./updatefoundevent.html" })
|
||||
await waitForState(registration.installing, 'activated');
|
||||
|
||||
content = document.getElementById("content");
|
||||
iframe = document.createElement("iframe");
|
||||
content.appendChild(iframe);
|
||||
iframe.setAttribute("src", "./updatefoundevent.html");
|
||||
|
||||
await new Promise(function(resolve) { iframe.onload = resolve; });
|
||||
ok(iframe.contentWindow.navigator.serviceWorker.controller, "Controlled client.");
|
||||
|
||||
return Promise.resolve();
|
||||
|
||||
}
|
||||
|
||||
function startWaitForUpdateFound() {
|
||||
@ -38,11 +49,6 @@
|
||||
}
|
||||
});
|
||||
|
||||
content = document.getElementById("content");
|
||||
iframe = document.createElement("iframe");
|
||||
content.appendChild(iframe);
|
||||
iframe.setAttribute("src", "./updatefoundevent.html");
|
||||
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,9 @@
|
||||
registration.onupdatefound = function(e) {
|
||||
clients.matchAll().then(function(clients) {
|
||||
if (!clients.length) {
|
||||
reject("No clients found");
|
||||
// We don't control any clients when the first update event is fired
|
||||
// because we haven't reached the 'activated' state.
|
||||
return;
|
||||
}
|
||||
|
||||
if (registration.scope.match(/updatefoundevent\.html$/)) {
|
||||
|
Loading…
Reference in New Issue
Block a user