2021-01-15 13:39:34 +10:00
|
|
|
// 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.
|
|
|
|
|
|
2021-05-12 10:59:18 +10:00
|
|
|
using System;
|
|
|
|
|
using System.IO;
|
2021-01-15 13:39:34 +10:00
|
|
|
using Xunit;
|
|
|
|
|
|
|
|
|
|
namespace CefSharp.Test.Framework
|
|
|
|
|
{
|
|
|
|
|
//NOTE: All Test classes must be part of this collection as it manages the Cef Initialize/Shutdown lifecycle
|
|
|
|
|
[Collection(CefSharpFixtureCollection.Key)]
|
2023-02-15 13:45:07 +10:00
|
|
|
public class RequestContextTests
|
2021-01-15 13:39:34 +10:00
|
|
|
{
|
|
|
|
|
[Fact]
|
|
|
|
|
public void IsSameAs()
|
|
|
|
|
{
|
|
|
|
|
var ctx1 = new RequestContext();
|
|
|
|
|
var ctx2 = ctx1.UnWrap();
|
|
|
|
|
|
|
|
|
|
Assert.True(ctx1.IsSame(ctx2));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
public void IsSharingWith()
|
|
|
|
|
{
|
|
|
|
|
var ctx1 = RequestContext.Configure()
|
2021-05-12 10:59:18 +10:00
|
|
|
.WithCachePath(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "CefSharp\\Tests\\TempCache1"))
|
2021-01-15 13:39:34 +10:00
|
|
|
.Create();
|
|
|
|
|
var ctx2 = new RequestContext(ctx1);
|
|
|
|
|
|
|
|
|
|
Assert.True(ctx1.IsSharingWith(ctx2));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|