small-payload.https.window.js (767B)
1 // META: script=/common/get-host-info.sub.js 2 // META: script=/common/utils.js 3 // META: script=/fetch/fetch-later/resources/fetch-later-helper.js 4 'use strict'; 5 6 const {HTTPS_NOTSAMESITE_ORIGIN} = get_host_info(); 7 const SMALL_REQUEST_BODY_SIZE = 20; 8 9 for (const dataType in BeaconDataType) { 10 // In a cross-origin iframe, test making a POST request with small 11 // payload. 12 parallelPromiseTest( 13 async _ => await loadFetchLaterIframe(HTTPS_NOTSAMESITE_ORIGIN, { 14 activateAfter: 0, 15 method: 'POST', 16 bodyType: dataType, 17 bodySize: SMALL_REQUEST_BODY_SIZE, 18 }), 19 `fetchLater() accepts payload[size=${ 20 SMALL_REQUEST_BODY_SIZE}] in a POST request body of ${ 21 dataType} in a default cross-origin iframe.`); 22 }