test: Update expectations for firefox support of continueRequest (#12483)

Co-authored-by: Alex Rudenko <alexrudenko@chromium.org>
This commit is contained in:
Julian Descottes 2024-05-29 10:47:40 +02:00 committed by GitHub
parent 5c65f54046
commit 33beb50903
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 14 additions and 111 deletions

View File

@ -703,7 +703,12 @@ const errorReasons: Record<ErrorCode, Protocol.Network.ErrorReason> = {
* @internal * @internal
*/ */
export function handleError(error: ProtocolError): void { export function handleError(error: ProtocolError): void {
if (error.originalMessage.includes('Invalid header')) { // Firefox throws an invalid argument error with a message starting with
// 'Expected "header" [...]'.
if (
error.originalMessage.includes('Invalid header') ||
error.originalMessage.includes('Expected "header"')
) {
throw error; throw error;
} }
// In certain cases, protocol will return error if the request was // In certain cases, protocol will return error if the request was

View File

@ -502,13 +502,6 @@
"expectations": ["FAIL"], "expectations": ["FAIL"],
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)" "comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
}, },
{
"testIdPattern": "[network.spec] network Page.setExtraHTTPHeaders *",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["SKIP"],
"comment": "Firefox does not support headers override"
},
{ {
"testIdPattern": "[network.spec] network Request.initiator should return the initiator", "testIdPattern": "[network.spec] network Request.initiator should return the initiator",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],
@ -737,13 +730,6 @@
"expectations": ["FAIL"], "expectations": ["FAIL"],
"comment": "BiDi spec expect the request to not trim the hash" "comment": "BiDi spec expect the request to not trim the hash"
}, },
{
"testIdPattern": "[requestinterception-experimental.spec] cooperative request interception Request.continue *",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["SKIP"],
"comment": "TODO: Needs full support for continueRequest in Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1850680"
},
{ {
"testIdPattern": "[requestinterception-experimental.spec] cooperative request interception Request.resourceType should work for document type", "testIdPattern": "[requestinterception-experimental.spec] cooperative request interception Request.resourceType should work for document type",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],
@ -807,13 +793,6 @@
"expectations": ["FAIL"], "expectations": ["FAIL"],
"comment": "`HTTPRequest.resourceType()` has no eqivalent in BiDi spec" "comment": "`HTTPRequest.resourceType()` has no eqivalent in BiDi spec"
}, },
{
"testIdPattern": "[requestinterception.spec] request interception Request.continue *",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["SKIP"],
"comment": "TODO: Needs full support for continueRequest in Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1850680"
},
{ {
"testIdPattern": "[requestinterception.spec] request interception Request.resourceType should work for document type", "testIdPattern": "[requestinterception.spec] request interception Request.resourceType should work for document type",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],
@ -2659,12 +2638,6 @@
"expectations": ["TIMEOUT"], "expectations": ["TIMEOUT"],
"comment": "When navigating to page with authentication the command response (error) never comes without interception" "comment": "When navigating to page with authentication the command response (error) never comes without interception"
}, },
{
"testIdPattern": "[network.spec] network Page.setExtraHTTPHeaders should throw for non-string header values",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["PASS"]
},
{ {
"testIdPattern": "[network.spec] network Page.setExtraHTTPHeaders should work", "testIdPattern": "[network.spec] network Page.setExtraHTTPHeaders should work",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],
@ -3405,20 +3378,6 @@
"expectations": ["SKIP"], "expectations": ["SKIP"],
"comment": "TODO: Needs support for enabling cache in BiDi without CDP https://github.com/w3c/webdriver-bidi/issues/582" "comment": "TODO: Needs support for enabling cache in BiDi without CDP https://github.com/w3c/webdriver-bidi/issues/582"
}, },
{
"testIdPattern": "[requestinterception-experimental.spec] cooperative request interception Page.setRequestInterception should send referer",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["SKIP"],
"comment": "Firefox does not support headers override"
},
{
"testIdPattern": "[requestinterception-experimental.spec] cooperative request interception Page.setRequestInterception should show custom HTTP headers",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["SKIP"],
"comment": "Firefox does not support headers override"
},
{ {
"testIdPattern": "[requestinterception-experimental.spec] cooperative request interception Page.setRequestInterception should work when header manipulation headers with redirect", "testIdPattern": "[requestinterception-experimental.spec] cooperative request interception Page.setRequestInterception should work when header manipulation headers with redirect",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],
@ -3426,13 +3385,6 @@
"expectations": ["SKIP"], "expectations": ["SKIP"],
"comment": "TODO: Needs investigation, on Firefox the test is passing even if headers are not actually modified" "comment": "TODO: Needs investigation, on Firefox the test is passing even if headers are not actually modified"
}, },
{
"testIdPattern": "[requestinterception-experimental.spec] cooperative request interception Page.setRequestInterception should work with custom referer headers",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["SKIP"],
"comment": "Firefox does not support headers override"
},
{ {
"testIdPattern": "[requestinterception-experimental.spec] cooperative request interception Page.setRequestInterception should work with encoded server - 2", "testIdPattern": "[requestinterception-experimental.spec] cooperative request interception Page.setRequestInterception should work with encoded server - 2",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],
@ -3440,13 +3392,6 @@
"expectations": ["SKIP"], "expectations": ["SKIP"],
"comment": "TODO: Needs support for data URIs in Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1805176" "comment": "TODO: Needs support for data URIs in Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1805176"
}, },
{
"testIdPattern": "[requestinterception-experimental.spec] cooperative request interception Page.setRequestInterception should work with equal requests",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["FAIL"],
"comment": "TODO: Needs investigation, it looks like Firefox lets the request go also to the server"
},
{ {
"testIdPattern": "[requestinterception-experimental.spec] cooperative request interception Page.setRequestInterception should work with file URLs", "testIdPattern": "[requestinterception-experimental.spec] cooperative request interception Page.setRequestInterception should work with file URLs",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],
@ -3476,10 +3421,11 @@
"comment": "Test requires CDP" "comment": "Test requires CDP"
}, },
{ {
"testIdPattern": "[requestinterception-experimental.spec] cooperative request interception Request.continue should work", "testIdPattern": "[requestinterception-experimental.spec] cooperative request interception Request.continue should redirect in a way non-observable to page",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"], "parameters": ["firefox", "webDriverBiDi"],
"expectations": ["PASS"] "expectations": ["FAIL"],
"comment": "Firefox needs support for the url parameter of continueRequest"
}, },
{ {
"testIdPattern": "[requestinterception-experimental.spec] cooperative request interception Request.respond should indicate already-handled if an intercept has been handled", "testIdPattern": "[requestinterception-experimental.spec] cooperative request interception Request.respond should indicate already-handled if an intercept has been handled",
@ -3578,34 +3524,6 @@
"expectations": ["SKIP"], "expectations": ["SKIP"],
"comment": "TODO: Needs support for enabling cache in BiDi without CDP https://github.com/w3c/webdriver-bidi/issues/582" "comment": "TODO: Needs support for enabling cache in BiDi without CDP https://github.com/w3c/webdriver-bidi/issues/582"
}, },
{
"testIdPattern": "[requestinterception.spec] request interception Page.setRequestInterception should send referer",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["FAIL"],
"comment": "Firefox does not support headers override"
},
{
"testIdPattern": "[requestinterception.spec] request interception Page.setRequestInterception should send referer",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["SKIP"],
"comment": "Firefox does not support headers override"
},
{
"testIdPattern": "[requestinterception.spec] request interception Page.setRequestInterception should show custom HTTP headers",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["FAIL"],
"comment": "Firefox does not support headers override"
},
{
"testIdPattern": "[requestinterception.spec] request interception Page.setRequestInterception should show custom HTTP headers",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["SKIP"],
"comment": "Firefox does not support headers override"
},
{ {
"testIdPattern": "[requestinterception.spec] request interception Page.setRequestInterception should work when header manipulation headers with redirect", "testIdPattern": "[requestinterception.spec] request interception Page.setRequestInterception should work when header manipulation headers with redirect",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],
@ -3613,20 +3531,6 @@
"expectations": ["SKIP"], "expectations": ["SKIP"],
"comment": "TODO: Needs investigation, on Firefox the test is passing even if headers are not actually modified" "comment": "TODO: Needs investigation, on Firefox the test is passing even if headers are not actually modified"
}, },
{
"testIdPattern": "[requestinterception.spec] request interception Page.setRequestInterception should work with custom referer headers",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["FAIL"],
"comment": "Firefox does not support headers override"
},
{
"testIdPattern": "[requestinterception.spec] request interception Page.setRequestInterception should work with custom referer headers",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["SKIP"],
"comment": "Firefox does not support headers override"
},
{ {
"testIdPattern": "[requestinterception.spec] request interception Page.setRequestInterception should work with encoded server - 2", "testIdPattern": "[requestinterception.spec] request interception Page.setRequestInterception should work with encoded server - 2",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],
@ -3634,13 +3538,6 @@
"expectations": ["SKIP"], "expectations": ["SKIP"],
"comment": "TODO: Needs support for data URIs in Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1805176" "comment": "TODO: Needs support for data URIs in Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1805176"
}, },
{
"testIdPattern": "[requestinterception.spec] request interception Page.setRequestInterception should work with equal requests",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["FAIL"],
"comment": "TODO: Needs investigation"
},
{ {
"testIdPattern": "[requestinterception.spec] request interception Page.setRequestInterception should work with file URLs", "testIdPattern": "[requestinterception.spec] request interception Page.setRequestInterception should work with file URLs",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],
@ -3677,10 +3574,11 @@
"comment": "CDP specific issue, maybe we can support it from BiDi+" "comment": "CDP specific issue, maybe we can support it from BiDi+"
}, },
{ {
"testIdPattern": "[requestinterception.spec] request interception Request.continue should work", "testIdPattern": "[requestinterception.spec] request interception Request.continue should redirect in a way non-observable to page",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"], "parameters": ["firefox", "webDriverBiDi"],
"expectations": ["PASS"] "expectations": ["FAIL"],
"comment": "Firefox needs support for the url parameter of continueRequest"
}, },
{ {
"testIdPattern": "[screenshot.spec] Screenshots Cdp should use scale for clip", "testIdPattern": "[screenshot.spec] Screenshots Cdp should use scale for clip",

View File

@ -760,7 +760,7 @@ describe('request interception', function () {
await request.continue(); await request.continue();
}); });
await page.goto(server.PREFIX + '/empty.html'); await page.goto(server.PREFIX + '/empty.html');
expect(error.message).toMatch(/Invalid header/); expect(error.message).toMatch(/Invalid header|Expected "header"/);
}); });
}); });
@ -928,7 +928,7 @@ describe('request interception', function () {
}); });
}); });
await page.goto(server.PREFIX + '/empty.html'); await page.goto(server.PREFIX + '/empty.html');
expect(error.message).toMatch(/Invalid header/); expect(error.message).toMatch(/Invalid header|Expected "header"/);
}); });
}); });