blob: bbbccada29d03f862ae4e90967e2e8f094fce0f9 [file] [log] [blame]
(async function(testRunner) {
var {page, session, dp} = await testRunner.startBlank(
`Tests a mock 404 resource.`);
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.mockResponse(event, 'HTTP/1.1 404 Not Found\r\n\r\n'),
};
await helper.startInterceptionTest(requestInterceptedDict);
session.evaluate(`
var iframe = document.createElement('iframe');
iframe.src = '${testRunner.url('./resources/redirect-iframe.html')}';
document.body.appendChild(iframe);
`);
})