Skip to content

fix(screencast): register AnnotatePosition enum serializer#1948

Open
Develop-KIM wants to merge 1 commit into
microsoft:mainfrom
Develop-KIM:fix-1912
Open

fix(screencast): register AnnotatePosition enum serializer#1948
Develop-KIM wants to merge 1 commit into
microsoft:mainfrom
Develop-KIM:fix-1912

Conversation

@Develop-KIM

Copy link
Copy Markdown

Summary

  • AnnotatePosition had no Gson serializer registered, so page.screencast().showActions(new Screencast.ShowActionsOptions().setPosition(AnnotatePosition.TOP_RIGHT)) sent the raw constant TOP_RIGHT to the driver, which rejected it: position: expected one of (top-left|top|top-right|...).
  • Registered it with ToLowerCaseAndDashSerializer (as used for ColorScheme, ServiceWorkerPolicy, …) so values serialize as top-right etc.

Fixes #1912

AnnotatePosition had no Gson serializer registered, so
Screencast.showActions() sent the raw enum constant (e.g. TOP_RIGHT) to
the driver, which rejected it with "position: expected one of
(top-left|top|top-right|...)". Register it with ToLowerCaseAndDashSerializer
so values serialize as top-right, matching the other dashed enums.

Fixes: microsoft#1912
@Develop-KIM

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: showActions() with ShowActionsOptions.setPosition() throws protocol error for all AnnotatePosition values

1 participant