From 077ca4532f8e642660abd123b7f010cba9f3fe26 Mon Sep 17 00:00:00 2001 From: Nikolay Vitkov <34244704+Lightning00Blade@users.noreply.github.com> Date: Mon, 3 Jun 2024 22:26:03 +0200 Subject: [PATCH] chore(build): update `chromium-bidi` to 0.5.20 (#12513) Co-authored-by: Alex Rudenko --- package-lock.json | 16 ++++++++-------- packages/puppeteer-core/package.json | 2 +- packages/puppeteer-core/src/api/HTTPRequest.ts | 4 +++- packages/puppeteer-core/src/bidi/Connection.ts | 2 +- test/TestExpectations.json | 14 -------------- test/src/requestinterception.spec.ts | 8 ++++++-- 6 files changed, 19 insertions(+), 27 deletions(-) diff --git a/package-lock.json b/package-lock.json index 20a51b2b648..2f5f7ed4b8d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12517,7 +12517,7 @@ "license": "Apache-2.0", "dependencies": { "@puppeteer/browsers": "2.2.3", - "chromium-bidi": "0.5.19", + "chromium-bidi": "0.5.20", "debug": "4.3.4", "devtools-protocol": "0.0.1286932", "ws": "8.17.0" @@ -12541,22 +12541,22 @@ "license": "MIT" }, "packages/puppeteer-core/node_modules/chromium-bidi": { - "version": "0.5.19", - "resolved": "https://registry.npmjs.org/chromium-bidi/-/chromium-bidi-0.5.19.tgz", - "integrity": "sha512-UA6zL77b7RYCjJkZBsZ0wlvCTD+jTjllZ8f6wdO4buevXgTZYjV+XLB9CiEa2OuuTGGTLnI7eN9I60YxuALGQg==", + "version": "0.5.20", + "resolved": "https://registry.npmjs.org/chromium-bidi/-/chromium-bidi-0.5.20.tgz", + "integrity": "sha512-RZa5N+VXCQ5W3wp0KynCtljy7bglk1VaB82H7a5OKiXGUOiz5G4CEwo89ovOk/DtvkLULr5AoQaG5O7VUxlZyQ==", "dependencies": { "mitt": "3.0.1", "urlpattern-polyfill": "10.0.0", - "zod": "3.22.4" + "zod": "3.23.5" }, "peerDependencies": { "devtools-protocol": "*" } }, "packages/puppeteer-core/node_modules/chromium-bidi/node_modules/zod": { - "version": "3.22.4", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.22.4.tgz", - "integrity": "sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==", + "version": "3.23.5", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.23.5.tgz", + "integrity": "sha512-fkwiq0VIQTksNNA131rDOsVJcns0pfVUjHzLrNBiF/O/Xxb5lQyEXkhZWcJ7npWsYlvs+h0jFWXXy4X46Em1JA==", "funding": { "url": "https://github.com/sponsors/colinhacks" } diff --git a/packages/puppeteer-core/package.json b/packages/puppeteer-core/package.json index 072164d13d9..1de7f9502a6 100644 --- a/packages/puppeteer-core/package.json +++ b/packages/puppeteer-core/package.json @@ -120,7 +120,7 @@ "license": "Apache-2.0", "dependencies": { "@puppeteer/browsers": "2.2.3", - "chromium-bidi": "0.5.19", + "chromium-bidi": "0.5.20", "debug": "4.3.4", "devtools-protocol": "0.0.1286932", "ws": "8.17.0" diff --git a/packages/puppeteer-core/src/api/HTTPRequest.ts b/packages/puppeteer-core/src/api/HTTPRequest.ts index 29af3b69575..c780d59ec22 100644 --- a/packages/puppeteer-core/src/api/HTTPRequest.ts +++ b/packages/puppeteer-core/src/api/HTTPRequest.ts @@ -707,7 +707,9 @@ export function handleError(error: ProtocolError): void { // 'Expected "header" [...]'. if ( error.originalMessage.includes('Invalid header') || - error.originalMessage.includes('Expected "header"') + error.originalMessage.includes('Expected "header"') || + // WebDriver BiDi error for invalid values, for example, headers. + error.originalMessage.includes('invalid argument') ) { throw error; } diff --git a/packages/puppeteer-core/src/bidi/Connection.ts b/packages/puppeteer-core/src/bidi/Connection.ts index 5e19390371f..5bcf1f1fdd7 100644 --- a/packages/puppeteer-core/src/bidi/Connection.ts +++ b/packages/puppeteer-core/src/bidi/Connection.ts @@ -136,7 +136,7 @@ export class BidiConnection this.#callbacks.reject( object.id, createProtocolError(object), - object.message + `${object.error}: ${object.message}` ); return; case 'event': diff --git a/test/TestExpectations.json b/test/TestExpectations.json index 895c6ff8621..0981981b304 100644 --- a/test/TestExpectations.json +++ b/test/TestExpectations.json @@ -2561,20 +2561,6 @@ "expectations": ["FAIL", "PASS"], "comment": "TODO: add a comment explaining why this expectation is required (include links to issues)" }, - { - "testIdPattern": "[network.spec] network raw network headers Same-origin set-cookie navigation", - "platforms": ["darwin", "linux", "win32"], - "parameters": ["chrome", "webDriverBiDi"], - "expectations": ["FAIL"], - "comment": "TODO: add a comment explaining why this expectation is required (include links to issues)" - }, - { - "testIdPattern": "[network.spec] network raw network headers Same-origin set-cookie subresource", - "platforms": ["darwin", "linux", "win32"], - "parameters": ["chrome", "webDriverBiDi"], - "expectations": ["FAIL"], - "comment": "TODO: add a comment explaining why this expectation is required (include links to issues)" - }, { "testIdPattern": "[network.spec] network raw network headers Same-origin set-cookie subresource", "platforms": ["darwin", "linux", "win32"], diff --git a/test/src/requestinterception.spec.ts b/test/src/requestinterception.spec.ts index cddc83b9582..1a8cfd80c1d 100644 --- a/test/src/requestinterception.spec.ts +++ b/test/src/requestinterception.spec.ts @@ -770,7 +770,9 @@ describe('request interception', function () { await request.continue(); }); await page.goto(server.PREFIX + '/empty.html'); - expect(error.message).toMatch(/Invalid header|Expected "header"/); + expect(error.message).toMatch( + /Invalid header|Expected "header"|invalid argument/ + ); }); }); @@ -938,7 +940,9 @@ describe('request interception', function () { }); }); await page.goto(server.PREFIX + '/empty.html'); - expect(error.message).toMatch(/Invalid header|Expected "header"/); + expect(error.message).toMatch( + /Invalid header|Expected "header"|invalid argument/ + ); }); });