Skip to content

Commit

Permalink
[dotnet] get devtools tests passing
Browse files Browse the repository at this point in the history
  • Loading branch information
titusfortner committed Oct 26, 2022
1 parent 6b8c48b commit 0ba1b14
Showing 1 changed file with 31 additions and 31 deletions.
62 changes: 31 additions & 31 deletions dotnet/test/common/DevTools/DevToolsNetworkTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -322,33 +322,33 @@ public async Task VerifyResponseReceivedEventAndNetworkDisable()
public async Task VerifyWebSocketOperations()
{
var domains = session.GetVersionSpecificDomains<V107.DevToolsSessionDomains>();
await domains.Network.Enable(new V106.Network.EnableCommandSettings());
await domains.Network.Enable(new V107.Network.EnableCommandSettings());

EventHandler<V106.Network.WebSocketCreatedEventArgs> webSocketCreatedHandler = (sender, e) =>
EventHandler<V107.Network.WebSocketCreatedEventArgs> webSocketCreatedHandler = (sender, e) =>
{
Assert.That(e, Is.Not.Null);
};
domains.Network.WebSocketCreated += webSocketCreatedHandler;

EventHandler<V106.Network.WebSocketFrameReceivedEventArgs> webSocketFrameReceivedHandler = (sender, e) =>
EventHandler<V107.Network.WebSocketFrameReceivedEventArgs> webSocketFrameReceivedHandler = (sender, e) =>
{
Assert.That(e, Is.Not.Null);
};
domains.Network.WebSocketFrameReceived += webSocketFrameReceivedHandler;

EventHandler<V106.Network.WebSocketFrameErrorEventArgs>webSocketFrameErrorHandler = (sender, e) =>
EventHandler<V107.Network.WebSocketFrameErrorEventArgs>webSocketFrameErrorHandler = (sender, e) =>
{
Assert.That(e, Is.Not.Null);
};
domains.Network.WebSocketFrameError += webSocketFrameErrorHandler;

EventHandler<V106.Network.WebSocketFrameSentEventArgs> webSocketFrameSentHandler = (sender, e) =>
EventHandler<V107.Network.WebSocketFrameSentEventArgs> webSocketFrameSentHandler = (sender, e) =>
{
Assert.That(e, Is.Not.Null);
};
domains.Network.WebSocketFrameSent += webSocketFrameSentHandler;

EventHandler<V106.Network.WebSocketClosedEventArgs> webSocketClosedHandler = (sender, e) =>
EventHandler<V107.Network.WebSocketClosedEventArgs> webSocketClosedHandler = (sender, e) =>
{
Assert.That(e, Is.Not.Null);
};
Expand All @@ -363,13 +363,13 @@ public async Task VerifyWebSocketOperations()
[IgnoreBrowser(Selenium.Browser.Safari, "Safari does not support Chrome DevTools Protocol")]
public async Task VerifyRequestPostData()
{
var domains = session.GetVersionSpecificDomains<V106.DevToolsSessionDomains>();
await domains.Network.Enable(new V106.Network.EnableCommandSettings());
var domains = session.GetVersionSpecificDomains<V107.DevToolsSessionDomains>();
await domains.Network.Enable(new V107.Network.EnableCommandSettings());

string[] requestIds = new string[1];

ManualResetEventSlim requestSync = new ManualResetEventSlim(false);
EventHandler<V106.Network.RequestWillBeSentEventArgs> requestWillBeSentHandler = (sender, e) =>
EventHandler<V107.Network.RequestWillBeSentEventArgs> requestWillBeSentHandler = (sender, e) =>
{
Assert.That(e, Is.Not.Null);
if (string.Compare(e.Request.Method, "post", StringComparison.OrdinalIgnoreCase) == 0)
Expand All @@ -384,7 +384,7 @@ public async Task VerifyRequestPostData()
driver.FindElement(By.XPath("//form/input")).Click();
requestSync.Wait(TimeSpan.FromSeconds(5));

var response = await domains.Network.GetRequestPostData(new V106.Network.GetRequestPostDataCommandSettings()
var response = await domains.Network.GetRequestPostData(new V107.Network.GetRequestPostDataCommandSettings()
{
RequestId = requestIds[0]
});
Expand All @@ -398,9 +398,9 @@ public async Task VerifyRequestPostData()
[IgnoreBrowser(Selenium.Browser.Safari, "Safari does not support Chrome DevTools Protocol")]
public async Task ByPassServiceWorker()
{
var domains = session.GetVersionSpecificDomains<V106.DevToolsSessionDomains>();
await domains.Network.Enable(new V106.Network.EnableCommandSettings());
await domains.Network.SetBypassServiceWorker(new V106.Network.SetBypassServiceWorkerCommandSettings()
var domains = session.GetVersionSpecificDomains<V107.DevToolsSessionDomains>();
await domains.Network.Enable(new V107.Network.EnableCommandSettings());
await domains.Network.SetBypassServiceWorker(new V107.Network.SetBypassServiceWorkerCommandSettings()
{
Bypass = true
});
Expand All @@ -412,11 +412,11 @@ await domains.Network.SetBypassServiceWorker(new V106.Network.SetBypassServiceWo
[IgnoreBrowser(Selenium.Browser.Safari, "Safari does not support Chrome DevTools Protocol")]
public async Task VerifyEventSourceMessage()
{
var domains = session.GetVersionSpecificDomains<V106.DevToolsSessionDomains>();
await domains.Network.Enable(new V106.Network.EnableCommandSettings());
var domains = session.GetVersionSpecificDomains<V107.DevToolsSessionDomains>();
await domains.Network.Enable(new V107.Network.EnableCommandSettings());

ManualResetEventSlim requestSync = new ManualResetEventSlim(false);
EventHandler<V106.Network.EventSourceMessageReceivedEventArgs> eventSourceMessageReceivedHandler = (sender, e) =>
EventHandler<V107.Network.EventSourceMessageReceivedEventArgs> eventSourceMessageReceivedHandler = (sender, e) =>
{
Assert.That(e, Is.Not.Null);
requestSync.Set();
Expand All @@ -433,11 +433,11 @@ public async Task VerifyEventSourceMessage()
[IgnoreBrowser(Selenium.Browser.Safari, "Safari does not support Chrome DevTools Protocol")]
public async Task VerifySignedExchangeReceived()
{
var domains = session.GetVersionSpecificDomains<V106.DevToolsSessionDomains>();
await domains.Network.Enable(new V106.Network.EnableCommandSettings());
var domains = session.GetVersionSpecificDomains<V107.DevToolsSessionDomains>();
await domains.Network.Enable(new V107.Network.EnableCommandSettings());

ManualResetEventSlim requestSync = new ManualResetEventSlim(false);
EventHandler<V106.Network.SignedExchangeReceivedEventArgs> signedExchangeReceivedHandler = (sender, e) =>
EventHandler<V107.Network.SignedExchangeReceivedEventArgs> signedExchangeReceivedHandler = (sender, e) =>
{
Assert.That(e, Is.Not.Null);
requestSync.Set();
Expand All @@ -454,11 +454,11 @@ public async Task VerifySignedExchangeReceived()
[IgnoreBrowser(Selenium.Browser.Safari, "Safari does not support Chrome DevTools Protocol")]
public async Task VerifyResourceChangedPriority()
{
var domains = session.GetVersionSpecificDomains<V106.DevToolsSessionDomains>();
await domains.Network.Enable(new V106.Network.EnableCommandSettings());
var domains = session.GetVersionSpecificDomains<V107.DevToolsSessionDomains>();
await domains.Network.Enable(new V107.Network.EnableCommandSettings());

ManualResetEventSlim requestSync = new ManualResetEventSlim(false);
EventHandler<V106.Network.ResourceChangedPriorityEventArgs> resourceChangedPriorityHandler = (sender, e) =>
EventHandler<V107.Network.ResourceChangedPriorityEventArgs> resourceChangedPriorityHandler = (sender, e) =>
{
Assert.That(e, Is.Not.Null);
requestSync.Set();
Expand All @@ -475,30 +475,30 @@ public async Task VerifyResourceChangedPriority()
[IgnoreBrowser(Selenium.Browser.Safari, "Safari does not support Chrome DevTools Protocol")]
public async Task InterceptRequestAndContinue()
{
var domains = session.GetVersionSpecificDomains<V106.DevToolsSessionDomains>();
await domains.Network.Enable(new V106.Network.EnableCommandSettings());
var domains = session.GetVersionSpecificDomains<V107.DevToolsSessionDomains>();
await domains.Network.Enable(new V107.Network.EnableCommandSettings());

ManualResetEventSlim requestSync = new ManualResetEventSlim(false);
EventHandler<V106.Network.RequestInterceptedEventArgs> requestInterceptedHandler = (async (sender, e) =>
EventHandler<V107.Network.RequestInterceptedEventArgs> requestInterceptedHandler = (async (sender, e) =>
{
await domains.Network.ContinueInterceptedRequest(new V106.Network.ContinueInterceptedRequestCommandSettings()
await domains.Network.ContinueInterceptedRequest(new V107.Network.ContinueInterceptedRequestCommandSettings()
{
InterceptionId = e.InterceptionId
});
requestSync.Set();
});
domains.Network.RequestIntercepted += requestInterceptedHandler;

var pattern = new V106.Network.RequestPattern()
var pattern = new V107.Network.RequestPattern()
{
UrlPattern = "*.css",
ResourceType = V106.Network.ResourceType.Stylesheet,
InterceptionStage = V106.Network.InterceptionStage.HeadersReceived
ResourceType = V107.Network.ResourceType.Stylesheet,
InterceptionStage = V107.Network.InterceptionStage.HeadersReceived
};

await domains.Network.SetRequestInterception(new V106.Network.SetRequestInterceptionCommandSettings()
await domains.Network.SetRequestInterception(new V107.Network.SetRequestInterceptionCommandSettings()
{
Patterns = new V106.Network.RequestPattern[] { pattern }
Patterns = new V107.Network.RequestPattern[] { pattern }
});

driver.Url = EnvironmentManager.Instance.UrlBuilder.WhereIs("js/skins/lightgray/content.min.css");
Expand Down

0 comments on commit 0ba1b14

Please sign in to comment.