-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[dotnet] Forward subscription options in browser context for log module
- Loading branch information
1 parent
71a0629
commit 0666cb4
Showing
1 changed file
with
5 additions
and
5 deletions.
There are no files selected for viewing
10 changes: 5 additions & 5 deletions
10
dotnet/src/webdriver/BiDi/Modules/BrowsingContext/BrowsingContextLogModule.cs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,30 @@ | ||
using OpenQA.Selenium.BiDi.Modules.Log; | ||
using OpenQA.Selenium.BiDi.Modules.Log; | ||
using System.Threading.Tasks; | ||
using System; | ||
|
||
namespace OpenQA.Selenium.BiDi.Modules.BrowsingContext; | ||
|
||
public class BrowsingContextLogModule(BrowsingContext context, LogModule logModule) | ||
{ | ||
public Task<Subscription> OnEntryAddedAsync(Func<BaseLogEntry, Task> handler) | ||
public Task<Subscription> OnEntryAddedAsync(Func<BaseLogEntry, Task> handler, SubscriptionOptions options = null) | ||
{ | ||
return logModule.OnEntryAddedAsync(async args => | ||
{ | ||
if (args.Source.Context?.Equals(context) is true) | ||
{ | ||
await handler(args).ConfigureAwait(false); | ||
} | ||
}); | ||
}, options); | ||
} | ||
|
||
public Task<Subscription> OnEntryAddedAsync(Action<BaseLogEntry> handler) | ||
public Task<Subscription> OnEntryAddedAsync(Action<BaseLogEntry> handler, SubscriptionOptions options = null) | ||
{ | ||
return logModule.OnEntryAddedAsync(args => | ||
{ | ||
if (args.Source.Context?.Equals(context) is true) | ||
{ | ||
handler(args); | ||
} | ||
}); | ||
}, options); | ||
} | ||
} |