Update web-platform-tests to revision c2b30ef30749b6a8f2cc832761dfe011e63d5e94

This commit is contained in:
WPT Sync Bot 2018-10-05 21:34:34 -04:00
parent 987e376ca7
commit eda9b9b73a
142 changed files with 3513 additions and 851 deletions

View file

@ -82,6 +82,41 @@ backgroundFetchTest(async (test, backgroundFetch) => {
}, 'Empty URL is OK.');
backgroundFetchTest(async (test, backgroundFetch) => {
const registrationId = uniqueId();
const registration =
await backgroundFetch.fetch(registrationId,
new Request('https://example/com', {
method: 'PUT',
}));
assert_equals(registration.id, registrationId);
const {type, eventRegistration, results} = await getMessageFromServiceWorker();
assert_equals(type, 'backgroundfetchsuccess');
assert_equals(eventRegistration.result, 'success');
assert_equals(eventRegistration.failureReason, '');
}, 'Requests with PUT method require CORS Preflight and succeed.');
backgroundFetchTest(async (test, backgroundFetch) => {
const registrationId = uniqueId();
const registration =
await backgroundFetch.fetch(registrationId,
new Request('https://example/com', {
method: 'POST',
headers: {'Content-Type': 'text/json'}
}));
assert_equals(registration.id, registrationId);
const {type, eventRegistration, results} = await getMessageFromServiceWorker();
assert_equals(type, 'backgroundfetchsuccess');
assert_equals(eventRegistration.result, 'success');
assert_equals(eventRegistration.failureReason, '');
}, 'Requests with text/json content type require CORS Preflight and succeed.');
backgroundFetchTest(async (test, backgroundFetch) => {
const registrationId = uniqueId();
const registration =