Update web-platform-tests to revision 122a4672fa0dc554a6e7528fa3487fd907c792ee

This commit is contained in:
WPT Sync Bot 2019-03-23 21:54:52 -04:00
parent fb1123495f
commit 93d826f7ba
301 changed files with 4775 additions and 1769 deletions

View file

@ -264,69 +264,6 @@ backgroundFetchTest(async (test, backgroundFetch) => {
}, 'Fetches with mixed content should fail.');
backgroundFetchTest(async (test, backgroundFetch) => {
const registrationId = 'matchexistingrequest';
const registration =
await backgroundFetch.fetch(registrationId, 'resources/feature-name.txt');
assert_equals(registration.id, registrationId);
const {type, eventRegistration, results} = await getMessageFromServiceWorker();
assert_equals('backgroundfetchsuccess', type);
assert_equals(results.length, 1);
assert_equals(eventRegistration.id, registration.id);
assert_equals(eventRegistration.result, 'success');
assert_equals(eventRegistration.failureReason, '');
assert_true(results[0].url.includes('resources/feature-name.txt'));
assert_equals(results[0].status, 200);
assert_equals(results[0].text, 'Background Fetch');
}, 'Matching to a single request should work');
backgroundFetchTest(async (test, backgroundFetch) => {
const registrationId = 'matchmissingrequest';
const registration =
await backgroundFetch.fetch(registrationId, 'resources/feature-name.txt');
assert_equals(registration.id, registrationId);
const {type, eventRegistration, results} = await getMessageFromServiceWorker();
assert_equals('backgroundfetchsuccess', type);
assert_equals(results.length, 0);
assert_equals(eventRegistration.id, registration.id);
assert_equals(eventRegistration.result, 'success');
assert_equals(eventRegistration.failureReason, '');
}, 'Matching to a non-existing request should work');
backgroundFetchTest(async (test, backgroundFetch) => {
const registrationId = 'matchexistingrequesttwice';
const registration =
await backgroundFetch.fetch(registrationId, 'resources/feature-name.txt');
assert_equals(registration.id, registrationId);
const {type, eventRegistration, results} = await getMessageFromServiceWorker();
assert_equals('backgroundfetchsuccess', type);
assert_equals(results.length, 2);
assert_equals(eventRegistration.id, registration.id);
assert_equals(eventRegistration.result, 'success');
assert_equals(eventRegistration.failureReason, '');
assert_true(results[0].url.includes('resources/feature-name.txt'));
assert_equals(results[0].status, 200);
assert_equals(results[0].text, 'Background Fetch');
assert_true(results[1].url.includes('resources/feature-name.txt'));
assert_equals(results[1].status, 200);
assert_equals(results[1].text, 'Background Fetch');
}, 'Matching multiple times on the same request works as expected.');
backgroundFetchTest(async (test, backgroundFetch) => {
const filePath = '/background-fetch/resources/feature-name.txt';
const registration = await backgroundFetch.fetch(
@ -341,15 +278,3 @@ backgroundFetchTest(async (test, backgroundFetch) => {
assert_equals(eventRegistration.id, registration.id);
assert_equals(eventRegistration.downloaded, 0);
}, 'Responses failing CORS checks are not leaked');
backgroundFetchTest(async (test, backgroundFetch) => {
const registration = await backgroundFetch.fetch(
uniqueId(), ['resources/feature-name.txt', '/common/slow.py']);
const record = await registration.match('resources/feature-name.txt');
const response = await record.responseReady;
assert_true(response.url.includes('resources/feature-name.txt'));
const completedResponseText = await response.text();
assert_equals(completedResponseText, 'Background Fetch');
}, 'Access to active fetches is supported.');