18 Commits

Author SHA1 Message Date
Alex Maitland cafd378859 Test - Code Cleanup
- 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
2023-02-17 13:53:23 +10:00
Alex Maitland 3cb6bbfc66 Test - Renable RequestContext tests
- Upstream issue has reportedly been resolved

https://bitbucket.org/chromiumembedded/cef/issues/3434/cef-108-creates-web-data-and-web-data
2023-01-08 11:53:54 +10:00
Alex Maitland aca3385954 Test - Renable WinForms CanSetRequestContextViaRequestContextBuilder
- Share RequestContext settings with GlobalRequestContext
2022-12-07 08:58:40 +10:00
Alex Maitland 570ce89926 Test - Re-enable some WinForms tests
- Re-enable all but the RequestContext tests and see if appveyor builds
2022-12-06 10:05:58 +10:00
Alex Maitland 2f36099e26 Test - Skip WinForms tests
- Attempt to isolate failing test
2022-12-05 10:07:36 +10:00
Alex Maitland 787665bcfe Core - WebBrowserExtensions throw explicit ObjectDisposedException if IsDisposed
- 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.
2022-05-31 10:56:13 +10:00
Alex Maitland 4a07af26e9 Core - Rename WaitForBrowserInitialLoadAsync to WaitForInitialLoadAsync and simplify
- 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
2021-10-28 10:31:03 +10:00
Alex Maitland 91b7514a1c WinForms/WPF/OffScreen - Add WaitForBrowserInitialLoadAsync
Second attempt at WaitForBrowserInitialLoadAsync, includes optional
CancellationToken param.

Issue #3842
2021-10-27 13:58:57 +10:00
Alex Maitland 544abc68d1 Revert "WinForms/WPF/OffScreen - Add WaitForBrowserInitialLoadAsync"
Tests started failing so will revisit later.

This reverts commit 08e5140060.
2021-10-11 10:14:31 +10:00
Alex Maitland 08e5140060 WinForms/WPF/OffScreen - Add WaitForBrowserInitialLoadAsync
Change all the tests to use WaitForBrowserInitialLoadAsync instead of LoadUrlAsync
as LoadUrlAsync will require a Url as part of #3842
2021-10-10 14:41:04 +10:00
Alex Maitland 4e16f3b16d Enhancement - Add LoadUrlAsync (#3596)
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.
2021-06-04 13:29:40 +10:00
Alex Maitland 12e583d2ef Core - PublicApi remove references to CefSharp.Core.Runtime
- Add an UnWrap method to the interfaces (should be hidden from IntelliSense)
- For .Net 4.5.2 projects they're  not a decorator class which an inner instance of the CefSharp.Core.Runtime Type
- For Net Core we have a ref assembly which allows us to reference the CefSharp.Core.Runtime without issues
  We can potentially remove the ref assembly now and forgo any direct reference.
2021-01-13 16:56:57 +10:00
Alex Maitland 2a80b71161 WinForms/WPF - Fix BrowserSettings/RequestContext type checking
- When settings BrowserSettings/RequestContext properties the type checking needs to make sure the
CefSharp.Core.BrowserSettings and CefSharp.BrowserSettings objects are acceptable
- In WPF only the RequestContext was updated as there's no check for BrowserSettings property yet (probably should be)

https://github.com/cefsharp/CefSharp/issues/3343#issuecomment-757581368
2021-01-11 20:29:54 +10:00
amaitland f11785e44b Core - Fix some compiler warnings 2020-08-18 18:08:09 +10:00
amaitland 4d47b749b1 Test - Avoid displaying Form in WinForms Test
Call CreateControl instead of displaying form.

Tooltips, context menus may not be positioned/displayed correctly as there is no parent form (window). For testing
purposes that's fine for now.
2020-03-03 07:01:00 +10:00
campersau cde3f385f9 Test - Add CefSharp WPF / WinForms CanLoadGoogle Test Case (#3069)
* enable CefSharp Wpf tests

* enable CefSharp WinForms tests

* using assembly resolver to fix serialization exception when using Xunit.StaFact with default appdomain
2020-03-03 05:30:41 +10:00
Chris bef5dd37c4 Maintenance - Fixed formatting, file encoding, and copyright year (#2504)
* Applied formatting

* Fixed file encoding + Updated copyright year

* Updated License

* Fixed more file encoding

* Copyright notice now shows the year the file was created
2018-09-10 10:41:13 +10:00
amaitland 9407ba1828 Due to limitations of VC++ we must run our tests in the default appdomain, it's possible to use xunit for testing.
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.
2017-10-25 10:44:38 +10:00