Skip to content

Commit 0f691b6

Browse files
committed
Test - Add MethodRunnerQueueFacts.DisposeQueueThenEnqueueMethodInvocation
Test to validate that MethodRunnerQueue doesn't have the same issues as #3639
1 parent 47f3bcd commit 0f691b6

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

CefSharp.Test/CefSharp.Test.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@
156156
<Compile Include="Framework\ConcurrentMethodRunnerQueueFacts.cs" />
157157
<Compile Include="Framework\CamelCaseNamingConverterFacts.cs" />
158158
<Compile Include="Framework\LegacyCamelCaseJavascriptNameConverterFacts.cs" />
159+
<Compile Include="Framework\MethodRunnerQueueFacts.cs" />
159160
<Compile Include="Framework\MimeTypeMappingFacts.cs" />
160161
<Compile Include="Framework\PathCheckFacts.cs" />
161162
<Compile Include="Framework\RequestContextBuilderFacts.cs" />
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// Copyright © 2021 The CefSharp Authors. All rights reserved.
2+
//
3+
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
4+
5+
using CefSharp.Internals;
6+
using Xunit;
7+
8+
namespace CefSharp.Test.Framework
9+
{
10+
public class MethodRunnerQueueFacts
11+
{
12+
[Fact]
13+
public void DisposeQueueThenEnqueueMethodInvocation()
14+
{
15+
var methodInvocation = new MethodInvocation(1, 1, 1, "Testing", 1);
16+
methodInvocation.Parameters.Add("Echo Me!");
17+
18+
var objectRepository = new JavascriptObjectRepository
19+
{
20+
NameConverter = null
21+
};
22+
23+
var methodRunnerQueue = new MethodRunnerQueue(objectRepository);
24+
25+
//Dispose
26+
methodRunnerQueue.Dispose();
27+
28+
//Enqueue
29+
var ex = Record.Exception(() => methodRunnerQueue.Enqueue(methodInvocation));
30+
31+
//Ensure no exception thrown
32+
Assert.Null(ex);
33+
}
34+
}
35+
}

0 commit comments

Comments
 (0)