Skip to content

Commit a1b5d87

Browse files
committed
Test - Fix IntegrationTestFacts.LoadJavaScriptBindingAsyncTaskQunitTestsSuccessfulCompletion
Add method interceptor so tests pass. Without it we get an VoidTaskResult object.
1 parent a9ac70e commit a1b5d87

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

CefSharp.Example/Resources/BindingTestsAsyncTask.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,9 @@
3131

3232
QUnit.test("WaitBeforeReturnAsync:", async (assert) =>
3333
{
34-
const expectedResult = null;
3534
const actualResult = await boundAsync.waitBeforeReturnAsync(2000);
3635

37-
assert.equal(expectedResult, actualResult, "Return null");
36+
assert.notOk(actualResult, "Method awaited without returning response.");
3837
});
3938

4039
QUnit.test("ReturnHello:", async (assert) =>

CefSharp.Test/JavascriptBinding/IntegrationTestFacts.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
using CefSharp.Event;
88
using CefSharp.Example;
99
using CefSharp.Example.JavascriptBinding;
10+
using CefSharp.Example.ModelBinding;
1011
using CefSharp.Internals;
12+
using CefSharp.ModelBinding;
1113
using CefSharp.OffScreen;
1214
using Xunit;
1315
using Xunit.Abstractions;
@@ -124,6 +126,8 @@ public async Task LoadJavaScriptBindingAsyncTaskQunitTestsSuccessfulCompletion()
124126

125127
//TODO: Extract this into some sort of helper setup method
126128
var bindingOptions = BindingOptions.DefaultBinder;
129+
// intercept .net methods calls from js and log it
130+
bindingOptions.MethodInterceptor = new MethodInterceptorLogger();
127131
var repo = browser.JavascriptObjectRepository;
128132

129133
repo.Register("boundAsync", new AsyncBoundObject(), isAsync: true, options: bindingOptions);

0 commit comments

Comments
 (0)