Update web-platform-tests to revision b382ac7192087da0a7439902e20be76ab7587ee8

This commit is contained in:
WPT Sync Bot 2018-08-10 21:31:07 -04:00
parent 3e96a322ae
commit defee2aae0
45 changed files with 645 additions and 189 deletions

View file

@ -0,0 +1,32 @@
// META: script=/service-workers/service-worker/resources/test-helpers.sub.js
// META: script=resources/utils.js
'use strict';
// Covers functionality provided by BackgroundFetchUpdateEvent.updateUI().
//
// https://wicg.github.io/background-fetch/#backgroundfetchupdateuievent
const swName = 'sw-update-ui.js';
backgroundFetchTest(async (test, backgroundFetch) => {
const registrationId = 'update-once';
const registration =
await backgroundFetch.fetch(registrationId, 'resources/feature-name.txt');
assert_equals(registration.id, registrationId);
const message = await getMessageFromServiceWorker();
assert_equals(message.update, 'update success');
}, 'Background Fetch updateUI resolves', swName);
backgroundFetchTest(async (test, backgroundFetch) => {
const registrationId = 'update-twice';
const registration =
await backgroundFetch.fetch(registrationId, 'resources/feature-name.txt');
assert_equals(registration.id, registrationId);
const message = await getMessageFromServiceWorker();
assert_equals(message.update, 'updateUI may only be called once.');
}, 'Background Fetch updateUI called twice fails', swName);