Skip to content

Commit

Permalink
[dotnet] Forward subscription options in browser context for log module
Browse files Browse the repository at this point in the history
  • Loading branch information
nvborisenko committed Sep 12, 2024
1 parent 71a0629 commit 0666cb4
Showing 1 changed file with 5 additions and 5 deletions.
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);
}
}

0 comments on commit 0666cb4

Please sign in to comment.