(async function(/** @type {import('test_runner').TestRunner} */ testRunner) {
var {page, session, dp} = await testRunner.startBlank(
`Tests modifying a GET into a POST.`);
var InterceptionHelper = await testRunner.loadScript('../resources/interception-test.js');
var helper = new InterceptionHelper(testRunner, session);
var requestInterceptedDict = {
'redirect-iframe.html': event => helper.allowRequest(event),
'redirect1.pl': event => helper.modifyRequest(event, {url: 'post-echo.pl', method: 'POST', postData: `console.log('POST MODIFICATION SUCCESS!');`}),
};
await helper.startInterceptionTest(requestInterceptedDict, 1);
session.evaluate(`
var iframe = document.createElement('iframe');
iframe.src = '${testRunner.url('./resources/redirect-iframe.html')}';
document.body.appendChild(iframe);
`);
})