-
-
Notifications
You must be signed in to change notification settings - Fork 477
Bidi jsonvalue support #2980
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: v21
Are you sure you want to change the base?
Bidi jsonvalue support #2980
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements BiDi (Browser Bidirectional) protocol support for JsonValue
operations, introducing a breaking change where EvaluateExpression
and EvaluateFunction
methods without generic type parameters now return Task
instead of Task<JsonElement?>
. This change accommodates the different default return types between CDP (Chrome DevTools Protocol) which returns JsonElement
and BiDi which returns RemoteValue
.
Key changes:
- Modified method signatures to return
Task
instead ofTask<JsonElement?>
for non-generic evaluation methods - Implemented
JsonValueAsync
support inBidiJSHandle
with primitive value deserialization - Updated type handling in
BidiRealm
to supportobject
type instead ofJsonElement?
Reviewed Changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
IPage.cs, IFrame.cs, WebWorker.cs, Page.cs, Frame.cs, Realm.cs, IsolatedWorld.cs | Changed return type from Task<JsonElement?> to Task for non-generic EvaluateExpressionAsync and EvaluateFunctionAsync methods |
BidiRealm.cs | Updated type handling to use object instead of JsonElement? , fixed struct property setting with boxing/unboxing, and changed non-generic evaluation methods to throw NotImplementedException |
BidiJSHandle.cs | Implemented JsonValueAsync method with primitive value deserialization support including string, int, double, bool, decimal, and DateTime types |
Test files | Updated test assertions to use generic type parameters where previously relying on non-generic methods |
TestExpectations.local.json | Removed test expectation rule that was marking jshandle.spec jsonValue tests as failing for webDriverBiDi |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Breaking Change: EvaluateExpression and EvalauteFunction with no generic type will return no value. That's because the default type of CDP is a
JsonElement
and the default type of BiDi is aRemoteValue
.