public async Task TestObjectDescriptorCache() { using (var browser = new Util.Browser()) { browser.Repository.AddBinding("cachetest3", new object()); int count = 0; browser.CefClient.ProcessMessageReceived += (sender, args) => { if (args.Message.Name == Messages.RpcResponseMessage) { count++; } }; await browser.LoadAsync(url); await browser.RunTest("testObjectDescriptorCache"); await browser.Reload(); await browser.RunTest("testObjectDescriptorCache"); Assert.Equal(1, count); } }
public async Task RequireReturnsPromise() { using (var browser = new Util.Browser()) { await browser.LoadAsync(url); await browser.RunTest("requireReturnsPromise"); } }
public async Task MissingDynamicObjectFails() { using (var browser = new Util.Browser()) { await browser.LoadAsync(url); await browser.RunTest("testBoundObjectNotExists"); } }
public async Task BindingInterfacePresent() { using (var browser = new Util.Browser()) { await browser.LoadAsync(url); await browser.RunTest("testBindingObjectExists"); } }
public async Task BoundFunctionReturnsPromise() { using (var browser = new Util.Browser()) { browser.Repository.AddBinding("test", new TestClass1()); await browser.LoadAsync(url); await browser.RunTest("testBoundObjectFunctionReturnsPromise"); } }
public async Task ObjectBoundWithFunction() { using (var browser = new Util.Browser()) { browser.Repository.AddBinding("test", new TestClass1()); await browser.LoadAsync(url); await browser.RunTest("testBoundObjectFunctionPresent"); } }
public async Task ObjectBound() { using (var browser = new Util.Browser()) { browser.Repository.AddBinding("test", new object()); await browser.LoadAsync(url); await browser.RunTest("testObjectBound"); } }
public async Task TestPromiseCallback() { using (var browser = new Util.Browser()) { browser.Repository.AddBinding("test", new TestClass()); await browser.LoadAsync(url); await browser.RunTest("testCallbackWithPromise"); } }
public async Task NullableInputConverted() { using (var browser = new Util.Browser()) { browser.Repository.AddBinding("test", new TestClass()); await browser.LoadAsync(url); await browser.RunTest("testNullableInput"); } }
public async Task LoopedV8ObjectGraphNotCausesStackOverflow() { using (var browser = new Util.Browser()) { browser.Repository.AddBinding("test", new TestClass()); await browser.LoadAsync(url); await browser.RunTest("testLoopPocoInput"); } }
public async Task SimpleStringParameterAndResultWorks() { using (var browser = new Util.Browser()) { browser.Repository.AddBinding("test", new TestClass1()); await browser.LoadAsync(url); await browser.RunTest("testSimpleStringConcatFunction"); } }
public async Task TestV8CacheInterFrame() { using (var browser = new Util.Browser()) { browser.Repository.AddBinding("cachetest2", new object()); await browser.LoadAsync(url); await browser.RunTest("testBoundObjectNotCacheInterFrame"); } }
public async Task UInt16ResultConverted() { using (var browser = new Util.Browser()) { browser.Repository.AddBinding("test", new TestClass()); await browser.LoadAsync(url); await browser.RunTest("testUInt16Result"); } }
public async Task CallbackValueBound() { using (var browser = new Util.Browser()) { var obj = new TestClass(); browser.Repository.AddBinding("bindingTest2", obj); await browser.LoadAsync(url); await browser.RunTest("callbackValueBound"); } }
public async Task TestCallbackBoundToJSObject() { using (var browser = new Util.Browser()) { var obj = new TestClass(); browser.Repository.AddBinding("test", obj); await browser.LoadAsync(url); await browser.RunTest("testCallbackBound"); } }
public async Task ReturnValuePropertiesExtracted() { using (var browser = new Util.Browser()) { var obj = new TestClass(); browser.Repository.AddBinding("bindingTest3", obj); await browser.LoadAsync(url); await browser.RunTest("returnValuePropertiesExtracted"); } }
public async Task TestCallbackDispose() { using (var browser = new Util.Browser()) { var obj = new TestClass(); browser.Repository.AddBinding("test", obj); await browser.LoadAsync(url); await browser.RunTest("testCallbackDispose"); await Assert.ThrowsAsync <Exception>(() => new Callback <CefValue>(obj.Id, browser.BindingHost.CallbackExecutor, contet => { }).ExecuteAsync()); } }
public async Task TestPopupCache() { using (var browser = new Util.Browser()) { var popupBrowserTask = new TaskCompletionSource <Util.Browser>(); browser.NewBrowser += b => { popupBrowserTask.TrySetResult(b); b.Repository.AddBinding("cachetest4", new TestObject(2)); }; browser.Repository.AddBinding("cachetest4", new TestObject(1)); await browser.LoadAsync(url); await browser.RunTest("testCachePerBrowser"); } }