mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-04 08:03:22 +00:00
4112340e48
- 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
31 lines
766 B
C#
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();
|
|
}
|
|
}
|
|
}
|