Core - Simplify Setting of Proxy for new RequestContext
- Throw exception if requestContext.CanSetPreference returns false.
Proxy likely set via command line args.
- Add IRequestContext.SetPreferenceAsync
- Test - Add SelfHosted Proxy
Use Titanium.Web.Proxy to self host a proxy for testing proxy settings
Only run Proxy Tests when run locally
- Add RequestContext Builder Fluent API
- Add useImmediatelyInvokedFuncExpression param to EvaluateScriptAsync which wraps the script in an IIFE
with the cefSharpInternalCallbackId variable defined in scope to allow for deferred completion
- Wrap script in Immediately Invoked Function Expression and call promise.resolve to guarantee a promise.
- Return 'CefSharpDefEvalScriptRes' as the result of the js function to defer execution of the callback
- Call newly added cefSharp.sendEvalScriptResponse method in javascript when promise has been resolved/rejected
This is built up of a few parts and can technically be used by the new user to defer the response until they are ready.
Just return `'CefSharpDefEvalScriptRes'` and manually call cefSharp.sendEvalScriptResponse using the cefSharpInternalCallbackId
variable which is injected into the script execution (wrapped in an IIFE to limit scope)
It's possible that BrowserRefCounter.Instance.Count is 0 after
we Dispose, so we'll update our test to make sure we have at most
one instance, and it's fine we if have 0
- Add BrowserRefCounter to increment/decrement CefBrowser instance creation
- Add Cef.WaitForBrowsersToClose to dispose of all browser instances and call WaitForBrowsersToClose
Before calling CefShutdown it's important that CEF has finished closing/disposing of all the CefBrowser instances.
If you call CefShutdown before this has finished then you can get the error
"Check failed: !IsCefShutdown(). Object reference incorrectly held at CefShutdown".
This is more a problem when using MultiThreadedMessageLoop where CEF close/dispose happens on a different thread.
Calling ChromiumWebBrowser.Dispose will start to free the resources, CEF internally executes code on it's own thread.
#3047
* Core - Add IURLRequest #1721
Add IURLRequest, IURLRequestClient, and GetURLRequest to IFrame
* Rename URL classes to Url, add xmldoc and licenses
* Add UrlRequestClient to CefSharp.Example, more minor cleanup
* Getters
* Rebase tweaks
* Fix filenames, remove unused
* Use UnmanagedMemoryStream instead of byte array for IUrlRequestClient.OnDownloadData
* Applied formatting
* Fixed file encoding + Updated copyright year
* Updated License
* Fixed more file encoding
* Copyright notice now shows the year the file was created
Readd CefSharp.Test.csproj to solution
Add some very basic unit tests using xunit, DisableTestParallelization, Set xunit.appDomain to denied in app.config to disable using appdomains (https://xunit.github.io/docs/configuring-with-xml.html)
Add xunit vs test running packages, using 2.2.0 version as 2.3.0 was throwing an exception similar to https://github.com/xunit/xunit/issues/1514
TODO: Take a look at https://github.com/NuGet/NuGetGallery/tree/master/tests/NuGetGallery.Facts for some ideas on structuring xunit tests (look at implementing Theory)
NOTE: I am not providing this as a definitive set of tests, it's simply here to get someone else started in creating tests as it appears people have trouble dealing with AppDomain problem
Only includes Tests for the OffScreen version at this stage.