mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-06 12:09:40 +00:00
Test - Fix IntegrationTestFacts.LoadJavaScriptBindingAsyncTaskQunitTestsSuccessfulCompletion
Add method interceptor so tests pass. Without it we get an VoidTaskResult object.
This commit is contained in:
@@ -31,10 +31,9 @@
|
||||
|
||||
QUnit.test("WaitBeforeReturnAsync:", async (assert) =>
|
||||
{
|
||||
const expectedResult = null;
|
||||
const actualResult = await boundAsync.waitBeforeReturnAsync(2000);
|
||||
|
||||
assert.equal(expectedResult, actualResult, "Return null");
|
||||
assert.notOk(actualResult, "Method awaited without returning response.");
|
||||
});
|
||||
|
||||
QUnit.test("ReturnHello:", async (assert) =>
|
||||
|
||||
@@ -7,7 +7,9 @@ using System.Threading.Tasks;
|
||||
using CefSharp.Event;
|
||||
using CefSharp.Example;
|
||||
using CefSharp.Example.JavascriptBinding;
|
||||
using CefSharp.Example.ModelBinding;
|
||||
using CefSharp.Internals;
|
||||
using CefSharp.ModelBinding;
|
||||
using CefSharp.OffScreen;
|
||||
using Xunit;
|
||||
using Xunit.Abstractions;
|
||||
@@ -124,6 +126,8 @@ namespace CefSharp.Test.JavascriptBinding
|
||||
|
||||
//TODO: Extract this into some sort of helper setup method
|
||||
var bindingOptions = BindingOptions.DefaultBinder;
|
||||
// intercept .net methods calls from js and log it
|
||||
bindingOptions.MethodInterceptor = new MethodInterceptorLogger();
|
||||
var repo = browser.JavascriptObjectRepository;
|
||||
|
||||
repo.Register("boundAsync", new AsyncBoundObject(), isAsync: true, options: bindingOptions);
|
||||
|
||||
Reference in New Issue
Block a user