@@ -227,6 +227,9 @@ public async Task CanEvaluateScriptAsPromiseAsyncJavascriptBindingApiGlobalObjec
227
227
[ InlineData ( "return 42;" , true , "42" ) ]
228
228
[ InlineData ( "return new Promise(function(resolve, reject) { resolve(42); });" , true , "42" ) ]
229
229
[ InlineData ( "return new Promise(function(resolve, reject) { reject('reject test'); });" , false , "reject test" ) ]
230
+ [ InlineData ( "return await 42;" , true , "42" ) ]
231
+ [ InlineData ( "return await (function() { throw('reject test'); })();" , false , "reject test" ) ]
232
+ [ InlineData ( "var result = await fetch('./robots.txt'); return result.status;" , true , "200" ) ]
230
233
public async Task CanEvaluateScriptAsPromiseAsync ( string script , bool success , string expected )
231
234
{
232
235
using ( var browser = new ChromiumWebBrowser ( "http://www.google.com" ) )
@@ -255,6 +258,8 @@ public async Task CanEvaluateScriptAsPromiseAsync(string script, bool success, s
255
258
[ InlineData ( "return { a: 'CefSharp', b: 42, };" , true , "CefSharp" , "42" ) ]
256
259
[ InlineData ( "return new Promise(function(resolve, reject) { resolve({ a: 'CefSharp', b: 42, }); });" , true , "CefSharp" , "42" ) ]
257
260
[ InlineData ( "return new Promise(function(resolve, reject) { setTimeout(resolve.bind(null, { a: 'CefSharp', b: 42, }), 1000); });" , true , "CefSharp" , "42" ) ]
261
+ [ InlineData ( "return await { a: 'CefSharp', b: 42, };" , true , "CefSharp" , "42" ) ]
262
+ [ InlineData ( "return await new Promise(function(resolve, reject) { setTimeout(resolve.bind(null, { a: 'CefSharp', b: 42, }), 1000); }); " , true , "CefSharp" , "42" ) ]
258
263
public async Task CanEvaluateScriptAsPromiseAsyncReturnObject ( string script , bool success , string expectedA , string expectedB )
259
264
{
260
265
using ( var browser = new ChromiumWebBrowser ( "http://www.google.com" ) )
0 commit comments