From bba7ca34c8bf1519deb7c7fa4d047fb1555943f7 Mon Sep 17 00:00:00 2001 From: Ross Wollman Date: Fri, 9 Apr 2021 20:57:41 -0700 Subject: [PATCH] feat(chromium): roll to r869727 (#6170) Fixes #5952 Fixes #6016 --- README.md | 4 +- browsers.json | 2 +- src/server/chromium/protocol.ts | 93 +++++++++++++++++++++++++++++++++ tests/interception.spec.ts | 4 +- tests/page-route.spec.ts | 12 ++--- types/protocol.d.ts | 93 +++++++++++++++++++++++++++++++++ 6 files changed, 194 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 8c6f0d2a88..bc13881fda 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # 🎭 Playwright -[![npm version](https://img.shields.io/npm/v/playwright.svg?style=flat)](https://www.npmjs.com/package/playwright) [![Join Slack](https://img.shields.io/badge/join-slack-infomational)](https://aka.ms/playwright-slack) [![Chromium version](https://img.shields.io/badge/chromium-91.0.4464.0-blue.svg?logo=google-chrome)](https://www.chromium.org/Home) [![Firefox version](https://img.shields.io/badge/firefox-88.0b8-blue.svg?logo=mozilla-firefox)](https://www.mozilla.org/en-US/firefox/new/) [![WebKit version](https://img.shields.io/badge/webkit-14.2-blue.svg?logo=safari)](https://webkit.org/) +[![npm version](https://img.shields.io/npm/v/playwright.svg?style=flat)](https://www.npmjs.com/package/playwright) [![Join Slack](https://img.shields.io/badge/join-slack-infomational)](https://aka.ms/playwright-slack) [![Chromium version](https://img.shields.io/badge/chromium-91.0.4469.0-blue.svg?logo=google-chrome)](https://www.chromium.org/Home) [![Firefox version](https://img.shields.io/badge/firefox-88.0b8-blue.svg?logo=mozilla-firefox)](https://www.mozilla.org/en-US/firefox/new/) [![WebKit version](https://img.shields.io/badge/webkit-14.2-blue.svg?logo=safari)](https://webkit.org/) ## [Documentation](https://playwright.dev) | [API reference](https://playwright.dev/docs/api/class-playwright/) @@ -8,7 +8,7 @@ Playwright is a Node.js library to automate [Chromium](https://www.chromium.org/ | | Linux | macOS | Windows | | :--- | :---: | :---: | :---: | -| Chromium 91.0.4464.0 | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| Chromium 91.0.4469.0 | :white_check_mark: | :white_check_mark: | :white_check_mark: | | WebKit 14.2 | :white_check_mark: | :white_check_mark: | :white_check_mark: | | Firefox 88.0b8 | :white_check_mark: | :white_check_mark: | :white_check_mark: | diff --git a/browsers.json b/browsers.json index 277c99f7c6..79ceabd086 100644 --- a/browsers.json +++ b/browsers.json @@ -3,7 +3,7 @@ "browsers": [ { "name": "chromium", - "revision": "867878", + "revision": "869727", "installByDefault": true }, { diff --git a/src/server/chromium/protocol.ts b/src/server/chromium/protocol.ts index 5792522aeb..ffdf8d77fc 100644 --- a/src/server/chromium/protocol.ts +++ b/src/server/chromium/protocol.ts @@ -5721,8 +5721,61 @@ the top of the viewport and Y increases as it proceeds towards the bottom of the * UTC time in seconds, counted from January 1, 1970. */ export type TimeSinceEpoch = number; + export interface DragDataItem { + /** + * Mime type of the dragged data. + */ + mimeType: string; + /** + * Depending of the value of `mimeType`, it contains the dragged link, +text, HTML markup or any other data. + */ + data: string; + /** + * Title associated with a link. Only valid when `mimeType` == "text/uri-list". + */ + title?: string; + /** + * Stores the base URL for the contained markup. Only valid when `mimeType` +== "text/html". + */ + baseURL?: string; + } + export interface DragData { + items: DragDataItem[]; + /** + * Bit field representing allowed drag operations. Copy = 1, Link = 2, Move = 16 + */ + dragOperationsMask: number; + } + /** + * Dispatches a drag event into the page. + */ + export type dispatchDragEventParameters = { + /** + * Type of the drag event. + */ + type: "dragEnter"|"dragOver"|"drop"|"dragCancel"; + /** + * X coordinate of the event relative to the main frame's viewport in CSS pixels. + */ + x: number; + /** + * Y coordinate of the event relative to the main frame's viewport in CSS pixels. 0 refers to +the top of the viewport and Y increases as it proceeds towards the bottom of the viewport. + */ + y: number; + data: DragData; + /** + * Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 +(default: 0). + */ + modifiers?: number; + } + export type dispatchDragEventReturnValue = { + } /** * Dispatches a key event to the page. */ @@ -8971,6 +9024,34 @@ continueInterceptedRequest call. */ nodeId: DOM.NodeId; } + export interface ScrollSnapContainerHighlightConfig { + /** + * The style of the snapport border (default: transparent) + */ + snapportBorder?: LineStyle; + /** + * The style of the snap area border (default: transparent) + */ + snapAreaBorder?: LineStyle; + /** + * The margin highlight fill color (default: transparent). + */ + scrollMarginColor?: DOM.RGBA; + /** + * The padding highlight fill color (default: transparent). + */ + scrollPaddingColor?: DOM.RGBA; + } + export interface ScrollSnapHighlightConfig { + /** + * A descriptor for the highlight appearance of scroll snap containers. + */ + scrollSnapContainerHighlightConfig: ScrollSnapContainerHighlightConfig; + /** + * Identifier of the node to highlight. + */ + nodeId: DOM.NodeId; + } /** * Configuration for dual screen hinge */ @@ -9300,6 +9381,14 @@ Backend then generates 'inspectNodeRequested' event upon element selection. } export type setShowFlexOverlaysReturnValue = { } + export type setShowScrollSnapOverlaysParameters = { + /** + * An array of node identifiers and descriptors for the highlight appearance. + */ + scrollSnapHighlightConfigs: ScrollSnapHighlightConfig[]; + } + export type setShowScrollSnapOverlaysReturnValue = { + } /** * Requests that backend shows paint rectangles */ @@ -16432,6 +16521,7 @@ unsubscribes current runtime agent from Runtime.bindingCalled notifications. "IndexedDB.getMetadata": IndexedDB.getMetadataParameters; "IndexedDB.requestDatabase": IndexedDB.requestDatabaseParameters; "IndexedDB.requestDatabaseNames": IndexedDB.requestDatabaseNamesParameters; + "Input.dispatchDragEvent": Input.dispatchDragEventParameters; "Input.dispatchKeyEvent": Input.dispatchKeyEventParameters; "Input.insertText": Input.insertTextParameters; "Input.dispatchMouseEvent": Input.dispatchMouseEventParameters; @@ -16518,6 +16608,7 @@ unsubscribes current runtime agent from Runtime.bindingCalled notifications. "Overlay.setShowFPSCounter": Overlay.setShowFPSCounterParameters; "Overlay.setShowGridOverlays": Overlay.setShowGridOverlaysParameters; "Overlay.setShowFlexOverlays": Overlay.setShowFlexOverlaysParameters; + "Overlay.setShowScrollSnapOverlays": Overlay.setShowScrollSnapOverlaysParameters; "Overlay.setShowPaintRects": Overlay.setShowPaintRectsParameters; "Overlay.setShowLayoutShiftRegions": Overlay.setShowLayoutShiftRegionsParameters; "Overlay.setShowScrollBottleneckRects": Overlay.setShowScrollBottleneckRectsParameters; @@ -16946,6 +17037,7 @@ unsubscribes current runtime agent from Runtime.bindingCalled notifications. "IndexedDB.getMetadata": IndexedDB.getMetadataReturnValue; "IndexedDB.requestDatabase": IndexedDB.requestDatabaseReturnValue; "IndexedDB.requestDatabaseNames": IndexedDB.requestDatabaseNamesReturnValue; + "Input.dispatchDragEvent": Input.dispatchDragEventReturnValue; "Input.dispatchKeyEvent": Input.dispatchKeyEventReturnValue; "Input.insertText": Input.insertTextReturnValue; "Input.dispatchMouseEvent": Input.dispatchMouseEventReturnValue; @@ -17032,6 +17124,7 @@ unsubscribes current runtime agent from Runtime.bindingCalled notifications. "Overlay.setShowFPSCounter": Overlay.setShowFPSCounterReturnValue; "Overlay.setShowGridOverlays": Overlay.setShowGridOverlaysReturnValue; "Overlay.setShowFlexOverlays": Overlay.setShowFlexOverlaysReturnValue; + "Overlay.setShowScrollSnapOverlays": Overlay.setShowScrollSnapOverlaysReturnValue; "Overlay.setShowPaintRects": Overlay.setShowPaintRectsReturnValue; "Overlay.setShowLayoutShiftRegions": Overlay.setShowLayoutShiftRegionsReturnValue; "Overlay.setShowScrollBottleneckRects": Overlay.setShowScrollBottleneckRectsReturnValue; diff --git a/tests/interception.spec.ts b/tests/interception.spec.ts index 2b61d64c0e..638dd73de3 100644 --- a/tests/interception.spec.ts +++ b/tests/interception.spec.ts @@ -156,8 +156,8 @@ it('should work with regular expression passed from a different context', async expect(intercepted).toBe(true); }); -it('should not break remote worker importScripts', async ({ page, server, browserName }) => { - it.fail(browserName === 'chromium'); +it('should not break remote worker importScripts', async ({ page, server, isChromium, browserVersion }) => { + it.fail(isChromium && +browserVersion.split('.')[0] < 91); await page.route('**', async request => { await request.continue(); diff --git a/tests/page-route.spec.ts b/tests/page-route.spec.ts index 7784c776e3..efcf383856 100644 --- a/tests/page-route.spec.ts +++ b/tests/page-route.spec.ts @@ -535,9 +535,7 @@ it('should support cors with GET', async ({page, server}) => { } }); -it('should support cors with POST', async ({page, server, isChromium, browserChannel, isElectron, isAndroid}) => { - it.fail(isChromium && !browserChannel && !isAndroid && !isElectron, 'https://github.com/microsoft/playwright/issues/6016'); - +it('should support cors with POST', async ({page, server}) => { await page.goto(server.EMPTY_PAGE); await page.route('**/cars', async route => { await route.fulfill({ @@ -559,9 +557,7 @@ it('should support cors with POST', async ({page, server, isChromium, browserCha expect(resp).toEqual(['electric', 'gas']); }); -it('should support cors with credentials', async ({page, server, isChromium, browserChannel, isElectron, isAndroid}) => { - it.fail(isChromium && !browserChannel && !isAndroid && !isElectron, 'https://github.com/microsoft/playwright/issues/6016'); - +it('should support cors with credentials', async ({page, server}) => { await page.goto(server.EMPTY_PAGE); await page.route('**/cars', async route => { await route.fulfill({ @@ -619,9 +615,7 @@ it('should reject cors with disallowed credentials', async ({page, server}) => { expect(error).toBeTruthy(); }); -it('should support cors for different methods', async ({page, server, isChromium, browserChannel, isElectron, isAndroid}) => { - it.fail(isChromium && !browserChannel && !isAndroid && !isElectron, 'https://github.com/microsoft/playwright/issues/6016'); - +it('should support cors for different methods', async ({page, server}) => { await page.goto(server.EMPTY_PAGE); await page.route('**/cars', async (route, request) => { await route.fulfill({ diff --git a/types/protocol.d.ts b/types/protocol.d.ts index 5792522aeb..ffdf8d77fc 100644 --- a/types/protocol.d.ts +++ b/types/protocol.d.ts @@ -5721,8 +5721,61 @@ the top of the viewport and Y increases as it proceeds towards the bottom of the * UTC time in seconds, counted from January 1, 1970. */ export type TimeSinceEpoch = number; + export interface DragDataItem { + /** + * Mime type of the dragged data. + */ + mimeType: string; + /** + * Depending of the value of `mimeType`, it contains the dragged link, +text, HTML markup or any other data. + */ + data: string; + /** + * Title associated with a link. Only valid when `mimeType` == "text/uri-list". + */ + title?: string; + /** + * Stores the base URL for the contained markup. Only valid when `mimeType` +== "text/html". + */ + baseURL?: string; + } + export interface DragData { + items: DragDataItem[]; + /** + * Bit field representing allowed drag operations. Copy = 1, Link = 2, Move = 16 + */ + dragOperationsMask: number; + } + /** + * Dispatches a drag event into the page. + */ + export type dispatchDragEventParameters = { + /** + * Type of the drag event. + */ + type: "dragEnter"|"dragOver"|"drop"|"dragCancel"; + /** + * X coordinate of the event relative to the main frame's viewport in CSS pixels. + */ + x: number; + /** + * Y coordinate of the event relative to the main frame's viewport in CSS pixels. 0 refers to +the top of the viewport and Y increases as it proceeds towards the bottom of the viewport. + */ + y: number; + data: DragData; + /** + * Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 +(default: 0). + */ + modifiers?: number; + } + export type dispatchDragEventReturnValue = { + } /** * Dispatches a key event to the page. */ @@ -8971,6 +9024,34 @@ continueInterceptedRequest call. */ nodeId: DOM.NodeId; } + export interface ScrollSnapContainerHighlightConfig { + /** + * The style of the snapport border (default: transparent) + */ + snapportBorder?: LineStyle; + /** + * The style of the snap area border (default: transparent) + */ + snapAreaBorder?: LineStyle; + /** + * The margin highlight fill color (default: transparent). + */ + scrollMarginColor?: DOM.RGBA; + /** + * The padding highlight fill color (default: transparent). + */ + scrollPaddingColor?: DOM.RGBA; + } + export interface ScrollSnapHighlightConfig { + /** + * A descriptor for the highlight appearance of scroll snap containers. + */ + scrollSnapContainerHighlightConfig: ScrollSnapContainerHighlightConfig; + /** + * Identifier of the node to highlight. + */ + nodeId: DOM.NodeId; + } /** * Configuration for dual screen hinge */ @@ -9300,6 +9381,14 @@ Backend then generates 'inspectNodeRequested' event upon element selection. } export type setShowFlexOverlaysReturnValue = { } + export type setShowScrollSnapOverlaysParameters = { + /** + * An array of node identifiers and descriptors for the highlight appearance. + */ + scrollSnapHighlightConfigs: ScrollSnapHighlightConfig[]; + } + export type setShowScrollSnapOverlaysReturnValue = { + } /** * Requests that backend shows paint rectangles */ @@ -16432,6 +16521,7 @@ unsubscribes current runtime agent from Runtime.bindingCalled notifications. "IndexedDB.getMetadata": IndexedDB.getMetadataParameters; "IndexedDB.requestDatabase": IndexedDB.requestDatabaseParameters; "IndexedDB.requestDatabaseNames": IndexedDB.requestDatabaseNamesParameters; + "Input.dispatchDragEvent": Input.dispatchDragEventParameters; "Input.dispatchKeyEvent": Input.dispatchKeyEventParameters; "Input.insertText": Input.insertTextParameters; "Input.dispatchMouseEvent": Input.dispatchMouseEventParameters; @@ -16518,6 +16608,7 @@ unsubscribes current runtime agent from Runtime.bindingCalled notifications. "Overlay.setShowFPSCounter": Overlay.setShowFPSCounterParameters; "Overlay.setShowGridOverlays": Overlay.setShowGridOverlaysParameters; "Overlay.setShowFlexOverlays": Overlay.setShowFlexOverlaysParameters; + "Overlay.setShowScrollSnapOverlays": Overlay.setShowScrollSnapOverlaysParameters; "Overlay.setShowPaintRects": Overlay.setShowPaintRectsParameters; "Overlay.setShowLayoutShiftRegions": Overlay.setShowLayoutShiftRegionsParameters; "Overlay.setShowScrollBottleneckRects": Overlay.setShowScrollBottleneckRectsParameters; @@ -16946,6 +17037,7 @@ unsubscribes current runtime agent from Runtime.bindingCalled notifications. "IndexedDB.getMetadata": IndexedDB.getMetadataReturnValue; "IndexedDB.requestDatabase": IndexedDB.requestDatabaseReturnValue; "IndexedDB.requestDatabaseNames": IndexedDB.requestDatabaseNamesReturnValue; + "Input.dispatchDragEvent": Input.dispatchDragEventReturnValue; "Input.dispatchKeyEvent": Input.dispatchKeyEventReturnValue; "Input.insertText": Input.insertTextReturnValue; "Input.dispatchMouseEvent": Input.dispatchMouseEventReturnValue; @@ -17032,6 +17124,7 @@ unsubscribes current runtime agent from Runtime.bindingCalled notifications. "Overlay.setShowFPSCounter": Overlay.setShowFPSCounterReturnValue; "Overlay.setShowGridOverlays": Overlay.setShowGridOverlaysReturnValue; "Overlay.setShowFlexOverlays": Overlay.setShowFlexOverlaysReturnValue; + "Overlay.setShowScrollSnapOverlays": Overlay.setShowScrollSnapOverlaysReturnValue; "Overlay.setShowPaintRects": Overlay.setShowPaintRectsReturnValue; "Overlay.setShowLayoutShiftRegions": Overlay.setShowLayoutShiftRegionsReturnValue; "Overlay.setShowScrollBottleneckRects": Overlay.setShowScrollBottleneckRectsReturnValue;