From 778ab3deff719fc1447071c5ab0f5d005c93eaf0 Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Mon, 13 Jan 2020 10:13:28 -0800 Subject: [PATCH] chore: replace CHROME with CHROMIUM (#465) --- docs/api.md | 4 ++-- install.js | 2 +- src/server/crPlaywright.ts | 12 ++++++------ test/accessibility.spec.js | 10 +++++----- test/assets/beforeunload.html | 2 +- test/browser.spec.js | 2 +- test/browsercontext.spec.js | 2 +- test/chromium/chromium.spec.js | 2 +- test/chromium/connect.spec.js | 2 +- test/chromium/coverage.spec.js | 2 +- test/chromium/headful.spec.js | 2 +- test/chromium/oopif.spec.js | 2 +- test/chromium/session.spec.js | 2 +- test/click.spec.js | 4 ++-- test/cookies.spec.js | 2 +- test/dialog.spec.js | 2 +- test/elementhandle.spec.js | 2 +- test/emulation.spec.js | 2 +- test/evaluation.spec.js | 2 +- test/fixtures.spec.js | 2 +- test/frame.spec.js | 2 +- test/ignorehttpserrors.spec.js | 2 +- test/input.spec.js | 2 +- test/interception.spec.js | 8 ++++---- test/jshandle.spec.js | 4 ++-- test/keyboard.spec.js | 6 +++--- test/mouse.spec.js | 2 +- test/navigation.spec.js | 10 +++++----- test/network.spec.js | 6 +++--- test/page.spec.js | 8 ++++---- test/playwright.spec.js | 12 ++++++------ test/queryselector.spec.js | 2 +- test/screenshot.spec.js | 2 +- test/waittask.spec.js | 2 +- test/web.spec.js | 4 ++-- test/workers.spec.js | 2 +- utils/protocol-types-generator/index.js | 4 ++-- 37 files changed, 70 insertions(+), 70 deletions(-) diff --git a/docs/api.md b/docs/api.md index adc89c996a..a13e8161ee 100644 --- a/docs/api.md +++ b/docs/api.md @@ -2439,7 +2439,7 @@ Page is guaranteed to have a main frame which persists during navigations. - `preferCSSPageSize` <[boolean]> Give any CSS `@page` size declared in the page priority over what is declared in `width` and `height` or `format` options. Defaults to `false`, which will scale the content to fit the paper size. - returns: <[Promise]<[Buffer]>> Promise which resolves with PDF buffer. -> **NOTE** Generating a pdf is currently only supported in Chrome headless. +> **NOTE** Generating a pdf is currently only supported in Chromium headless. `page.pdf()` generates a pdf of the page with `print` css media. To generate a pdf with `screen` media, call [page.emulateMedia({ type: 'screen' })](#pageemulatemedia) before calling `page.pdf()`: @@ -3118,7 +3118,7 @@ The Accessibility class provides methods for inspecting Chromium's accessibility Accessibility is a very platform-specific thing. On different platforms, there are different screen readers that might have wildly different output. -Blink - Chrome's rendering engine - has a concept of "accessibility tree", which is then translated into different platform-specific APIs. Accessibility namespace gives users +Blink - Chromium's rendering engine - has a concept of "accessibility tree", which is then translated into different platform-specific APIs. Accessibility namespace gives users access to the Blink Accessibility Tree. Most of the accessibility tree gets filtered out when converting from Blink AX Tree to Platform-specific AX-Tree or by assistive technologies themselves. By default, Playwright tries to approximate this filtering, exposing only the "interesting" nodes of the tree. diff --git a/install.js b/install.js index 7aedbb6667..617d918bb4 100644 --- a/install.js +++ b/install.js @@ -34,7 +34,7 @@ try { try { const chromeRevision = await downloadBrowser('chromium', require('./chromium')); if (protocolGenerator) - protocolGenerator.generateChromeProtocol(chromeRevision); + protocolGenerator.generateChromiunProtocol(chromeRevision); } catch (e) { console.warn(e.message); } diff --git a/src/server/crPlaywright.ts b/src/server/crPlaywright.ts index f1de1bbfda..c6860199c2 100644 --- a/src/server/crPlaywright.ts +++ b/src/server/crPlaywright.ts @@ -36,14 +36,14 @@ export type SlowMoOptions = { slowMo?: number, }; -export type ChromeArgOptions = { +export type ChromiumArgOptions = { headless?: boolean, args?: string[], userDataDir?: string, devtools?: boolean, }; -export type LaunchOptions = ChromeArgOptions & SlowMoOptions & { +export type LaunchOptions = ChromiumArgOptions & SlowMoOptions & { executablePath?: string, ignoreDefaultArgs?: boolean | string[], handleSIGINT?: boolean, @@ -129,7 +129,7 @@ export class CRPlaywright implements Playwright { if (!chromeArguments.some(argument => argument.startsWith('--remote-debugging-'))) chromeArguments.push(pipe ? '--remote-debugging-pipe' : '--remote-debugging-port=0'); if (!chromeArguments.some(arg => arg.startsWith('--user-data-dir'))) { - temporaryUserDataDir = await mkdtempAsync(CHROME_PROFILE_PATH); + temporaryUserDataDir = await mkdtempAsync(CHROMIUM_PROFILE_PATH); chromeArguments.push(`--user-data-dir=${temporaryUserDataDir}`); } @@ -168,7 +168,7 @@ export class CRPlaywright implements Playwright { let connectOptions: CRConnectOptions | undefined; if (!usePipe) { - const timeoutError = new TimeoutError(`Timed out after ${timeout} ms while trying to connect to Chrome! The only Chrome revision guaranteed to work is r${this._revision}`); + const timeoutError = new TimeoutError(`Timed out after ${timeout} ms while trying to connect to Chromium! The only Chromium revision guaranteed to work is r${this._revision}`); const match = await waitForLine(launchedProcess, launchedProcess.stderr, /^DevTools listening on (ws:\/\/.*)$/, timeout, timeoutError); const browserWSEndpoint = match[1]; connectOptions = { browserWSEndpoint, slowMo }; @@ -195,7 +195,7 @@ export class CRPlaywright implements Playwright { return { TimeoutError }; } - defaultArgs(options: ChromeArgOptions = {}): string[] { + defaultArgs(options: ChromiumArgOptions = {}): string[] { const { devtools = false, headless = !devtools, @@ -279,7 +279,7 @@ export class CRPlaywright implements Playwright { const mkdtempAsync = platform.promisify(fs.mkdtemp); -const CHROME_PROFILE_PATH = path.join(os.tmpdir(), 'playwright_dev_profile-'); +const CHROMIUM_PROFILE_PATH = path.join(os.tmpdir(), 'playwright_dev_profile-'); const DEFAULT_ARGS = [ '--disable-background-networking', diff --git a/test/accessibility.spec.js b/test/accessibility.spec.js index d24224a580..7c13afd9c0 100644 --- a/test/accessibility.spec.js +++ b/test/accessibility.spec.js @@ -15,7 +15,7 @@ * limitations under the License. */ -module.exports.describe = function({testRunner, expect, FFOX, CHROME, WEBKIT}) { +module.exports.describe = function({testRunner, expect, FFOX, CHROMIUM, WEBKIT}) { const {describe, xdescribe, fdescribe} = testRunner; const {it, fit, xit, dit} = testRunner; const {beforeAll, beforeEach, afterAll, afterEach} = testRunner; @@ -62,7 +62,7 @@ module.exports.describe = function({testRunner, expect, FFOX, CHROME, WEBKIT}) { {role: 'combobox option', name: 'First Option', selected: true}, {role: 'combobox option', name: 'Second Option'}] }] - } : CHROME ? { + } : CHROMIUM ? { role: 'WebArea', name: 'Accessibility Test', children: [ @@ -113,7 +113,7 @@ module.exports.describe = function({testRunner, expect, FFOX, CHROME, WEBKIT}) { role: 'text leaf', name: 'hi' }] - } : CHROME ? { + } : CHROMIUM ? { role: 'textbox', name: '', value: 'hi', @@ -308,7 +308,7 @@ module.exports.describe = function({testRunner, expect, FFOX, CHROME, WEBKIT}) { role: 'entry', name: 'my favorite textbox', value: 'this is the inner content yo' - } : CHROME ? { + } : CHROMIUM ? { role: 'textbox', name: 'my favorite textbox', value: 'this is the inner content ' @@ -331,7 +331,7 @@ module.exports.describe = function({testRunner, expect, FFOX, CHROME, WEBKIT}) { role: 'checkbutton', name: 'my favorite checkbox', checked: true - } : CHROME ? { + } : CHROMIUM ? { role: 'checkbox', name: 'my favorite checkbox', checked: true diff --git a/test/assets/beforeunload.html b/test/assets/beforeunload.html index b246905190..332ac464e5 100644 --- a/test/assets/beforeunload.html +++ b/test/assets/beforeunload.html @@ -1,7 +1,7 @@
beforeunload demo.