mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Update web-platform-tests to revision b382ac7192087da0a7439902e20be76ab7587ee8
This commit is contained in:
parent
3e96a322ae
commit
defee2aae0
45 changed files with 645 additions and 189 deletions
|
@ -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);
|
Loading…
Add table
Add a link
Reference in a new issue