Update web-platform-tests to revision 86e157b387e63ba586d8ad51d2fcd5690626f5ad

This commit is contained in:
WPT Sync Bot 2018-08-14 21:27:05 -04:00
parent bc82521eb7
commit b642b70974
54 changed files with 728 additions and 480 deletions

View file

@ -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'));

View file

@ -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 })))
});

View file

@ -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))))

View file

@ -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