Skip to content

Commit b0ba5e1

Browse files
committed
adjust ShouldTimeoutIfNavigationOccurs test which now throws a TaskCanceledException on navigation
1 parent 1bf7e15 commit b0ba5e1

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

CefSharp.Test/Selector/WaitForSelectorAsyncTests.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,9 @@ public async Task CanTimeout()
155155
}
156156

157157
[Fact]
158-
public async Task ShouldTimeoutIfNavigationOccurs()
158+
public async Task ShouldCancelIfNavigationOccurs()
159159
{
160-
const string expected = "The operation has timed out.";
160+
const string expected = "A task was canceled.";
161161
const string url = CefExample.HelloWorldUrl;
162162

163163
using (var browser = new ChromiumWebBrowser(CefExample.DefaultUrl, useLegacyRenderHandler: false))
@@ -166,7 +166,7 @@ public async Task ShouldTimeoutIfNavigationOccurs()
166166

167167
Assert.True(response.Success);
168168

169-
var exception = await Assert.ThrowsAnyAsync<TimeoutException>(async () =>
169+
var exception = await Assert.ThrowsAnyAsync<TaskCanceledException>(async () =>
170170
{
171171
var navigationTask = browser.WaitForSelectorAsync("non-existant");
172172
var evaluateTask = browser.EvaluateScriptAsync($"setTimeout(() => window.location.href = '{url}', 100);");
@@ -175,7 +175,6 @@ public async Task ShouldTimeoutIfNavigationOccurs()
175175
});
176176

177177
Assert.Contains(expected, exception.Message);
178-
Assert.Contains(url, browser.GetMainFrame().Url);
179178

180179
output.WriteLine("Exception {0}", exception.Message);
181180
}

0 commit comments

Comments
 (0)