Skip to content

Commit 3ebbd8d

Browse files
authored
Remove warnings (#438)
1 parent ff30f2a commit 3ebbd8d

File tree

5 files changed

+5
-10
lines changed

5 files changed

+5
-10
lines changed

lib/PuppeteerSharp.Tests/TestConstants.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ public static class TestConstants
3636
Headless = Convert.ToBoolean(Environment.GetEnvironmentVariable("HEADLESS") ?? "true"),
3737
Args = new[] { "--no-sandbox" },
3838
Timeout = 0,
39-
KeepAliveInterval = 120,
4039
LogProcess = true
4140
};
4241

lib/PuppeteerSharp/Connection.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,7 @@ internal Connection(string url, int delay, ClientWebSocket ws, ILoggerFactory lo
3232
_sessions = new Dictionary<string, CDPSession>();
3333
_websocketReaderCancellationSource = new CancellationTokenSource();
3434

35-
Task task = Task.Factory.StartNew(async () =>
36-
{
37-
await GetResponseAsync();
38-
});
35+
Task.Factory.StartNew(GetResponseAsync);
3936
}
4037

4138
#region Private Members

lib/PuppeteerSharp/Frame.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,6 @@ public Task<JSHandle> WaitForFunctionAsync(string script, WaitForFunctionOptions
277277
/// </summary>
278278
/// <param name="script">Expression to be evaluated in browser context</param>
279279
/// <param name="options">Optional waiting parameters</param>
280-
/// <param name="args">Arguments to pass to <c>script</c></param>
281280
/// <returns>A task that resolves when the <c>script</c> returns a truthy value</returns>
282281
/// <seealso cref="Page.WaitForExpressionAsync(string, WaitForFunctionOptions)"/>
283282
public Task<JSHandle> WaitForExpressionAsync(string script, WaitForFunctionOptions options)
@@ -594,7 +593,7 @@ internal void SetDefaultContext(ExecutionContext context)
594593

595594
foreach (var waitTask in WaitTasks)
596595
{
597-
waitTask.Rerun();
596+
_ = waitTask.Rerun();
598597
}
599598
}
600599
else

lib/PuppeteerSharp/Page.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1247,7 +1247,7 @@ public Task<JSHandle> WaitForFunctionAsync(string script, WaitForFunctionOptions
12471247
/// <param name="script">Expression to be evaluated in browser context</param>
12481248
/// <param name="options">Optional waiting parameters</param>
12491249
/// <returns>A task that resolves when the <c>script</c> returns a truthy value</returns>
1250-
/// <seealso cref="Frame.WaitForExpressionAsync(string, WaitForFunctionOptions, object[])"/>
1250+
/// <seealso cref="Frame.WaitForExpressionAsync(string, WaitForFunctionOptions)"/>
12511251
public Task<JSHandle> WaitForExpressionAsync(string script, WaitForFunctionOptions options = null)
12521252
=> MainFrame.WaitForExpressionAsync(script, options ?? new WaitForFunctionOptions());
12531253

lib/PuppeteerSharp/WaitTask.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ internal WaitTask(
137137
_title = title;
138138

139139
frame.WaitTasks.Add(this);
140-
_taskCompletion = new TaskCompletionSource<JSHandle>();
141140

142141
_cts = new CancellationTokenSource();
143142

@@ -147,7 +146,8 @@ internal WaitTask(
147146
=> Termiante(new WaitTaskTimeoutException(timeout, title)));
148147
}
149148

150-
Rerun();
149+
_taskCompletion = new TaskCompletionSource<JSHandle>();
150+
_ = Rerun();
151151
}
152152

153153
internal Task<JSHandle> Task => _taskCompletion.Task;

0 commit comments

Comments
 (0)