cherry-pick(1.20): add name for screenshot animations option (#12608)

This commit is contained in:
Yury Semikhatsky 2022-03-08 18:04:32 -08:00 committed by GitHub
parent 84f36df415
commit 503dc782b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 8 deletions

View file

@ -328,7 +328,7 @@ Waits for the specific [`param: selector`] to either appear or disappear, depend
Selector to wait for. Selector to wait for.
### option: AndroidDevice.wait.state ### option: AndroidDevice.wait.state
- `state` <"gone"> - `state` <[AndroidDeviceState]<"gone">>
Optional state. Can be either: Optional state. Can be either:
* default - wait for element to be present. * default - wait for element to be present.

View file

@ -28,7 +28,7 @@ Determines whether sink is interested in the logger with the given name and seve
logger name logger name
### param: Logger.isEnabled.severity ### param: Logger.isEnabled.severity
- `severity` <"verbose"|"info"|"warning"|"error"> - `severity` <[LogSeverity]<"verbose"|"info"|"warning"|"error">>
## method: Logger.log ## method: Logger.log
@ -38,7 +38,7 @@ logger name
logger name logger name
### param: Logger.log.severity ### param: Logger.log.severity
- `severity` <"verbose"|"info"|"warning"|"error"> - `severity` <[LogSeverity]<"verbose"|"info"|"warning"|"error">>
### param: Logger.log.message ### param: Logger.log.message
- `message` <[string]|[Error]> - `message` <[string]|[Error]>

View file

@ -902,7 +902,7 @@ Note that outer and inner locators must belong to the same frame. Inner locator
- %%-locator-option-has-%% - %%-locator-option-has-%%
## screenshot-option-animations ## screenshot-option-animations
- `animations` <"disabled"> - `animations` <[ScreenshotAnimations]<"disabled">>
When set to `"disabled"`, stops CSS animations, CSS transitions and Web Animations. Animations get different treatment depending on their duration: When set to `"disabled"`, stops CSS animations, CSS transitions and Web Animations. Animations get different treatment depending on their duration:
* finite animations are fast-forwarded to completion, so they'll fire `transitionend` event. * finite animations are fast-forwarded to completion, so they'll fire `transitionend` event.

View file

@ -288,7 +288,7 @@ test('runs second', async ({ page }) => {});
``` ```
### option: Test.describe.configure.mode ### option: Test.describe.configure.mode
- `mode` <"parallel"|"serial"> - `mode` <[TestMode]<"parallel"|"serial">>

View file

@ -448,7 +448,11 @@ Documentation.Type = class {
* @return {Documentation.Type} * @return {Documentation.Type}
*/ */
static fromParsedType(parsedType, inUnion = false) { static fromParsedType(parsedType, inUnion = false) {
if (!inUnion && parsedType.union) { if (!inUnion && !parsedType.unionName && isStringUnion(parsedType) ) {
throw new Error('Enum must have a name:\n' + JSON.stringify(parsedType, null, 2));
}
if (!inUnion && (parsedType.union || parsedType.unionName)) {
const type = new Documentation.Type(parsedType.unionName || ''); const type = new Documentation.Type(parsedType.unionName || '');
type.union = []; type.union = [];
for (let t = parsedType; t; t = t.union) { for (let t = parsedType; t; t = t.union) {
@ -568,8 +572,6 @@ Documentation.Type = class {
* @returns {boolean} * @returns {boolean}
*/ */
function isStringUnion(type) { function isStringUnion(type) {
if (!type.union)
return false;
while (type) { while (type) {
if (!type.name.startsWith('"') || !type.name.endsWith('"')) if (!type.name.startsWith('"') || !type.name.endsWith('"'))
return false; return false;