Files
cefsharp/CefSharp.Test/ChromiumWebBrowserOffScreenFixture.cs
T
Alex Maitland 4112340e48 Core - LoadUrlAsync require url and remove SyncContext param
- Remove url optional null, a Url is now required and an exception will be
  thrown if null or empty. If the browser wasn't loading an null was passed
  in then the task would have never resolved. This provides a predictable behaviour.
  A new WaitForInitialLoadAsync method was added to simplify waiting for initial
  browser load.
- Remove SynchronizationContext param, best to let the framework handle

Issue #3842
2021-10-28 10:51:18 +10:00

31 lines
766 B
C#

// Copyright © 2021 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
using System.Threading.Tasks;
using CefSharp.Example;
using CefSharp.OffScreen;
using Xunit;
namespace CefSharp.Test
{
public class ChromiumWebBrowserOffScreenFixture : IAsyncLifetime
{
public ChromiumWebBrowser Browser { get; private set; }
Task IAsyncLifetime.DisposeAsync()
{
Browser?.Dispose();
return Task.CompletedTask;
}
Task IAsyncLifetime.InitializeAsync()
{
Browser = new ChromiumWebBrowser(CefExample.HelloWorldUrl);
return Browser.WaitForInitialLoadAsync();
}
}
}