Skip to content

Commit 535a042

Browse files
Merge pull request #20188 from timvandermeij/chrome-webdriverbidi
Use WebDriver BiDi for Chrome
2 parents 592d6c0 + 18d3dc1 commit 535a042

File tree

4 files changed

+24
-32
lines changed

4 files changed

+24
-32
lines changed

test/integration/scripting_spec.mjs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2460,10 +2460,9 @@ describe("Interaction", () => {
24602460
await Promise.all(
24612461
pages.map(async ([browserName, page]) => {
24622462
if (browserName === "firefox") {
2463-
// Skip the test for Firefox as it doesn't support the timezone
2464-
// feature yet with BiDi.
2465-
// See https://github.com/puppeteer/puppeteer/issues/13344.
2466-
// TODO: Remove this check once the issue is fixed.
2463+
// Skip the test for Firefox as it doesn't support timezone
2464+
// emulation for WebDriver BiDi yet.
2465+
// TODO: Remove this check once bug 1978027 is fixed.
24672466
return;
24682467
}
24692468

test/integration/text_layer_spec.mjs

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -277,30 +277,21 @@ describe("Text layer", () => {
277277
).then(belowEndPosition),
278278
]);
279279

280-
if (browserName !== "firefox") {
281-
await page.mouse.move(positionStart.x, positionStart.y);
282-
await page.mouse.down({ clickCount: 1 });
283-
await page.mouse.up({ clickCount: 1 });
284-
await page.mouse.down({ clickCount: 2 });
285-
} else {
286-
// When running tests with Firefox we use WebDriver BiDi, for
287-
// which puppeteer doesn't support emulating "double click and
288-
// hold". We need to manually dispatch an action through the
289-
// protocol.
290-
// See https://github.com/puppeteer/puppeteer/issues/13745.
291-
await page.mainFrame().browsingContext.performActions([
292-
{
293-
type: "pointer",
294-
id: "__puppeteer_mouse",
295-
actions: [
296-
{ type: "pointerMove", ...positionStart },
297-
{ type: "pointerDown", button: 0 },
298-
{ type: "pointerUp", button: 0 },
299-
{ type: "pointerDown", button: 0 },
300-
],
301-
},
302-
]);
303-
}
280+
// Puppeteer doesn't support emulating "double click and hold" for
281+
// WebDriver BiDi, so we must manually dispatch a protocol action
282+
// (see https://github.com/puppeteer/puppeteer/issues/13745).
283+
await page.mainFrame().browsingContext.performActions([
284+
{
285+
type: "pointer",
286+
id: "__puppeteer_mouse",
287+
actions: [
288+
{ type: "pointerMove", ...positionStart },
289+
{ type: "pointerDown", button: 0 },
290+
{ type: "pointerUp", button: 0 },
291+
{ type: "pointerDown", button: 0 },
292+
],
293+
},
294+
]);
304295
await moveInSteps(page, positionStart, positionEnd, 20);
305296
await page.mouse.up();
306297

test/integration/viewer_spec.mjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1372,6 +1372,12 @@ describe("PDF viewer", () => {
13721372
// with no touch screen.
13731373
return;
13741374
}
1375+
if (browserName === "chrome") {
1376+
// Skip the test for Chrome as it doesn't support pinch zoom
1377+
// emulation for WebDriver BiDi yet.
1378+
// TODO: Remove this check once the issue is fixed.
1379+
return;
1380+
}
13751381

13761382
const rect = await getSpanRectFromText(page, 1, "type-stable");
13771383
const originX = rect.x + rect.width / 2;

test/test.mjs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -925,10 +925,6 @@ async function startBrowser({
925925
const printFile = path.join(tempDir, "print.pdf");
926926

927927
if (browserName === "chrome") {
928-
// Run tests with the CDP protocol for Chrome only given that the Linux bot
929-
// crashes with timeouts or OOM if WebDriver BiDi is used (issue #17961).
930-
options.protocol = "cdp";
931-
932928
// Slow down protocol calls by the given number of milliseconds. In Chrome
933929
// protocol calls are faster than in Firefox and thus trigger in quicker
934930
// succession. This can cause intermittent failures because new protocol

0 commit comments

Comments
 (0)