File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change 5
5
using System ;
6
6
using System . Reflection ;
7
7
using System . Threading . Tasks ;
8
+ using CefSharp . Internals ;
8
9
using CefSharp . OffScreen ;
9
- using Xunit ;
10
10
11
11
namespace CefSharp . Test
12
12
{
@@ -61,8 +61,6 @@ public static Task<LoadUrlAsyncResponse> LoadRequestAsync(this IWebBrowser brows
61
61
throw new ArgumentNullException ( "request" ) ;
62
62
}
63
63
64
- //If using .Net 4.6 then use TaskCreationOptions.RunContinuationsAsynchronously
65
- //and switch to tcs.TrySetResult below - no need for the custom extension method
66
64
var tcs = new TaskCompletionSource < LoadUrlAsyncResponse > ( TaskCreationOptions . RunContinuationsAsynchronously ) ;
67
65
68
66
EventHandler < LoadErrorEventArgs > loadErrorHandler = null ;
@@ -115,10 +113,9 @@ public static Task<LoadUrlAsyncResponse> LoadRequestAsync(this IWebBrowser brows
115
113
} ;
116
114
117
115
browser . LoadingStateChanged += loadingStateChangeHandler ;
118
-
119
116
browser . GetMainFrame ( ) . LoadRequest ( request ) ;
120
117
121
- return tcs . Task ;
118
+ return TaskTimeoutExtensions . WaitAsync ( tcs . Task , TimeSpan . FromSeconds ( 30 ) ) ;
122
119
}
123
120
124
121
public static Task < QUnitTestResult > CreateBrowserAndWaitForQUnitTestExeuctionToComplete ( this ChromiumWebBrowser browser )
You can’t perform that action at this time.
0 commit comments