diff --git a/CefSharp.Example/CefExample.cs b/CefSharp.Example/CefExample.cs index ff44a7589b..cb57915e4d 100644 --- a/CefSharp.Example/CefExample.cs +++ b/CefSharp.Example/CefExample.cs @@ -19,6 +19,7 @@ public static class CefExample public const string BaseUrl = "custom://cefsharp"; public const string DefaultUrl = BaseUrl + "/home.html"; public const string BindingTestUrl = BaseUrl + "/BindingTest.html"; + public const string BindingTestSingleUrl = BaseUrl + "/BindingTestSingle.html"; public const string LegacyBindingTestUrl = BaseUrl + "/LegacyBindingTest.html"; public const string PluginsTestUrl = BaseUrl + "/plugins.html"; public const string PopupTestUrl = BaseUrl + "/PopupTest.html"; diff --git a/CefSharp.Example/CefSharp.Example.csproj b/CefSharp.Example/CefSharp.Example.csproj index 8718ccabbb..c1058764b0 100644 --- a/CefSharp.Example/CefSharp.Example.csproj +++ b/CefSharp.Example/CefSharp.Example.csproj @@ -143,6 +143,7 @@ + diff --git a/CefSharp.Example/CefSharpSchemeHandlerFactory.cs b/CefSharp.Example/CefSharpSchemeHandlerFactory.cs index 185d80e6e4..0c790a1a00 100644 --- a/CefSharp.Example/CefSharpSchemeHandlerFactory.cs +++ b/CefSharp.Example/CefSharpSchemeHandlerFactory.cs @@ -37,6 +37,7 @@ static CefSharpSchemeHandlerFactory() { "/bootstrap/bootstrap.min.js", Resources.bootstrap_min_js }, { "/BindingTest.html", Resources.BindingTest }, + { "/BindingTestSingle.html", Resources.BindingTestSingle }, { "/LegacyBindingTest.html", Resources.LegacyBindingTest }, { "/ExceptionTest.html", Resources.ExceptionTest }, { "/PopupTest.html", Resources.PopupTest }, diff --git a/CefSharp.Example/Properties/Resources.Designer.cs b/CefSharp.Example/Properties/Resources.Designer.cs index b17bbc467f..ac55597d2d 100644 --- a/CefSharp.Example/Properties/Resources.Designer.cs +++ b/CefSharp.Example/Properties/Resources.Designer.cs @@ -19,7 +19,7 @@ namespace CefSharp.Example.Properties { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] public class Resources { @@ -306,6 +306,30 @@ public static string BindingTest { } } + /// + /// Looks up a localized string similar to <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> + ///<html> + /// <head> + /// <title>Binding Test</title> + /// <link rel="stylesheet" href="https://code.jquery.com/qunit/qunit-2.4.1.css"> + /// </head> + /// <body> + /// <div id="qunit"></div> + /// <div id="qunit-fixture"></div> + /// <script src="https://code.jquery.com/qunit/qunit-2.4.1.js"></script> + /// + /// <!--<script type="text/javascript"> + /// (async function() { + /// // <embed user provided code here> + /// + /// [rest of string was truncated]";. + /// + public static string BindingTestSingle { + get { + return ResourceManager.GetString("BindingTestSingle", resourceCulture); + } + } + /// /// Looks up a localized string similar to /*! /// * Bootstrap v3.0.0 diff --git a/CefSharp.Example/Properties/Resources.resx b/CefSharp.Example/Properties/Resources.resx index 4f9cf8acb1..cafb6a880f 100644 --- a/CefSharp.Example/Properties/Resources.resx +++ b/CefSharp.Example/Properties/Resources.resx @@ -208,4 +208,7 @@ ..\Resources\LegacyBindingTest.html;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + + ..\Resources\BindingTestSingle.html;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + \ No newline at end of file diff --git a/CefSharp.Example/Resources/BindingTest.html b/CefSharp.Example/Resources/BindingTest.html index bdde875dd3..8836c90810 100644 --- a/CefSharp.Example/Resources/BindingTest.html +++ b/CefSharp.Example/Resources/BindingTest.html @@ -227,13 +227,28 @@ }); }); - QUnit.test("Async call (Object):", function( assert ) + QUnit.test("Async call (Struct):", function( assert ) { var asyncCallback = assert.async(); - boundAsync.returnObject('CefSharp').then(function (res) + boundAsync.returnObject('CefSharp Struct Test').then(function (res) { - assert.equal(res.Value, "CefSharp", "JSON Object with a single field"); + assert.equal(res.Value, "CefSharp Struct Test", "Struct with a single field"); + + asyncCallback(); + }); + }); + + QUnit.test("Async call (Class):", function (assert) + { + var asyncCallback = assert.async(); + + //Returns a class + boundAsync.returnClass('CefSharp Class Test').then(function (res) + { + const expectedResult = 'CefSharp Class Test'; + + assert.equal(expectedResult, res.Value, "Class with a single field " + expectedResult); asyncCallback(); }); diff --git a/CefSharp.Example/Resources/BindingTestSingle.html b/CefSharp.Example/Resources/BindingTestSingle.html new file mode 100644 index 0000000000..3b10788776 --- /dev/null +++ b/CefSharp.Example/Resources/BindingTestSingle.html @@ -0,0 +1,52 @@ + + + + Binding Test + + + +
+
+ + + + + +