Skip to content

Commit 1e0c0b2

Browse files
committed
WaitDoesNotAssertInAsyncCode
1 parent 3d30578 commit 1e0c0b2

File tree

1 file changed

+23
-0
lines changed
  • src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System/Runtime/InteropServices/JavaScript

1 file changed

+23
-0
lines changed

src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System/Runtime/InteropServices/JavaScript/WebWorkerTest.cs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,29 @@ await executor.Execute(async () =>
467467
}, cts.Token);
468468
}
469469

470+
471+
[Theory, MemberData(nameof(GetTargetThreadsAndBlockingCalls))]
472+
public async Task WaitDoesNotAssertInAsyncCode(Executor executor, NamedCall method)
473+
{
474+
using var cts = CreateTestCaseTimeoutSource();
475+
await executor.Execute(async () =>
476+
{
477+
await executor.StickyAwait(WebWorkerTestHelper.InitializeAsync(), cts.Token);
478+
479+
Exception? exception = null;
480+
try
481+
{
482+
method.Call(cts.Token);
483+
}
484+
catch (Exception ex)
485+
{
486+
exception = ex;
487+
}
488+
489+
Assert.Null(exception);
490+
}, cts.Token);
491+
}
492+
470493
[Theory, MemberData(nameof(GetTargetThreadsAndBlockingCalls))]
471494
public async Task WaitAssertsOnSyncCallback(Executor executor, NamedCall method)
472495
{

0 commit comments

Comments
 (0)