* Make BrowserRefCount test more reliable
* use embedded url
* wait for browsers to close before running test
---------
Co-authored-by: amaitland <307872+amaitland@users.noreply.github.com>
- After switching to the Chrome bootstrap, the browser wouldn't load if you passed in an empty
string to the constructor, we can defer loading until after another LoadUrl call is made.
Resolves#4832
- Start splitting tests out into own files where relevant
- Improve call ordering
- Use Assert.RaisesAsync where possible
- Classes have been renamed (Tests is now the standard suffix)
TODO: Some of the classes still need their method names changed
Logs some basic information so we can see what type of ChromiumWebBrowser hasn't been closed
within as part of the xUnit tests.
* Meant for internal use and might be subject to change.
- Make it clear that the ChromiumWebBrowser instance has been disposed.
Previously when the browser was disposed BrowserCore would be null.
An explicit ObjectDisposedException is now thrown.
* WPF/OffScreen - Add WaitForRenderIdleAsync
- Task resolves when render has been idle for the specified time
- Make TaskTimeoutExtensions public (they're not extension methods as this was expected)
- Previously when no Scale was specified, then the previous ChromiumWebBrowser scale was used.
- Now Viewport defaults to a scale of 1, so the behaviour has been changed so the scale passed as
the param is always used.
- Test updated
This is a minor breaking change.
Resolves#4091
* OffScreen - Fix ResizeAsync with deviceScalingFactor
* OffScreen - Fix CaptureScreenshotAsync Width / Height calculation to include X and Y
Always apply Scale changes
- Initial intention was to have a reusable method that could be used CefSharp.Wpf.HwndHost,
upon further deliberation I've decided to build the functionality into the ChromiumWebBrowser.Partial.cs
and will need to duplicate the functionality in CefSharp.Wpf.HwndHost. This guarantees that the
Task will be resolved in all cases. The previous implementation there was a theoretical change we'd
miss subscribing to the relevant events
- Remove CancellationToken as it's not possible to cancel
Issue #3842
- Use inline data
- Move test into OffScreenBrowserBasicFacts as it's not actually javascript binding
at a later point all the tests should be rearranged so they're not just all lumped into OffScreenBrowserBasicFacts
Issue #3808
Core - Add LoadUrlAsync
- Add IWebBrowser.LoadUrlAsync
- Add LoadUrlAsyncResponse
- Update unit tests to use new method
- Add static method to allow for CefSharp.Wpf.HwndHost to share the same code.
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