Skip to content

Commit

Permalink
Ensure connection uses raw buffers for API calls
Browse files Browse the repository at this point in the history
  • Loading branch information
ruifigueira committed Feb 27, 2024
1 parent d3d920f commit 1083b33
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/client/crxConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { findValidator } from 'playwright-core/lib/protocol/validatorPrimitives'
export class CrxConnection extends Connection {
constructor() {
super(undefined, undefined);
this.useRawBuffers();
}

dispatch(message: object): void {
Expand Down
10 changes: 10 additions & 0 deletions tests/crx/api.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,3 +162,13 @@ test('should not block on pages with service workers', async ({ runCrxTest }) =>
await expect(page.evaluate(() => window['registrationPromise'])).resolves.toBeTruthy();
});
});

// https://github.com/ruifigueira/playwright-crx/issues/14
test("should take screenshot", async ({ runCrxTest }) => {
await runCrxTest(async ({ expect, page }) => {
await page.goto('about:blank');
await page.setContent('<h1>Hello World!</h1>');
const screenshot = await page.screenshot();
expect(screenshot).not.toBeNull();
});
});

0 comments on commit 1083b33

Please sign in to comment.