blob: 76a555bb46af3adb4c3cc1d32ac1b81acf936974 [file] [log] [blame]
(async function(testRunner) {
var {page, session, dp} = await testRunner.startBlank(
'Verifies that we can retrieve a request body consisting of blob in service worker.');
await Promise.all([
dp.Target.setDiscoverTargets({discover: true}),
dp.Target.setAutoAttach({autoAttach: true, waitForDebuggerOnStart: false, flatten: true}),
]);
const swTargetPromises = [
dp.Target.onceTargetCreated(),
dp.Target.onceAttachedToTarget(),
];
await session.evaluate(`new Worker('/inspector-protocol/network/resources/worker.js')`);
const [swTarget, swAttachedEvent] = await Promise.all(swTargetPromises);
testRunner.log("OK");
const swdp = session.createChild(swAttachedEvent.params.sessionId).protocol;
const result = await swdp.Network.enable();
testRunner.log(result);
const url = `http://localhost:8000/inspector-protocol/network/resources/source.map`;
const response1 = await swdp.Network.loadNetworkResource({frameId: "", url, options: {disableCache:false, includeCredentials: false}});
testRunner.log(response1, `Response for fetch with existing resource: `, ["headers", "id", "sessionId"]);
testRunner.completeTest();
});