-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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] Fix JavaScriptEngine.ScriptCallbackBindings
not containing new bindings
#15221
[dotnet] Fix JavaScriptEngine.ScriptCallbackBindings
not containing new bindings
#15221
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
Failures are not related to changes in this PR: //dotnet/test/common:BiDi/Network/NetworkEventsTest-firefox
//java/test/org/openqa/selenium/mobile:NetworkConnectionTest
//java/test/org/openqa/selenium/remote:RemoteWebDriverScreenshotTest
//java/test/org/openqa/selenium/remote:RemoteWebDriverScreenshotTest-firefox-beta |
… new bindings (SeleniumHQ#15221) * [dotnet] Fix `JavaScriptEngine.ScriptCallbackBindings` not containing new bindings * Add tests * Implement IEquatable on `InitializationScript` * Remove implementation of IEquatable, override normal `Equals` * Override InitializationScript.GetHashCode
User description
… new bindings
Thanks for contributing to Selenium!
A PR well described will help maintainers to quickly review and merge it
Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, help reviewers by making them as simple and short as possible.
Motivation and Context
If a use accesses
JavaScriptEngine.ScriptCallbackBindings
, the list will always be empty.Types of changes
Checklist
PR Type
Bug fix, Tests
Description
Fixed
JavaScriptEngine.ScriptCallbackBindings
to correctly track bindings.Replaced
List<string>
withHashSet<string>
for bindings to ensure uniqueness.Added comprehensive tests for initialization scripts and script callback bindings.
Improved resource management with
using
statements in tests.Changes walkthrough 📝
JavaScriptEngine.cs
Refactor bindings to use `HashSet` for uniqueness
dotnet/src/webdriver/JavaScriptEngine.cs
bindings
fromList
toHashSet
for uniqueness.AddScriptCallbackBinding
to useHashSet.Add
for validation.RemoveScriptCallbackBinding
to discard the result ofRemove
.ExecutingJavascriptTest.cs
Add tests for script bindings and initialization scripts
dotnet/test/common/ExecutingJavascriptTest.cs
using
forJavaScriptEngine
.