parent
2b21a5f6ad
commit
7981e4e3da
|
|
@ -6,7 +6,7 @@
|
|||
},
|
||||
{
|
||||
"name": "firefox",
|
||||
"revision": "1097"
|
||||
"revision": "1098"
|
||||
},
|
||||
{
|
||||
"name": "webkit",
|
||||
|
|
|
|||
|
|
@ -137,6 +137,10 @@ const causeToResourceType: {[key: string]: string} = {
|
|||
TYPE_WEB_MANIFEST: 'manifest',
|
||||
};
|
||||
|
||||
const internalCauseToResourceType: {[key: string]: string} = {
|
||||
TYPE_INTERNAL_EVENTSOURCE: 'eventsource',
|
||||
};
|
||||
|
||||
class InterceptableRequest implements network.RouteDelegate {
|
||||
readonly request: network.Request;
|
||||
_id: string;
|
||||
|
|
@ -151,7 +155,7 @@ class InterceptableRequest implements network.RouteDelegate {
|
|||
headers[name.toLowerCase()] = value;
|
||||
|
||||
this.request = new network.Request(payload.isIntercepted ? this : null, frame, redirectedFrom ? redirectedFrom.request : null, payload.navigationId,
|
||||
payload.url, causeToResourceType[payload.cause] || 'other', payload.method, payload.postData || null, headers);
|
||||
payload.url, internalCauseToResourceType[payload.internalCause] || causeToResourceType[payload.cause] || 'other', payload.method, payload.postData || null, headers);
|
||||
}
|
||||
|
||||
async continue(overrides: { method?: string; headers?: network.Headers; postData?: string }) {
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ export class WKInterceptableRequest implements network.RouteDelegate {
|
|||
constructor(session: WKSession, allowInterception: boolean, frame: frames.Frame, event: Protocol.Network.requestWillBeSentPayload, redirectedFrom: network.Request | null, documentId: string | undefined) {
|
||||
this._session = session;
|
||||
this._requestId = event.requestId;
|
||||
const resourceType = event.type ? event.type.toLowerCase() : (redirectedFrom ? redirectedFrom.resourceType() : 'unknown');
|
||||
const resourceType = event.type ? event.type.toLowerCase() : (redirectedFrom ? redirectedFrom.resourceType() : 'other');
|
||||
this.request = new network.Request(allowInterception ? this : null, frame, redirectedFrom, documentId, event.request.url,
|
||||
resourceType, event.request.method, event.request.postData || null, headersObject(event.request.headers));
|
||||
this._interceptedPromise = new Promise(f => this._interceptedCallback = f);
|
||||
|
|
|
|||
|
|
@ -260,7 +260,7 @@ describe('Response.statusText', function() {
|
|||
});
|
||||
|
||||
describe('Request.resourceType', function() {
|
||||
it.fail(FFOX || WEBKIT)('should return event source', async ({page, server}) => {
|
||||
it.fail(WEBKIT)('should return event source', async ({page, server}) => {
|
||||
const SSE_MESSAGE = {foo: 'bar'};
|
||||
// 1. Setup server-sent events on server that immediately sends a message to the client.
|
||||
server.setRoute('/sse', (req, res) => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue