You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The error message for negative download throughput was fixed from "Downlod" to "Download", but the error handling for upload throughput is missing a similar error message.
Use consistent exception types for throughput validation. Currently using WebDriverException for download but ArgumentOutOfRangeException for bidirectional throughput. Should standardize on ArgumentOutOfRangeException for all throughput validations.
-throw new WebDriverException("Download throughput cannot be negative.");+throw new ArgumentOutOfRangeException(nameof(value), "Download throughput cannot be negative.");
Apply this suggestion
Suggestion importance[1-10]: 7
Why: Important consistency improvement that aligns with .NET best practices by using ArgumentOutOfRangeException for parameter validation across the codebase.
7
Fix typo in error message
Fix typo in error message for negative download throughput. The current message has a spelling error ("Downlod" instead of "Download").
-throw new WebDriverException("Downlod throughput cannot be negative.");+throw new WebDriverException("Download throughput cannot be negative.");
Apply this suggestion
Suggestion importance[1-10]: 4
Why: Fixes a minor spelling error in an error message that could affect user experience and code professionalism, though not impacting functionality.
4
Learned best practice
Include actual values in exception messages to improve debugging experience
The exception message for negative throughput values should include the actual invalid value to help with debugging. Update the validation check in DownloadThroughput and UploadThroughput properties to include the invalid value in the error message.
-throw new WebDriverException("Download throughput cannot be negative.");+throw new WebDriverException($"Download throughput cannot be negative. Provided value: {value}");
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
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.
Add nullability to Chromium configuration types
Motivation and Context
Contributes to #14640
Types of changes
Checklist
PR Type
Enhancement
Description
Enabled nullable reference types in Chromium-related classes.
Simplified property declarations and removed backing fields.
Improved exception handling and validation logic.
Enhanced code readability and maintainability.
Changes walkthrough 📝
ChromiumAndroidOptions.cs
Refactored ChromiumAndroidOptions with nullable typesdotnet/src/webdriver/Chromium/ChromiumAndroidOptions.cs
AndroidProcessnullable.ChromiumMobileEmulationDeviceSettings.cs
Refactored ChromiumMobileEmulationDeviceSettings with nullable typesdotnet/src/webdriver/Chromium/ChromiumMobileEmulationDeviceSettings.cs
UserAgentnullable.EnableTouchEvents.ChromiumNetworkConditions.cs
Refactored ChromiumNetworkConditions with nullable typesdotnet/src/webdriver/Chromium/ChromiumNetworkConditions.cs
ChromiumPerformanceLoggingPreferences.cs
Refactored ChromiumPerformanceLoggingPreferences with nullable typesdotnet/src/webdriver/Chromium/ChromiumPerformanceLoggingPreferences.cs