chore: replace CHROME with CHROMIUM (#465)
This commit is contained in:
		
							parent
							
								
									a8b9920a14
								
							
						
					
					
						commit
						778ab3deff
					
				|  | @ -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. | ||||
|  |  | |||
|  | @ -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); | ||||
|   } | ||||
|  |  | |||
|  | @ -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', | ||||
|  |  | |||
|  | @ -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 | ||||
|  |  | |||
|  | @ -1,7 +1,7 @@ | |||
| <div>beforeunload demo.</div> | ||||
| <script> | ||||
| window.addEventListener('beforeunload', event => { | ||||
|   // Chrome & WebKit way. | ||||
|   // Chromium & WebKit way. | ||||
|   event.returnValue = 'Leave?'; | ||||
|   // Firefox way. | ||||
|   event.preventDefault(); | ||||
|  |  | |||
|  | @ -15,7 +15,7 @@ | |||
|  * limitations under the License. | ||||
|  */ | ||||
| 
 | ||||
| module.exports.describe = function({testRunner, expect, headless, playwright, FFOX, CHROME, WEBKIT}) { | ||||
| module.exports.describe = function({testRunner, expect, headless, playwright, FFOX, CHROMIUM, WEBKIT}) { | ||||
|   const {describe, xdescribe, fdescribe} = testRunner; | ||||
|   const {it, fit, xit, dit} = testRunner; | ||||
|   const {beforeAll, beforeEach, afterAll, afterEach} = testRunner; | ||||
|  |  | |||
|  | @ -17,7 +17,7 @@ | |||
| 
 | ||||
| const utils = require('./utils'); | ||||
| 
 | ||||
| module.exports.describe = function({testRunner, expect, playwright, CHROME, WEBKIT}) { | ||||
| module.exports.describe = function({testRunner, expect, playwright, CHROMIUM, WEBKIT}) { | ||||
|   const {describe, xdescribe, fdescribe} = testRunner; | ||||
|   const {it, fit, xit, dit} = testRunner; | ||||
|   const {beforeAll, beforeEach, afterAll, afterEach} = testRunner; | ||||
|  |  | |||
|  | @ -16,7 +16,7 @@ | |||
| 
 | ||||
| const { waitEvent } = require('../utils'); | ||||
| 
 | ||||
| module.exports.describe = function({testRunner, expect, playwright, FFOX, CHROME, WEBKIT}) { | ||||
| module.exports.describe = function({testRunner, expect, playwright, FFOX, CHROMIUM, WEBKIT}) { | ||||
|   const {describe, xdescribe, fdescribe} = testRunner; | ||||
|   const {it, fit, xit, dit} = testRunner; | ||||
|   const {beforeAll, beforeEach, afterAll, afterEach} = testRunner; | ||||
|  |  | |||
|  | @ -17,7 +17,7 @@ | |||
| 
 | ||||
| const utils = require('../utils'); | ||||
| 
 | ||||
| module.exports.describe = function({testRunner, expect, defaultBrowserOptions, playwright, FFOX, CHROME, WEBKIT}) { | ||||
| module.exports.describe = function({testRunner, expect, defaultBrowserOptions, playwright, FFOX, CHROMIUM, WEBKIT}) { | ||||
|   const {describe, xdescribe, fdescribe} = testRunner; | ||||
|   const {it, fit, xit, dit} = testRunner; | ||||
|   const {beforeAll, beforeEach, afterAll, afterEach} = testRunner; | ||||
|  |  | |||
|  | @ -14,7 +14,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; | ||||
|  |  | |||
|  | @ -24,7 +24,7 @@ const mkdtempAsync = util.promisify(fs.mkdtemp); | |||
| 
 | ||||
| const TMP_FOLDER = path.join(os.tmpdir(), 'pptr_tmp_folder-'); | ||||
| 
 | ||||
| module.exports.describe = function({testRunner, expect, playwright, defaultBrowserOptions, FFOX, CHROME, WEBKIT}) { | ||||
| module.exports.describe = function({testRunner, expect, playwright, defaultBrowserOptions, FFOX, CHROMIUM, WEBKIT}) { | ||||
|   const {describe, xdescribe, fdescribe} = testRunner; | ||||
|   const {it, fit, xit, dit} = testRunner; | ||||
|   const {beforeAll, beforeEach, afterAll, afterEach} = testRunner; | ||||
|  |  | |||
|  | @ -14,7 +14,7 @@ | |||
|  * limitations under the License. | ||||
|  */ | ||||
| 
 | ||||
| module.exports.describe = function({testRunner, expect, defaultBrowserOptions, playwright, FFOX, CHROME, WEBKIT}) { | ||||
| module.exports.describe = function({testRunner, expect, defaultBrowserOptions, playwright, FFOX, CHROMIUM, WEBKIT}) { | ||||
|   const {describe, xdescribe, fdescribe} = testRunner; | ||||
|   const {it, fit, xit, dit} = testRunner; | ||||
|   const {beforeAll, beforeEach, afterAll, afterEach} = testRunner; | ||||
|  |  | |||
|  | @ -16,7 +16,7 @@ | |||
| 
 | ||||
| const { waitEvent } = require('../utils'); | ||||
| 
 | ||||
| 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; | ||||
|  |  | |||
|  | @ -17,7 +17,7 @@ | |||
| 
 | ||||
| const utils = require('./utils'); | ||||
| 
 | ||||
| module.exports.describe = function({testRunner, expect, playwright, FFOX, CHROME, WEBKIT}) { | ||||
| module.exports.describe = function({testRunner, expect, playwright, FFOX, CHROMIUM, WEBKIT}) { | ||||
|   const {describe, xdescribe, fdescribe} = testRunner; | ||||
|   const {it, fit, xit, dit} = testRunner; | ||||
|   const {beforeAll, beforeEach, afterAll, afterEach} = testRunner; | ||||
|  | @ -366,7 +366,7 @@ module.exports.describe = function({testRunner, expect, playwright, FFOX, CHROME | |||
|       await page.click('button'); | ||||
|       expect(await page.evaluate(() => shiftKey)).toBe(false); | ||||
|     }); | ||||
|     it.skip(CHROME)('should click an offscreen element when scroll-behavior is smooth', async({page}) => { | ||||
|     it.skip(CHROMIUM)('should click an offscreen element when scroll-behavior is smooth', async({page}) => { | ||||
|       await page.setContent(` | ||||
|         <div style="border: 1px solid black; height: 500px; overflow: auto; width: 500px; scroll-behavior: smooth"> | ||||
|         <button style="margin-top: 2000px" onClick="window.clicked = true">hi</button> | ||||
|  |  | |||
|  | @ -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; | ||||
|  |  | |||
|  | @ -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; | ||||
|  |  | |||
|  | @ -17,7 +17,7 @@ | |||
| 
 | ||||
| const utils = require('./utils'); | ||||
| 
 | ||||
| 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; | ||||
|  |  | |||
|  | @ -15,7 +15,7 @@ | |||
|  * limitations under the License. | ||||
|  */ | ||||
| 
 | ||||
| module.exports.describe = function({testRunner, expect, playwright, FFOX, CHROME, WEBKIT}) { | ||||
| module.exports.describe = function({testRunner, expect, playwright, FFOX, CHROMIUM, WEBKIT}) { | ||||
|   const {describe, xdescribe, fdescribe} = testRunner; | ||||
|   const {it, fit, xit, dit} = testRunner; | ||||
|   const {beforeAll, beforeEach, afterAll, afterEach} = testRunner; | ||||
|  |  | |||
|  | @ -19,7 +19,7 @@ const utils = require('./utils'); | |||
| 
 | ||||
| const bigint = typeof BigInt !== 'undefined'; | ||||
| 
 | ||||
| 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; | ||||
|  |  | |||
|  | @ -18,7 +18,7 @@ | |||
| const path = require('path'); | ||||
| const {spawn} = require('child_process'); | ||||
| 
 | ||||
| module.exports.describe = function({testRunner, expect, defaultBrowserOptions, playwright, playwrightPath, FFOX, CHROME, WEBKIT}) { | ||||
| module.exports.describe = function({testRunner, expect, defaultBrowserOptions, playwright, playwrightPath, FFOX, CHROMIUM, WEBKIT}) { | ||||
|   const {describe, xdescribe, fdescribe} = testRunner; | ||||
|   const {it, fit, xit, dit} = testRunner; | ||||
|   const {beforeAll, beforeEach, afterAll, afterEach} = testRunner; | ||||
|  |  | |||
|  | @ -17,7 +17,7 @@ | |||
| 
 | ||||
| const utils = require('./utils'); | ||||
| 
 | ||||
| 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; | ||||
|  |  | |||
|  | @ -15,7 +15,7 @@ | |||
|  * limitations under the License. | ||||
|  */ | ||||
| 
 | ||||
| module.exports.describe = function({testRunner, expect, defaultBrowserOptions, playwright, FFOX, CHROME, WEBKIT}) { | ||||
| module.exports.describe = function({testRunner, expect, defaultBrowserOptions, playwright, FFOX, CHROMIUM, WEBKIT}) { | ||||
|   const {describe, xdescribe, fdescribe} = testRunner; | ||||
|   const {it, fit, xit, dit} = testRunner; | ||||
|   const {beforeAll, beforeEach, afterAll, afterEach} = testRunner; | ||||
|  |  | |||
|  | @ -19,7 +19,7 @@ const path = require('path'); | |||
| 
 | ||||
| const FILE_TO_UPLOAD = path.join(__dirname, '/assets/file-to-upload.txt'); | ||||
| 
 | ||||
| module.exports.describe = function({testRunner, expect, playwright, FFOX, CHROME, WEBKIT}) { | ||||
| module.exports.describe = function({testRunner, expect, playwright, FFOX, CHROMIUM, WEBKIT}) { | ||||
|   const {describe, xdescribe, fdescribe} = testRunner; | ||||
|   const {it, fit, xit, dit} = testRunner; | ||||
|   const {beforeAll, beforeEach, afterAll, afterEach} = testRunner; | ||||
|  |  | |||
|  | @ -19,7 +19,7 @@ const fs = require('fs'); | |||
| const path = require('path'); | ||||
| const utils = require('./utils'); | ||||
| 
 | ||||
| module.exports.describe = function({testRunner, expect, defaultBrowserOptions, playwright, FFOX, CHROME, WEBKIT}) { | ||||
| module.exports.describe = function({testRunner, expect, defaultBrowserOptions, playwright, FFOX, CHROMIUM, WEBKIT}) { | ||||
|   const {describe, xdescribe, fdescribe} = testRunner; | ||||
|   const {it, fit, xit, dit} = testRunner; | ||||
|   const {beforeAll, beforeEach, afterAll, afterEach} = testRunner; | ||||
|  | @ -532,7 +532,7 @@ module.exports.describe = function({testRunner, expect, defaultBrowserOptions, p | |||
|       expect(response.status()).toBe(200); | ||||
|     }); | ||||
|     it('should fail if wrong credentials', async({page, server}) => { | ||||
|       // Use unique user/password since Chrome caches credentials per origin.
 | ||||
|       // Use unique user/password since Chromium caches credentials per origin.
 | ||||
|       server.setAuth('/empty.html', 'user2', 'pass2'); | ||||
|       await page.authenticate({ | ||||
|         username: 'foo', | ||||
|  | @ -542,7 +542,7 @@ module.exports.describe = function({testRunner, expect, defaultBrowserOptions, p | |||
|       expect(response.status()).toBe(401); | ||||
|     }); | ||||
|     it('should allow disable authentication', async({page, server}) => { | ||||
|       // Use unique user/password since Chrome caches credentials per origin.
 | ||||
|       // Use unique user/password since Chromium caches credentials per origin.
 | ||||
|       server.setAuth('/empty.html', 'user3', 'pass3'); | ||||
|       await page.authenticate({ | ||||
|         username: 'user3', | ||||
|  | @ -551,7 +551,7 @@ module.exports.describe = function({testRunner, expect, defaultBrowserOptions, p | |||
|       let response = await page.goto(server.EMPTY_PAGE); | ||||
|       expect(response.status()).toBe(200); | ||||
|       await page.authenticate(null); | ||||
|       // Navigate to a different origin to bust Chrome's credential caching.
 | ||||
|       // Navigate to a different origin to bust Chromium's credential caching.
 | ||||
|       response = await page.goto(server.CROSS_PROCESS_PREFIX + '/empty.html'); | ||||
|       expect(response.status()).toBe(401); | ||||
|     }); | ||||
|  |  | |||
|  | @ -15,7 +15,7 @@ | |||
|  * limitations under the License. | ||||
|  */ | ||||
| 
 | ||||
| module.exports.describe = function({testRunner, expect, CHROME, FFOX, WEBKIT}) { | ||||
| module.exports.describe = function({testRunner, expect, CHROMIUM, FFOX, WEBKIT}) { | ||||
|   const {describe, xdescribe, fdescribe} = testRunner; | ||||
|   const {it, fit, xit, dit} = testRunner; | ||||
|   const {beforeAll, beforeEach, afterAll, afterEach} = testRunner; | ||||
|  | @ -93,7 +93,7 @@ module.exports.describe = function({testRunner, expect, CHROME, FFOX, WEBKIT}) { | |||
|       await windowHandle.jsonValue().catch(e => error = e); | ||||
|       if (WEBKIT) | ||||
|         expect(error.message).toContain('Object has too long reference chain'); | ||||
|       else if (CHROME) | ||||
|       else if (CHROMIUM) | ||||
|         expect(error.message).toContain('Object reference chain is too long'); | ||||
|       else if (FFOX) | ||||
|         expect(error.message).toContain('Object is not serializable'); | ||||
|  |  | |||
|  | @ -18,7 +18,7 @@ | |||
| const utils = require('./utils'); | ||||
| const os = require('os'); | ||||
| 
 | ||||
| module.exports.describe = function({testRunner, expect, FFOX, CHROME, WEBKIT, MAC}) { | ||||
| module.exports.describe = function({testRunner, expect, FFOX, CHROMIUM, WEBKIT, MAC}) { | ||||
|   const {describe, xdescribe, fdescribe} = testRunner; | ||||
|   const {it, fit, xit, dit} = testRunner; | ||||
|   const {beforeAll, beforeEach, afterAll, afterEach} = testRunner; | ||||
|  | @ -227,7 +227,7 @@ module.exports.describe = function({testRunner, expect, FFOX, CHROME, WEBKIT, MA | |||
|       await textarea.type('👹 Tokyo street Japan 🇯🇵'); | ||||
|       expect(await frame.$eval('textarea', textarea => textarea.value)).toBe('👹 Tokyo street Japan 🇯🇵'); | ||||
|     }); | ||||
|     it.skip(CHROME && MAC)('should handle selectAll', async({page, server}) => { | ||||
|     it.skip(CHROMIUM && MAC)('should handle selectAll', async({page, server}) => { | ||||
|       await page.goto(server.PREFIX + '/input/textarea.html'); | ||||
|       const textarea = await page.$('textarea'); | ||||
|       await textarea.type('some text'); | ||||
|  | @ -238,7 +238,7 @@ module.exports.describe = function({testRunner, expect, FFOX, CHROME, WEBKIT, MA | |||
|       await page.keyboard.press('Backspace'); | ||||
|       expect(await page.$eval('textarea', textarea => textarea.value)).toBe(''); | ||||
|     }); | ||||
|     it.skip(CHROME && MAC)('should be able to prevent selectAll', async({page, server}) => { | ||||
|     it.skip(CHROMIUM && MAC)('should be able to prevent selectAll', async({page, server}) => { | ||||
|       await page.goto(server.PREFIX + '/input/textarea.html'); | ||||
|       const textarea = await page.$('textarea'); | ||||
|       await textarea.type('some text'); | ||||
|  |  | |||
|  | @ -26,7 +26,7 @@ function dimensions() { | |||
|   }; | ||||
| } | ||||
| 
 | ||||
| module.exports.describe = function({testRunner, expect, FFOX, CHROME, WEBKIT, MAC}) { | ||||
| module.exports.describe = function({testRunner, expect, FFOX, CHROMIUM, WEBKIT, MAC}) { | ||||
|   const {describe, xdescribe, fdescribe} = testRunner; | ||||
|   const {it, fit, xit, dit} = testRunner; | ||||
|   const {beforeAll, beforeEach, afterAll, afterEach} = testRunner; | ||||
|  |  | |||
|  | @ -18,7 +18,7 @@ | |||
| const utils = require('./utils'); | ||||
| const { performance } = require('perf_hooks'); | ||||
| 
 | ||||
| module.exports.describe = function({testRunner, expect, playwright, FFOX, CHROME, WEBKIT}) { | ||||
| module.exports.describe = function({testRunner, expect, playwright, FFOX, CHROMIUM, WEBKIT}) { | ||||
|   const {describe, xdescribe, fdescribe} = testRunner; | ||||
|   const {it, fit, xit, dit} = testRunner; | ||||
|   const {beforeAll, beforeEach, afterAll, afterEach} = testRunner; | ||||
|  | @ -116,7 +116,7 @@ module.exports.describe = function({testRunner, expect, playwright, FFOX, CHROME | |||
|       let error = null; | ||||
|       await page.goto(server.EMPTY_PAGE).catch(e => error = e); | ||||
|       expect(error).not.toBe(null); | ||||
|       if (CHROME) | ||||
|       if (CHROMIUM) | ||||
|         expect(error.message).toContain('net::ERR_ABORTED'); | ||||
|       else | ||||
|         expect(error.message).toContain('NS_BINDING_ABORTED'); | ||||
|  | @ -136,7 +136,7 @@ module.exports.describe = function({testRunner, expect, playwright, FFOX, CHROME | |||
|     it('should fail when navigating to bad url', async({page, server}) => { | ||||
|       let error = null; | ||||
|       await page.goto('asdfasdf').catch(e => error = e); | ||||
|       if (CHROME || WEBKIT) | ||||
|       if (CHROMIUM || WEBKIT) | ||||
|         expect(error.message).toContain('Cannot navigate to invalid URL'); | ||||
|       else | ||||
|         expect(error.message).toContain('Invalid url'); | ||||
|  | @ -170,7 +170,7 @@ module.exports.describe = function({testRunner, expect, playwright, FFOX, CHROME | |||
|     it('should fail when main resources failed to load', async({page, server}) => { | ||||
|       let error = null; | ||||
|       await page.goto('http://localhost:44123/non-existing-url').catch(e => error = e); | ||||
|       if (CHROME) | ||||
|       if (CHROMIUM) | ||||
|         expect(error.message).toContain('net::ERR_CONNECTION_REFUSED'); | ||||
|       else if (WEBKIT) | ||||
|         expect(error.message).toContain('Could not connect'); | ||||
|  | @ -889,7 +889,7 @@ module.exports.describe = function({testRunner, expect, playwright, FFOX, CHROME | |||
|   }); | ||||
| 
 | ||||
|   function expectSSLError(errorMessage) { | ||||
|     if (CHROME) { | ||||
|     if (CHROMIUM) { | ||||
|       expect(errorMessage).toContain('net::ERR_CERT_AUTHORITY_INVALID'); | ||||
|     } else if (WEBKIT) { | ||||
|       if (process.platform === 'darwin') | ||||
|  |  | |||
|  | @ -19,7 +19,7 @@ const fs = require('fs'); | |||
| const path = require('path'); | ||||
| const utils = require('./utils'); | ||||
| 
 | ||||
| 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; | ||||
|  | @ -77,7 +77,7 @@ module.exports.describe = function({testRunner, expect, FFOX, CHROME, WEBKIT}) { | |||
|   describe('Request.headers', function() { | ||||
|     it('should work', async({page, server}) => { | ||||
|       const response = await page.goto(server.EMPTY_PAGE); | ||||
|       if (CHROME) | ||||
|       if (CHROMIUM) | ||||
|         expect(response.request().headers()['user-agent']).toContain('Chrome'); | ||||
|       else if (FFOX) | ||||
|         expect(response.request().headers()['user-agent']).toContain('Firefox'); | ||||
|  | @ -245,7 +245,7 @@ module.exports.describe = function({testRunner, expect, FFOX, CHROME, WEBKIT}) { | |||
|       expect(failedRequests[0].url()).toContain('one-style.css'); | ||||
|       expect(failedRequests[0].response()).toBe(null); | ||||
|       expect(failedRequests[0].resourceType()).toBe('stylesheet'); | ||||
|       if (CHROME) { | ||||
|       if (CHROMIUM) { | ||||
|         expect(failedRequests[0].failure().errorText).toBe('net::ERR_INVALID_HTTP_RESPONSE'); | ||||
|       } else if (WEBKIT) { | ||||
|         if (process.platform === 'darwin') | ||||
|  |  | |||
|  | @ -19,7 +19,7 @@ const path = require('path'); | |||
| const utils = require('./utils'); | ||||
| const {waitEvent} = utils; | ||||
| 
 | ||||
| module.exports.describe = function({testRunner, expect, headless, playwright, FFOX, CHROME, WEBKIT}) { | ||||
| module.exports.describe = function({testRunner, expect, headless, playwright, FFOX, CHROMIUM, WEBKIT}) { | ||||
|   const {describe, xdescribe, fdescribe} = testRunner; | ||||
|   const {it, fit, xit, dit} = testRunner; | ||||
|   const {beforeAll, beforeEach, afterAll, afterEach} = testRunner; | ||||
|  | @ -50,7 +50,7 @@ module.exports.describe = function({testRunner, expect, headless, playwright, FF | |||
|       const dialog = await waitEvent(newPage, 'dialog'); | ||||
|       expect(dialog.type()).toBe('beforeunload'); | ||||
|       expect(dialog.defaultValue()).toBe(''); | ||||
|       if (CHROME) | ||||
|       if (CHROMIUM) | ||||
|         expect(dialog.message()).toBe(''); | ||||
|       else if (WEBKIT) | ||||
|         expect(dialog.message()).toBe('Leave?'); | ||||
|  | @ -113,7 +113,7 @@ module.exports.describe = function({testRunner, expect, headless, playwright, FF | |||
|     it('should throw when page crashes', async({page}) => { | ||||
|       let error = null; | ||||
|       page.on('error', err => error = err); | ||||
|       if (CHROME) | ||||
|       if (CHROMIUM) | ||||
|         page.goto('chrome://crash').catch(e => {}); | ||||
|       else if (WEBKIT) | ||||
|         page._delegate._session.send('Page.crash', {}).catch(e => {}); | ||||
|  | @ -674,7 +674,7 @@ module.exports.describe = function({testRunner, expect, headless, playwright, FF | |||
|       expect(await page.evaluate(() => __injected)).toBe(42); | ||||
|     }); | ||||
| 
 | ||||
|     (CHROME || FFOX) && it('should include sourceURL when path is provided', async({page, server}) => { | ||||
|     (CHROMIUM || FFOX) && it('should include sourceURL when path is provided', async({page, server}) => { | ||||
|       await page.goto(server.EMPTY_PAGE); | ||||
|       await page.addScriptTag({ path: path.join(__dirname, 'assets/injectedfile.js') }); | ||||
|       const result = await page.evaluate(() => __injectedError.stack); | ||||
|  |  | |||
|  | @ -29,7 +29,7 @@ module.exports.describe = ({testRunner, product, playwrightPath}) => { | |||
|   const {it, fit, xit, dit} = testRunner; | ||||
|   const {beforeAll, beforeEach, afterAll, afterEach} = testRunner; | ||||
| 
 | ||||
|   const CHROME = product === 'Chromium'; | ||||
|   const CHROMIUM = product === 'Chromium'; | ||||
|   const FFOX = product === 'Firefox'; | ||||
|   const WEBKIT = product === 'WebKit'; | ||||
|   const MAC = os.platform() === 'darwin'; | ||||
|  | @ -76,7 +76,7 @@ module.exports.describe = ({testRunner, product, playwrightPath}) => { | |||
|     product, | ||||
|     FFOX, | ||||
|     WEBKIT, | ||||
|     CHROME, | ||||
|     CHROMIUM, | ||||
|     MAC, | ||||
|     LINUX, | ||||
|     WIN, | ||||
|  | @ -170,14 +170,14 @@ module.exports.describe = ({testRunner, product, playwrightPath}) => { | |||
|       testRunner.loadTests(require('./geolocation.spec.js'), testOptions); | ||||
|       testRunner.loadTests(require('./workers.spec.js'), testOptions); | ||||
| 
 | ||||
|       if (CHROME) { | ||||
|       if (CHROMIUM) { | ||||
|         testRunner.loadTests(require('./chromium/chromium.spec.js'), testOptions); | ||||
|         testRunner.loadTests(require('./chromium/coverage.spec.js'), testOptions); | ||||
|         testRunner.loadTests(require('./chromium/pdf.spec.js'), testOptions); | ||||
|         testRunner.loadTests(require('./chromium/session.spec.js'), testOptions); | ||||
|       } | ||||
| 
 | ||||
|       if (CHROME || FFOX) { | ||||
|       if (CHROMIUM || FFOX) { | ||||
|         testRunner.loadTests(require('./features/permissions.spec.js'), testOptions); | ||||
|       } | ||||
| 
 | ||||
|  | @ -187,7 +187,7 @@ module.exports.describe = ({testRunner, product, playwrightPath}) => { | |||
|     testRunner.loadTests(require('./browser.spec.js'), testOptions); | ||||
|     testRunner.loadTests(require('./browsercontext.spec.js'), testOptions); | ||||
|     testRunner.loadTests(require('./ignorehttpserrors.spec.js'), testOptions); | ||||
|     if (CHROME) { | ||||
|     if (CHROMIUM) { | ||||
|       testRunner.loadTests(require('./chromium/browser.spec.js'), testOptions); | ||||
|     } | ||||
|     if (FFOX) { | ||||
|  | @ -200,7 +200,7 @@ module.exports.describe = ({testRunner, product, playwrightPath}) => { | |||
|   testRunner.loadTests(require('./fixtures.spec.js'), testOptions); | ||||
|   testRunner.loadTests(require('./launcher.spec.js'), testOptions); | ||||
| 
 | ||||
|   if (CHROME) { | ||||
|   if (CHROMIUM) { | ||||
|     testRunner.loadTests(require('./chromium/connect.spec.js'), testOptions); | ||||
|     testRunner.loadTests(require('./chromium/launcher.spec.js'), testOptions); | ||||
|     testRunner.loadTests(require('./chromium/headful.spec.js'), testOptions); | ||||
|  |  | |||
|  | @ -15,7 +15,7 @@ | |||
|  * limitations under the License. | ||||
|  */ | ||||
| 
 | ||||
| module.exports.describe = function({testRunner, expect, product, FFOX, CHROME, WEBKIT}) { | ||||
| module.exports.describe = function({testRunner, expect, product, FFOX, CHROMIUM, WEBKIT}) { | ||||
|   const {describe, xdescribe, fdescribe} = testRunner; | ||||
|   const {it, fit, xit, dit} = testRunner; | ||||
|   const {beforeAll, beforeEach, afterAll, afterEach} = testRunner; | ||||
|  |  | |||
|  | @ -15,7 +15,7 @@ | |||
|  * limitations under the License. | ||||
|  */ | ||||
| 
 | ||||
| module.exports.describe = function({testRunner, expect, product, FFOX, CHROME, WEBKIT}) { | ||||
| module.exports.describe = function({testRunner, expect, product, FFOX, CHROMIUM, WEBKIT}) { | ||||
|   const {describe, xdescribe, fdescribe} = testRunner; | ||||
|   const {it, fit, xit, dit} = testRunner; | ||||
|   const {beforeAll, beforeEach, afterAll, afterEach} = testRunner; | ||||
|  |  | |||
|  | @ -17,7 +17,7 @@ | |||
| 
 | ||||
| const utils = require('./utils'); | ||||
| 
 | ||||
| module.exports.describe = function({testRunner, expect, product, playwright, FFOX, CHROME, WEBKIT}) { | ||||
| module.exports.describe = function({testRunner, expect, product, playwright, FFOX, CHROMIUM, WEBKIT}) { | ||||
|   const {describe, xdescribe, fdescribe} = testRunner; | ||||
|   const {it, fit, xit, dit} = testRunner; | ||||
|   const {beforeAll, beforeEach, afterAll, afterEach} = testRunner; | ||||
|  |  | |||
|  | @ -14,12 +14,12 @@ | |||
|  * limitations under the License. | ||||
|  */ | ||||
| 
 | ||||
| module.exports.describe = function({testRunner, expect, defaultBrowserOptions, playwright, product, CHROME, FFOX}) { | ||||
| module.exports.describe = function({testRunner, expect, defaultBrowserOptions, playwright, product, CHROMIUM, FFOX}) { | ||||
|   const {describe, xdescribe, fdescribe} = testRunner; | ||||
|   const {it, fit, xit, dit} = testRunner; | ||||
|   const {beforeAll, beforeEach, afterAll, afterEach} = testRunner; | ||||
| 
 | ||||
|   (CHROME || FFOX) && describe('Web SDK', function() { | ||||
|   (CHROMIUM || FFOX) && describe('Web SDK', function() { | ||||
|     beforeAll(async state => { | ||||
|       state.controlledBrowserServer = await playwright.launchServer({ ...defaultBrowserOptions, pipe: false }); | ||||
|       state.hostBrowserServer = await playwright.launchServer(defaultBrowserOptions); | ||||
|  |  | |||
|  | @ -18,7 +18,7 @@ | |||
| const utils = require('./utils'); | ||||
| const { waitEvent } = utils; | ||||
| 
 | ||||
| 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; | ||||
|  |  | |||
|  | @ -5,7 +5,7 @@ const StreamZip = require('node-stream-zip'); | |||
| const vm = require('vm'); | ||||
| const os = require('os'); | ||||
| 
 | ||||
| async function generateChromeProtocol(revision) { | ||||
| async function generateChromiunProtocol(revision) { | ||||
|   const outputPath = path.join(__dirname, '..', '..', 'src', 'chromium', 'protocol.ts'); | ||||
|   if (revision.local && fs.existsSync(outputPath)) | ||||
|     return; | ||||
|  | @ -215,4 +215,4 @@ function firefoxTypeToString(type, indent='    ') { | |||
|   return type['$type']; | ||||
| } | ||||
| 
 | ||||
| module.exports = {generateChromeProtocol, generateFirefoxProtocol, generateWebKitProtocol}; | ||||
| module.exports = {generateChromiunProtocol, generateFirefoxProtocol, generateWebKitProtocol}; | ||||
		Loading…
	
		Reference in New Issue