mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-04 19:25:01 +00:00
d06d5100be
* Example - Update to QUnit 2.10
Follows ae41e10d71, which introduced a few references
to QUnit 2.10.
* Example - Simplify the BindObjectAsync unit tests
The `QUnit.test()` may take an async function and/or to return a Promise.
This uses JavaScript's native async/await capabilities to wait for that,
much the same way manual tracking via `assert.async()` would.
Using this can simplify the test structures by a lot.
`assert.rejects()` asserts that a promise throws an error.
`assert.throws()` asserts that a block directly throws an error.
I've also tried to use `assert.deepEqual()`. I suspect a copy
of this function was placed here directly, but I couldn't find
in the history why, so perhaps worth trying if the built-in
one now works.
35 lines
914 B
HTML
35 lines
914 B
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|
<html>
|
|
<head>
|
|
<title>Binding Test (Net Core)</title>
|
|
<link rel="stylesheet" href="https://code.jquery.com/qunit/qunit-2.10.0.css">
|
|
</head>
|
|
<body>
|
|
<div id="qunit"></div>
|
|
<div id="qunit-fixture"></div>
|
|
<script src="https://code.jquery.com/qunit/qunit-2.10.0.js"></script>
|
|
|
|
<!--<script type="text/javascript">
|
|
(async function() {
|
|
// <embed user provided code here>
|
|
|
|
await CefSharp.BindObjectAsync("boundAsync", "bound");
|
|
})();
|
|
|
|
(async () => {
|
|
await CefSharp.BindObjectAsync("boundAsync", "bound");
|
|
})();
|
|
</script>-->
|
|
|
|
<script src="BindingTestAsync.js"></script>
|
|
|
|
<script type="text/javascript">
|
|
QUnit.done(function (details)
|
|
{
|
|
CefSharp.PostMessage({ "Type": "QUnitExecutionComplete", "Details": details });
|
|
});
|
|
</script>
|
|
|
|
</body>
|
|
</html>
|