Skip to content

Commit 50e11ab

Browse files
authored
Undo breaking change (#2412)
1 parent 0a4fdb7 commit 50e11ab

23 files changed

+56
-56
lines changed

lib/PuppeteerSharp.Tests/BrowserContextTests/BrowserContextTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ public async Task ShouldTimeoutWaitingForNonExistentTarget()
184184
{
185185
var context = await Browser.CreateIncognitoBrowserContextAsync();
186186
Assert.ThrowsAsync<TimeoutException>(()
187-
=> context.WaitForTargetAsync((target) => target.Url == TestConstants.EmptyPage, new WaitTimeoutOptions(1)));
187+
=> context.WaitForTargetAsync((target) => target.Url == TestConstants.EmptyPage, new WaitForOptions(1)));
188188
await context.CloseAsync();
189189
}
190190
}

lib/PuppeteerSharp.Tests/DeviceRequestPromptTests/DeviceRequestPromptWaitForDeviceTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public void ShouldRespectTimeout()
141141
{
142142
Id = "000",
143143
});
144-
Assert.ThrowsAsync<TimeoutException>(() => prompt.WaitForDeviceAsync(device => device.Name == "My Device 1", new WaitTimeoutOptions(1)));
144+
Assert.ThrowsAsync<TimeoutException>(() => prompt.WaitForDeviceAsync(device => device.Name == "My Device 1", new WaitForOptions(1)));
145145
}
146146

147147
[PuppeteerTest("DeviceRequestPrompt.test.ts", "DeviceRequestPrompt.waitForDevice", "should respect default timeout when there is no custom timeout")]
@@ -175,7 +175,7 @@ public void ShouldPrioritizeExactTimeoutOverDefaultTimeout()
175175
Id = "000",
176176
});
177177
timeoutSettings.Timeout = 0;
178-
Assert.ThrowsAsync<TimeoutException>(() => prompt.WaitForDeviceAsync(device => device.Name == "My Device 1", new WaitTimeoutOptions(1)));
178+
Assert.ThrowsAsync<TimeoutException>(() => prompt.WaitForDeviceAsync(device => device.Name == "My Device 1", new WaitForOptions(1)));
179179
}
180180

181181
[PuppeteerTest("DeviceRequestPrompt.test.ts", "DeviceRequestPrompt.waitForDevice", "should work with no timeout")]
@@ -191,7 +191,7 @@ public async Task ShouldWorkWithNoTimeout()
191191
{
192192
Id = "000",
193193
});
194-
var deviceTask = prompt.WaitForDeviceAsync(device => device.Name == "My Device 1", new WaitTimeoutOptions(0));
194+
var deviceTask = prompt.WaitForDeviceAsync(device => device.Name == "My Device 1", new WaitForOptions(0));
195195

196196
var promptData = new DeviceAccessDeviceRequestPromptedResponse()
197197
{

lib/PuppeteerSharp.Tests/DeviceRequestPromptTests/WaitForDevicePromptTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public void ShouldRespectTimeout()
8585
var client = new MockCDPSession();
8686
var timeoutSettings = new TimeoutSettings();
8787
var manager = new DeviceRequestPromptManager(client, timeoutSettings);
88-
Assert.ThrowsAsync<TimeoutException>(() => manager.WaitForDevicePromptAsync(new WaitTimeoutOptions(1)));
88+
Assert.ThrowsAsync<TimeoutException>(() => manager.WaitForDevicePromptAsync(new WaitForOptions(1)));
8989
}
9090

9191
[PuppeteerTest("DeviceRequestPrompt.test.ts", "waitForDevicePrompt", "should respect default timeout when there is no custom timeout")]
@@ -107,7 +107,7 @@ public void ShouldPrioritizeExactTimeoutOverDefaultTimeout()
107107
var timeoutSettings = new TimeoutSettings();
108108
var manager = new DeviceRequestPromptManager(client, timeoutSettings);
109109
timeoutSettings.Timeout = 0;
110-
Assert.ThrowsAsync<TimeoutException>(() => manager.WaitForDevicePromptAsync(new WaitTimeoutOptions(1)));
110+
Assert.ThrowsAsync<TimeoutException>(() => manager.WaitForDevicePromptAsync(new WaitForOptions(1)));
111111
}
112112

113113
[PuppeteerTest("DeviceRequestPrompt.test.ts", "waitForDevicePrompt", "should work with no timeout")]
@@ -117,7 +117,7 @@ public async Task ShouldWorkWithNoTimeout()
117117
var client = new MockCDPSession();
118118
var timeoutSettings = new TimeoutSettings();
119119
var manager = new DeviceRequestPromptManager(client, timeoutSettings);
120-
var promptTask = manager.WaitForDevicePromptAsync(new WaitTimeoutOptions(0));
120+
var promptTask = manager.WaitForDevicePromptAsync(new WaitForOptions(0));
121121
var promptData = new DeviceAccessDeviceRequestPromptedResponse()
122122
{
123123
Id = "00000000000000000000000000000000",

lib/PuppeteerSharp.Tests/InputTests/PageWaitForFileChooserTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ await Task.WhenAll(
4949
[Skip(SkipAttribute.Targets.Firefox)]
5050
public void ShouldRespectTimeout()
5151
{
52-
Assert.ThrowsAsync<TimeoutException>(() => Page.WaitForFileChooserAsync(new WaitTimeoutOptions
52+
Assert.ThrowsAsync<TimeoutException>(() => Page.WaitForFileChooserAsync(new WaitForOptions
5353
{
5454
Timeout = 1
5555
}));
@@ -68,7 +68,7 @@ public void ShouldRespectTimeoutWhenThereIsNoCustomTimeout()
6868
public void ShouldPrioritizeExactTimeoutOverDefaultTimeout()
6969
{
7070
Page.DefaultTimeout = 0;
71-
Assert.ThrowsAsync<TimeoutException>(() => Page.WaitForFileChooserAsync(new WaitTimeoutOptions
71+
Assert.ThrowsAsync<TimeoutException>(() => Page.WaitForFileChooserAsync(new WaitForOptions
7272
{
7373
Timeout = 1
7474
}));
@@ -78,7 +78,7 @@ public void ShouldPrioritizeExactTimeoutOverDefaultTimeout()
7878
[Skip(SkipAttribute.Targets.Firefox)]
7979
public async Task ShouldWorkWithNoTimeout()
8080
{
81-
var waitForTask = Page.WaitForFileChooserAsync(new WaitTimeoutOptions { Timeout = 0 });
81+
var waitForTask = Page.WaitForFileChooserAsync(new WaitForOptions { Timeout = 0 });
8282

8383
await Task.WhenAll(
8484
waitForTask,

lib/PuppeteerSharp.Tests/PageTests/WaitForRequestTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public async Task ShouldRespectTimeout()
5050
{
5151
await Page.GoToAsync(TestConstants.EmptyPage);
5252
var exception = Assert.ThrowsAsync<TimeoutException>(async () =>
53-
await Page.WaitForRequestAsync(_ => false, new WaitTimeoutOptions(1)));
53+
await Page.WaitForRequestAsync(_ => false, new WaitForOptions(1)));
5454

5555
StringAssert.Contains("Timeout of 1 ms exceeded", exception.Message);
5656
}
@@ -72,7 +72,7 @@ public async Task ShouldRespectDefaultTimeout()
7272
public async Task ShouldWorkWithNoTimeout()
7373
{
7474
await Page.GoToAsync(TestConstants.EmptyPage);
75-
var task = Page.WaitForRequestAsync(TestConstants.ServerUrl + "/digits/2.png", new WaitTimeoutOptions(0));
75+
var task = Page.WaitForRequestAsync(TestConstants.ServerUrl + "/digits/2.png", new WaitForOptions(0));
7676

7777
await Task.WhenAll(
7878
task,

lib/PuppeteerSharp.Tests/PageTests/WaitForResponseTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public async Task ShouldRespectTimeout()
7777
{
7878
await Page.GoToAsync(TestConstants.EmptyPage);
7979
var exception = Assert.ThrowsAsync<TimeoutException>(async () =>
80-
await Page.WaitForResponseAsync(_ => false, new WaitTimeoutOptions(1)));
80+
await Page.WaitForResponseAsync(_ => false, new WaitForOptions(1)));
8181

8282
StringAssert.Contains("Timeout of 1 ms exceeded", exception.Message);
8383
}
@@ -99,7 +99,7 @@ public async Task ShouldRespectDefaultTimeout()
9999
public async Task ShouldWorkWithNoTimeout()
100100
{
101101
await Page.GoToAsync(TestConstants.EmptyPage);
102-
var task = Page.WaitForResponseAsync(TestConstants.ServerUrl + "/digits/2.png", new WaitTimeoutOptions(0));
102+
var task = Page.WaitForResponseAsync(TestConstants.ServerUrl + "/digits/2.png", new WaitForOptions(0));
103103

104104
await Task.WhenAll(
105105
task,

lib/PuppeteerSharp/Browser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ public void Disconnect()
199199
public Task CloseAsync() => _closeTask ?? (_closeTask = CloseCoreAsync());
200200

201201
/// <inheritdoc/>
202-
public async Task<ITarget> WaitForTargetAsync(Func<ITarget, bool> predicate, WaitTimeoutOptions options = null)
202+
public async Task<ITarget> WaitForTargetAsync(Func<ITarget, bool> predicate, WaitForOptions options = null)
203203
{
204204
if (predicate == null)
205205
{

lib/PuppeteerSharp/BrowserContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ internal BrowserContext(Connection connection, Browser browser, string contextId
4646
public ITarget[] Targets() => Array.FindAll(Browser.Targets(), target => target.BrowserContext == this);
4747

4848
/// <inheritdoc/>
49-
public Task<ITarget> WaitForTargetAsync(Func<ITarget, bool> predicate, WaitTimeoutOptions options = null)
49+
public Task<ITarget> WaitForTargetAsync(Func<ITarget, bool> predicate, WaitForOptions options = null)
5050
=> Browser.WaitForTargetAsync((target) => target.BrowserContext == this && predicate(target), options);
5151

5252
/// <inheritdoc/>

lib/PuppeteerSharp/DeviceRequestPrompt.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public Task SelectAsync(DeviceRequestPromptDevice device)
8484
/// <param name="filter">The filter to apply.</param>
8585
/// <param name="options">The options.</param>
8686
/// <returns>A task that resolves to the first device matching the filter.</returns>
87-
public Task<DeviceRequestPromptDevice> WaitForDeviceAsync(Func<DeviceRequestPromptDevice, bool> filter, WaitTimeoutOptions options = default)
87+
public Task<DeviceRequestPromptDevice> WaitForDeviceAsync(Func<DeviceRequestPromptDevice, bool> filter, WaitForOptions options = default)
8888
{
8989
foreach (var device in Devices.Where(filter))
9090
{

lib/PuppeteerSharp/DeviceRequestPromptManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ internal DeviceRequestPromptManager(ICDPSession client, TimeoutSettings timeoutS
4040
_client.MessageReceived += OnMessageReceived;
4141
}
4242

43-
public async Task<DeviceRequestPrompt> WaitForDevicePromptAsync(WaitTimeoutOptions options = default)
43+
public async Task<DeviceRequestPrompt> WaitForDevicePromptAsync(WaitForOptions options = default)
4444
{
4545
if (_client == null)
4646
{

0 commit comments

Comments
 (0)