Skip to content

Commit

Permalink
chore: update chromium-bidi (#11179)
Browse files Browse the repository at this point in the history
Co-authored-by: Randolf <jrandolf@google.com>
  • Loading branch information
Lightning00Blade and jrandolf authored Oct 19, 2023
1 parent 20ee325 commit 9d34c09
Show file tree
Hide file tree
Showing 8 changed files with 100 additions and 23 deletions.
26 changes: 13 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/puppeteer-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
"license": "Apache-2.0",
"dependencies": {
"@puppeteer/browsers": "1.7.1",
"chromium-bidi": "0.4.31",
"chromium-bidi": "0.4.32",
"cross-fetch": "4.0.0",
"debug": "4.3.4",
"devtools-protocol": "0.0.1191157",
Expand Down
2 changes: 1 addition & 1 deletion packages/puppeteer-core/src/bidi/BidiOverCdp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import * as BidiMapper from 'chromium-bidi/lib/cjs/bidiMapper/bidiMapper.js';
import * as BidiMapper from 'chromium-bidi/lib/cjs/bidiMapper/BidiMapper.js';
import type * as Bidi from 'chromium-bidi/lib/cjs/protocol/protocol.js';
import type {ProtocolMapping} from 'devtools-protocol/types/protocol-mapping.js';

Expand Down
2 changes: 1 addition & 1 deletion packages/puppeteer-core/src/bidi/Page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ export class BidiPage extends Page {
...(quality === undefined ? {} : {quality: quality / 100}),
},
clip: clip && {
type: 'viewport',
type: 'box',
...clip,
},
});
Expand Down
7 changes: 6 additions & 1 deletion packages/puppeteer-core/src/cdp/Accessibility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,12 @@ class AXNode {

#isTextOnlyObject(): boolean {
const role = this.#role;
return role === 'LineBreak' || role === 'text' || role === 'InlineTextBox';
return (
role === 'LineBreak' ||
role === 'text' ||
role === 'InlineTextBox' ||
role === 'StaticText'
);
}

#hasFocusableChild(): boolean {
Expand Down
8 changes: 7 additions & 1 deletion packages/puppeteer-core/src/common/WaitTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,13 @@ export class WaitTask<T = unknown> {

// We could have tried to evaluate in a context which was already
// destroyed.
if (error.message.includes('Cannot find context with specified id')) {
if (
error.message.includes('Cannot find context with specified id') ||
// Firefox BiDi Error, update one https://github.com/w3c/webdriver-bidi/issues/540 is resolved
error.message.includes(
"destroyed before query 'MessageHandlerFrameParent:sendCommand'"
)
) {
return;
}

Expand Down
66 changes: 66 additions & 0 deletions test/TestExpectations.json
Original file line number Diff line number Diff line change
Expand Up @@ -2261,6 +2261,12 @@
"parameters": ["cdp", "firefox"],
"expectations": ["FAIL", "PASS"]
},
{
"testIdPattern": "[launcher.spec] Launcher specs Puppeteer Puppeteer.launch should take fullPage screenshots when defaultViewport is null",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["FAIL"]
},
{
"testIdPattern": "[launcher.spec] Launcher specs Puppeteer Puppeteer.launch should work with no default arguments",
"platforms": ["darwin", "linux", "win32"],
Expand Down Expand Up @@ -3485,18 +3491,60 @@
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["FAIL"]
},
{
"testIdPattern": "[screenshot.spec] Screenshots ElementHandle.screenshot should scroll element into view",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["FAIL"]
},
{
"testIdPattern": "[screenshot.spec] Screenshots ElementHandle.screenshot should take into account padding and border",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["FAIL"]
},
{
"testIdPattern": "[screenshot.spec] Screenshots ElementHandle.screenshot should work",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["FAIL"]
},
{
"testIdPattern": "[screenshot.spec] Screenshots ElementHandle.screenshot should work for an element with an offset",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["cdp", "firefox"],
"expectations": ["FAIL"]
},
{
"testIdPattern": "[screenshot.spec] Screenshots ElementHandle.screenshot should work for an element with an offset",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["FAIL"]
},
{
"testIdPattern": "[screenshot.spec] Screenshots ElementHandle.screenshot should work for an element with fractional dimensions",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["FAIL"]
},
{
"testIdPattern": "[screenshot.spec] Screenshots ElementHandle.screenshot should work with a null viewport",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["FAIL"]
},
{
"testIdPattern": "[screenshot.spec] Screenshots ElementHandle.screenshot should work with a rotated element",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["cdp", "firefox"],
"expectations": ["FAIL"]
},
{
"testIdPattern": "[screenshot.spec] Screenshots ElementHandle.screenshot should work with a rotated element",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["FAIL"]
},
{
"testIdPattern": "[screenshot.spec] Screenshots Page.screenshot should clip rect",
"platforms": ["darwin", "linux", "win32"],
Expand All @@ -3509,6 +3557,18 @@
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["FAIL"]
},
{
"testIdPattern": "[screenshot.spec] Screenshots Page.screenshot should run in parallel",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["FAIL"]
},
{
"testIdPattern": "[screenshot.spec] Screenshots Page.screenshot should run in parallel in multiple pages",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["FAIL"]
},
{
"testIdPattern": "[screenshot.spec] Screenshots Page.screenshot should take fullPage screenshots",
"platforms": ["darwin", "linux", "win32"],
Expand All @@ -3521,6 +3581,12 @@
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["FAIL"]
},
{
"testIdPattern": "[screenshot.spec] Screenshots Page.screenshot should work with odd clip size on Retina displays",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["FAIL"]
},
{
"testIdPattern": "[stacktrace.spec] Stack trace should work for none error objects",
"platforms": ["darwin", "linux", "win32"],
Expand Down
10 changes: 5 additions & 5 deletions test/src/accessibility.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ describe('Accessibility', function () {
},
],
};
expect(await page.accessibility.snapshot()).toEqual(golden);
expect(await page.accessibility.snapshot()).toMatchObject(golden);
});
it('should report uninteresting nodes', async () => {
const {page, isFirefox} = await getTestState();
Expand Down Expand Up @@ -158,7 +158,7 @@ describe('Accessibility', function () {
findFocusedNode(
await page.accessibility.snapshot({interestingOnly: false})
)
).toEqual(golden);
).toMatchObject(golden);
});
it('get snapshots while the tree is re-calculated', async () => {
// see https://github.com/puppeteer/puppeteer/issues/9404
Expand Down Expand Up @@ -346,7 +346,7 @@ describe('Accessibility', function () {
const snapshot = await page.accessibility.snapshot();
assert(snapshot);
assert(snapshot.children);
expect(snapshot.children[0]).toEqual(golden);
expect(snapshot.children[0]).toMatchObject(golden);
});
it('rich text editable fields with role should have children', async () => {
const {page, isFirefox} = await getTestState();
Expand Down Expand Up @@ -383,7 +383,7 @@ describe('Accessibility', function () {
const snapshot = await page.accessibility.snapshot();
assert(snapshot);
assert(snapshot.children);
expect(snapshot.children[0]).toEqual(golden);
expect(snapshot.children[0]).toMatchObject(golden);
});

// Firefox does not support contenteditable="plaintext-only".
Expand Down Expand Up @@ -545,7 +545,7 @@ describe('Accessibility', function () {
root: div,
interestingOnly: false,
})
).toEqual({
).toMatchObject({
role: 'generic',
name: '',
children: [
Expand Down

0 comments on commit 9d34c09

Please sign in to comment.