-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[dotnet] [bidi] Decouple EvaluateResult in Script module #15493
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
[dotnet] [bidi] Decouple EvaluateResult in Script module #15493
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||
RenderMichael
left a comment
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.
These changes look good as part of the effort to remove nested DTOs.
In a future PR, we can change the EvaluateAsync/CallFunctionAsync to return EvaluateResult directly instead of throwing/returning success.
User description
Following spec https://w3c.github.io/webdriver-bidi/#type-script-EvaluateResult
I chose
EvaluateResultSuccessinstead of commonly usedSuccessEvaluateResult, preferred the same in spec.Motivation and Context
Contributes to #15407
Types of changes
Checklist
PR Type
Enhancement
Description
Replaced nested DTO types with standalone types for better extensibility.
Updated
EvaluateResultstructure to useEvaluateResultSuccessandEvaluateResultException.Adjusted serialization and deserialization logic to align with new DTO structure.
Refactored related methods and exception handling to use updated DTO types.
Changes walkthrough 📝
BiDiJsonSerializerContext.cs
Updated JSON serialization for new DTO typesdotnet/src/webdriver/BiDi/Communication/Json/BiDiJsonSerializerContext.cs
EvaluateResultSuccessandEvaluateResultException.EvaluateResultConverter.cs
Updated deserialization logic for new DTO typesdotnet/src/webdriver/BiDi/Communication/Json/Converters/Polymorphic/EvaluateResultConverter.cs
EvaluateResultSuccessandEvaluateResultException.BrowsingContextScriptModule.cs
Refactored methods to use new DTO typesdotnet/src/webdriver/BiDi/Modules/BrowsingContext/BrowsingContextScriptModule.cs
EvaluateResultSuccess.EvaluateCommand.cs
Refactored EvaluateCommand to use standalone DTOsdotnet/src/webdriver/BiDi/Modules/Script/EvaluateCommand.cs
EvaluateResulttypes with standaloneEvaluateResultSuccessandEvaluateResultException.EvaluateResultSuccess.ScriptEvaluateException.cs
Updated exception handling for new DTO structuredotnet/src/webdriver/BiDi/Modules/Script/ScriptEvaluateException.cs
EvaluateResultException.ScriptModule.cs
Refactored ScriptModule methods for new DTO typesdotnet/src/webdriver/BiDi/Modules/Script/ScriptModule.cs
EvaluateResultSuccessandEvaluateResultException.