mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Update web-platform-tests to revision 2df7f9ff620cbdaa2928464892fb1dfb880fd6c6
This commit is contained in:
parent
97e3c5f3a9
commit
7ba3376dde
74 changed files with 1985 additions and 504 deletions
|
@ -67,6 +67,21 @@ backgroundFetchTest(async (test, backgroundFetch) => {
|
|||
|
||||
}, 'IDs must be unique among active Background Fetch registrations');
|
||||
|
||||
backgroundFetchTest(async (test, backgroundFetch) => {
|
||||
const registrationId = uniqueId();
|
||||
const registration =
|
||||
await backgroundFetch.fetch(registrationId, '');
|
||||
|
||||
assert_equals(registration.id, registrationId);
|
||||
|
||||
const {type, eventRegistration, results} = await getMessageFromServiceWorker();
|
||||
|
||||
assert_equals('backgroundfetchsuccess', type);
|
||||
assert_equals(eventRegistration.result, 'success');
|
||||
assert_equals(eventRegistration.failureReason, '');
|
||||
|
||||
}, 'Empty URL is OK.');
|
||||
|
||||
backgroundFetchTest(async (test, backgroundFetch) => {
|
||||
const registrationId = uniqueId();
|
||||
const registration =
|
||||
|
@ -190,4 +205,20 @@ backgroundFetchTest(async (test, backgroundFetch) => {
|
|||
assert_equals(eventRegistration.result, 'failure');
|
||||
assert_equals(eventRegistration.failureReason, 'bad-status');
|
||||
|
||||
}, 'Using Background Fetch to fetch a non-existent resource should fail.');
|
||||
}, 'Using Background Fetch to fetch a non-existent resource should fail.');
|
||||
|
||||
backgroundFetchTest(async (test, backgroundFetch) => {
|
||||
const registration = await backgroundFetch.fetch(
|
||||
'my-id',
|
||||
['https://example.com', 'http://example.com']);
|
||||
|
||||
const {type, eventRegistration, results} = await getMessageFromServiceWorker();
|
||||
|
||||
assert_equals('backgroundfetchfail', type);
|
||||
assert_equals(eventRegistration.failureReason, 'fetch-error');
|
||||
|
||||
assert_equals(results.length, 2);
|
||||
assert_true(results[0].url.includes('https://example.com'));
|
||||
assert_equals(results[1].url, '');
|
||||
|
||||
}, 'Fetches with mixed content should fail.');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue