mirror of
https://github.com/servo/servo.git
synced 2025-08-17 11:25:35 +01:00
Update web-platform-tests to revision 86e157b387e63ba586d8ad51d2fcd5690626f5ad
This commit is contained in:
parent
bc82521eb7
commit
b642b70974
54 changed files with 728 additions and 480 deletions
|
@ -74,7 +74,7 @@ backgroundFetchTest(async (test, backgroundFetch) => {
|
|||
// Skip `downloaded`, as the transfer may have started already.
|
||||
|
||||
const {type, results} = await getMessageFromServiceWorker();
|
||||
assert_equals('backgroundfetched', type);
|
||||
assert_equals('backgroundfetchsuccess', type);
|
||||
assert_equals(results.length, 1);
|
||||
|
||||
assert_true(results[0].url.includes('resources/feature-name.txt'));
|
||||
|
|
|
@ -2,7 +2,7 @@ importScripts('sw-helpers.js');
|
|||
|
||||
async function updateUI(event) {
|
||||
let updateParams = [];
|
||||
switch (event.id) {
|
||||
switch (event.registration.id) {
|
||||
case 'update-once':
|
||||
updateParams = [{title: 'Title1'}];
|
||||
break;
|
||||
|
@ -16,7 +16,7 @@ async function updateUI(event) {
|
|||
.catch(e => e.message);
|
||||
}
|
||||
|
||||
self.addEventListener('backgroundfetched', event => {
|
||||
self.addEventListener('backgroundfetchsuccess', event => {
|
||||
event.waitUntil(updateUI(event)
|
||||
.then(update => sendMessageToDocument({ type: event.type, update })))
|
||||
});
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
|
||||
importScripts('sw-helpers.js');
|
||||
|
||||
async function getFetchResult(settledFetch) {
|
||||
|
@ -11,7 +12,7 @@ async function getFetchResult(settledFetch) {
|
|||
};
|
||||
}
|
||||
|
||||
self.addEventListener('backgroundfetched', event => {
|
||||
self.addEventListener('backgroundfetchsuccess', event => {
|
||||
event.waitUntil(
|
||||
event.fetches.values()
|
||||
.then(fetches => Promise.all(fetches.map(fetch => getFetchResult(fetch))))
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// META: script=resources/utils.js
|
||||
'use strict';
|
||||
|
||||
// Covers functionality provided by BackgroundFetchUpdateEvent.updateUI().
|
||||
// Covers functionality provided by BackgroundFetchUpdateUIEvent.updateUI().
|
||||
//
|
||||
// https://wicg.github.io/background-fetch/#backgroundfetchupdateuievent
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue