-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[dotnet] [bidi] Context aware network collector #16866
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] Context aware network collector #16866
Conversation
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
|||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||||||||
User description
This is following to pattern of extensions.
💥 What does this PR do?
Ability to add network data collector which is scoped to context:
🔧 Implementation Notes
AddDataCollectorcommand🔄 Types of changes
PR Type
Enhancement
Description
Add context-aware network data collector scoped to browsing context
Introduce
BrowsingContextAddDataCollectorOptionsfor context-specific configurationFix
AddDataCollectorAsyncreturn type fromCollectortoAddDataCollectorResultUpdate tests to verify both module-level and context-level data collector functionality
Diagram Walkthrough
File Walkthrough
BrowsingContextNetworkModule.cs
Add context-aware AddDataCollectorAsync methoddotnet/src/webdriver/BiDi/BrowsingContext/BrowsingContextNetworkModule.cs
System.Collections.Genericimport forIEnumerablesupportAddDataCollectorAsyncmethod that wraps network module callwith context-scoped options
Contextsproperty to current browsing contextAddDataCollectorCommand.cs
Refactor AddDataCollectorOptions with context-aware variantdotnet/src/webdriver/BiDi/Network/AddDataCollectorCommand.cs
AddDataCollectorOptionsto parameterless constructor withinternal copy constructor
BrowsingContextAddDataCollectorOptionsfor conversionBrowsingContextAddDataCollectorOptionsclass forcontext-specific configuration
NetworkModule.cs
Fix AddDataCollectorAsync return type and parameter namingdotnet/src/webdriver/BiDi/Network/NetworkModule.cs
CollectortoAddDataCollectorResultforconsistency
CollectorpropertySetCacheBehaviorCommand.cs
Simplify SetCacheBehaviorOptions constructor patterndotnet/src/webdriver/BiDi/Network/SetCacheBehaviorCommand.cs
SetCacheBehaviorOptionsto use parameterless constructorsyntax
: this()pattern for cleanercode
NetworkTest.cs
Update tests for AddDataCollectorResult and context-aware collectordotnet/test/common/BiDi/Network/NetworkTest.cs
AddDataCollectorResultobject instead ofCollectordirectlyCollectorpropertyAddDataCollectorAsyncmethodfunctionality