Skip to content

Commit 984fdc0

Browse files
authored
v3.0.0 (#1653)
* v3.0.0 * Update libraries * Fix signed test on net48
1 parent db32cda commit 984fdc0

File tree

14 files changed

+33
-51
lines changed

14 files changed

+33
-51
lines changed

lib/Common/SignAssembly.props

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<Project>
2+
<PropertyGroup>
3+
<AssemblyPublicKey>0024000004800000940000000602000000240000525341310004000001000100059a04ca5ca77c9b4eb2addd1afe3f8464b20ee6aefe73b8c23c0e6ca278d1a378b33382e7e18d4aa8300dd22d81f146e528d88368f73a288e5b8157da9710fe6f9fa9911fb786193f983408c5ebae0b1ba5d1d00111af2816f5db55871db03d7536f4a7a6c5152d630c1e1886b1a0fb68ba5e7f64a7f24ac372090889be2ffb</AssemblyPublicKey>
4+
<SignAssembly>true</SignAssembly>
5+
<AssemblyOriginatorKeyFile>..\keys\public.snk</AssemblyOriginatorKeyFile>
6+
<PublicSign>true</PublicSign>
7+
</PropertyGroup>
8+
<ItemGroup>
9+
<None Include="..\keys\public.snk">
10+
<Link>public.snk</Link>
11+
</None>
12+
</ItemGroup>
13+
</Project>

lib/PuppeteerSharp.AspNetFramework/PuppeteerSharp.AspNetFramework.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<PackageProjectUrl>https://github.com/kblok/puppeteer-sharp</PackageProjectUrl>
1010
<Summary>Puppeteer-Sharp Helpers for ASP.NET Full Framework</Summary>
1111
</PropertyGroup>
12+
<Import Project="../Common/SignAssembly.props" />
1213
<ItemGroup>
1314
<ProjectReference Include="..\PuppeteerSharp\PuppeteerSharp.csproj" />
1415
</ItemGroup>
@@ -18,4 +19,4 @@
1819
<ItemGroup>
1920
<Reference Include="System.Web" />
2021
</ItemGroup>
21-
</Project>
22+
</Project>

lib/PuppeteerSharp.TestServer/PuppeteerSharp.TestServer.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
99
</Content>
1010
</ItemGroup>
11+
<Import Project="../Common/SignAssembly.props" />
1112
<ItemGroup>
1213
<PackageReference Include="Microsoft.AspNetCore" Version="2.2.0" />
1314
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.2.0" />

lib/PuppeteerSharp.Tests/PuppeteerBaseTest.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ public class PuppeteerBaseTest
1515

1616
public PuppeteerBaseTest(ITestOutputHelper output)
1717
{
18-
TestConstants.SetupLogging(output);
19-
2018
BaseDirectory = Path.Combine(Directory.GetCurrentDirectory(), "workspace");
2119
var dirInfo = new DirectoryInfo(BaseDirectory);
2220

lib/PuppeteerSharp.Tests/PuppeteerSharp.Tests.csproj

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,17 @@
77
<ItemGroup>
88
<PackageReference Include="Microsoft.CSharp" Version="4.5.0" />
99
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
10-
<PackageReference Include="MicrosoftExtensions.Logging.Xunit" Version="1.0.0" />
1110
<PackageReference Include="Mono.Posix.NETStandard" Version="1.0.0" />
1211
<PackageReference Include="xunit" Version="2.4.1" />
1312
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
14-
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.0-beta0005" />
13+
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.3" />
1514
<PackageReference Include="Microsoft.AspNetCore.Connections.Abstractions" Version="2.2.0" />
15+
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="6.0.0-preview.2.21154.6" />
1616
</ItemGroup>
1717
<ItemGroup Condition="'$(TargetFramework)'=='net471'">
1818
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="All" />
1919
</ItemGroup>
20+
<Import Project="../Common/SignAssembly.props" />
2021
<ItemGroup>
2122
<Folder Include="Issues\" />
2223
<Folder Include="Attributes\" />
@@ -42,4 +43,4 @@
4243
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
4344
</Content>
4445
</ItemGroup>
45-
</Project>
46+
</Project>

lib/PuppeteerSharp.Tests/ScreenshotHelper.cs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ public static bool PixelMatch(string screenShotFile, byte[] screenshot)
1515
const int pixelThreshold = 10;
1616
const decimal totalTolerance = 0.05m;
1717

18-
var baseImage = Image.Load(Path.Combine(TestUtils.FindParentDirectory("Screenshots"), TestConstants.IsChrome ? "golden-chromium" : "golden-firefox", screenShotFile));
19-
var compareImage = Image.Load(screenshot);
18+
var baseImage = Image.Load<Rgb24>(Path.Combine(TestUtils.FindParentDirectory("Screenshots"), TestConstants.IsChrome ? "golden-chromium" : "golden-firefox", screenShotFile));
19+
var compareImage = Image.Load<Rgb24>(screenshot);
2020

2121
//Just for debugging purpose
2222
compareImage.Save(Path.Combine(TestUtils.FindParentDirectory("Screenshots"), TestConstants.IsChrome ? "golden-chromium" : "golden-firefox", "test.png"));
@@ -26,19 +26,14 @@ public static bool PixelMatch(string screenShotFile, byte[] screenshot)
2626
return false;
2727
}
2828

29-
var rgb1 = default(Rgb24);
30-
var rgb2 = default(Rgb24);
3129
var invalidPixelsCount = 0;
3230

3331
for (var y = 0; y < baseImage.Height; y++)
3432
{
3533
for (var x = 0; x < baseImage.Width; x++)
3634
{
37-
var pixelA = baseImage[x, y];
38-
var pixelB = compareImage[x, y];
39-
40-
pixelA.ToRgb24(ref rgb1);
41-
pixelB.ToRgb24(ref rgb2);
35+
var rgb1 = baseImage[x, y];
36+
var rgb2 = compareImage[x, y];
4237

4338
if (Math.Abs(rgb1.R - rgb2.R) > pixelThreshold ||
4439
Math.Abs(rgb1.G - rgb2.G) > pixelThreshold ||

lib/PuppeteerSharp.Tests/TestConstants.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
using System.Diagnostics;
44
using System.IO;
55
using Microsoft.Extensions.Logging;
6-
using Microsoft.Extensions.Logging.Xunit;
76
using PuppeteerSharp.Mobile;
87
using Xunit.Abstractions;
98

@@ -65,13 +64,5 @@ public static class TestConstants
6564
$"--load-extension={ExtensionPath}"
6665
}
6766
};
68-
69-
public static void SetupLogging(ITestOutputHelper output)
70-
{
71-
if (Debugger.IsAttached && LoggerFactory == null)
72-
{
73-
LoggerFactory = new LoggerFactory(new[] { new XunitLoggerProvider(output) });
74-
}
75-
}
7667
}
7768
}

lib/PuppeteerSharp.Tests/xunit.runner.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
"diagnosticMessages": true,
44
"parallelizeAssembly": false,
55
"maxParallelThreads": -1,
6-
"longRunningTestSeconds": 5
6+
"longRunningTestSeconds": 5,
7+
"shadowCopy": false
78
}

lib/PuppeteerSharp.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1818
.editorconfig = .editorconfig
1919
..\Directory.Build.props = ..\Directory.Build.props
2020
PuppeteerSharp.ruleset = PuppeteerSharp.ruleset
21+
Common\SignAssembly.props = Common\SignAssembly.props
2122
EndProjectSection
2223
EndProject
2324
Global

lib/PuppeteerSharp/NetworkManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ internal class NetworkManager
2828
private bool _protocolRequestInterceptionEnabled;
2929
private readonly bool _ignoreHTTPSErrors;
3030
private bool _userCacheDisabled;
31-
private InternalNetworkConditions _emulatedNetworkConditions = new InternalNetworkConditions
31+
private readonly InternalNetworkConditions _emulatedNetworkConditions = new InternalNetworkConditions
3232
{
3333
Offline = false,
3434
Upload = -1,

0 commit comments

Comments
 (0)