Skip to content

Commit

Permalink
v3.0.0 (#1653)
Browse files Browse the repository at this point in the history
* v3.0.0

* Update libraries

* Fix signed test on net48
  • Loading branch information
kblok authored Mar 22, 2021
1 parent db32cda commit 984fdc0
Show file tree
Hide file tree
Showing 14 changed files with 33 additions and 51 deletions.
13 changes: 13 additions & 0 deletions lib/Common/SignAssembly.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project>
<PropertyGroup>
<AssemblyPublicKey>0024000004800000940000000602000000240000525341310004000001000100059a04ca5ca77c9b4eb2addd1afe3f8464b20ee6aefe73b8c23c0e6ca278d1a378b33382e7e18d4aa8300dd22d81f146e528d88368f73a288e5b8157da9710fe6f9fa9911fb786193f983408c5ebae0b1ba5d1d00111af2816f5db55871db03d7536f4a7a6c5152d630c1e1886b1a0fb68ba5e7f64a7f24ac372090889be2ffb</AssemblyPublicKey>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\keys\public.snk</AssemblyOriginatorKeyFile>
<PublicSign>true</PublicSign>
</PropertyGroup>
<ItemGroup>
<None Include="..\keys\public.snk">
<Link>public.snk</Link>
</None>
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<PackageProjectUrl>https://github.com/kblok/puppeteer-sharp</PackageProjectUrl>
<Summary>Puppeteer-Sharp Helpers for ASP.NET Full Framework</Summary>
</PropertyGroup>
<Import Project="../Common/SignAssembly.props" />
<ItemGroup>
<ProjectReference Include="..\PuppeteerSharp\PuppeteerSharp.csproj" />
</ItemGroup>
Expand All @@ -18,4 +19,4 @@
<ItemGroup>
<Reference Include="System.Web" />
</ItemGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<Import Project="../Common/SignAssembly.props" />
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.2.0" />
Expand Down
2 changes: 0 additions & 2 deletions lib/PuppeteerSharp.Tests/PuppeteerBaseTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ public class PuppeteerBaseTest

public PuppeteerBaseTest(ITestOutputHelper output)
{
TestConstants.SetupLogging(output);

BaseDirectory = Path.Combine(Directory.GetCurrentDirectory(), "workspace");
var dirInfo = new DirectoryInfo(BaseDirectory);

Expand Down
7 changes: 4 additions & 3 deletions lib/PuppeteerSharp.Tests/PuppeteerSharp.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@
<ItemGroup>
<PackageReference Include="Microsoft.CSharp" Version="4.5.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="MicrosoftExtensions.Logging.Xunit" Version="1.0.0" />
<PackageReference Include="Mono.Posix.NETStandard" Version="1.0.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.0-beta0005" />
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.3" />
<PackageReference Include="Microsoft.AspNetCore.Connections.Abstractions" Version="2.2.0" />
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="6.0.0-preview.2.21154.6" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net471'">
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="All" />
</ItemGroup>
<Import Project="../Common/SignAssembly.props" />
<ItemGroup>
<Folder Include="Issues\" />
<Folder Include="Attributes\" />
Expand All @@ -42,4 +43,4 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
</Project>
</Project>
13 changes: 4 additions & 9 deletions lib/PuppeteerSharp.Tests/ScreenshotHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ public static bool PixelMatch(string screenShotFile, byte[] screenshot)
const int pixelThreshold = 10;
const decimal totalTolerance = 0.05m;

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

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

var rgb1 = default(Rgb24);
var rgb2 = default(Rgb24);
var invalidPixelsCount = 0;

for (var y = 0; y < baseImage.Height; y++)
{
for (var x = 0; x < baseImage.Width; x++)
{
var pixelA = baseImage[x, y];
var pixelB = compareImage[x, y];

pixelA.ToRgb24(ref rgb1);
pixelB.ToRgb24(ref rgb2);
var rgb1 = baseImage[x, y];
var rgb2 = compareImage[x, y];

if (Math.Abs(rgb1.R - rgb2.R) > pixelThreshold ||
Math.Abs(rgb1.G - rgb2.G) > pixelThreshold ||
Expand Down
9 changes: 0 additions & 9 deletions lib/PuppeteerSharp.Tests/TestConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using System.Diagnostics;
using System.IO;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Xunit;
using PuppeteerSharp.Mobile;
using Xunit.Abstractions;

Expand Down Expand Up @@ -65,13 +64,5 @@ public static class TestConstants
$"--load-extension={ExtensionPath}"
}
};

public static void SetupLogging(ITestOutputHelper output)
{
if (Debugger.IsAttached && LoggerFactory == null)
{
LoggerFactory = new LoggerFactory(new[] { new XunitLoggerProvider(output) });
}
}
}
}
3 changes: 2 additions & 1 deletion lib/PuppeteerSharp.Tests/xunit.runner.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"diagnosticMessages": true,
"parallelizeAssembly": false,
"maxParallelThreads": -1,
"longRunningTestSeconds": 5
"longRunningTestSeconds": 5,
"shadowCopy": false
}
1 change: 1 addition & 0 deletions lib/PuppeteerSharp.sln
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
.editorconfig = .editorconfig
..\Directory.Build.props = ..\Directory.Build.props
PuppeteerSharp.ruleset = PuppeteerSharp.ruleset
Common\SignAssembly.props = Common\SignAssembly.props
EndProjectSection
EndProject
Global
Expand Down
2 changes: 1 addition & 1 deletion lib/PuppeteerSharp/NetworkManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ internal class NetworkManager
private bool _protocolRequestInterceptionEnabled;
private readonly bool _ignoreHTTPSErrors;
private bool _userCacheDisabled;
private InternalNetworkConditions _emulatedNetworkConditions = new InternalNetworkConditions
private readonly InternalNetworkConditions _emulatedNetworkConditions = new InternalNetworkConditions
{
Offline = false,
Upload = -1,
Expand Down
2 changes: 1 addition & 1 deletion lib/PuppeteerSharp/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
using System.Runtime.CompilerServices;

[assembly: InternalsVisibleTo("PuppeteerSharp.Tests")]
[assembly: InternalsVisibleTo("PuppeteerSharp.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100059a04ca5ca77c9b4eb2addd1afe3f8464b20ee6aefe73b8c23c0e6ca278d1a378b33382e7e18d4aa8300dd22d81f146e528d88368f73a288e5b8157da9710fe6f9fa9911fb786193f983408c5ebae0b1ba5d1d00111af2816f5db55871db03d7536f4a7a6c5152d630c1e1886b1a0fb68ba5e7f64a7f24ac372090889be2ffb")]
28 changes: 4 additions & 24 deletions lib/PuppeteerSharp/PuppeteerSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<PackOnBuild>true</PackOnBuild>
<PackageVersion>2.0.4</PackageVersion>
<PackageVersion>3.0.0</PackageVersion>
<Authors>Darío Kondratiuk</Authors>
<Owners>Darío Kondratiuk</Owners>
<PackageProjectUrl>https://github.com/hardkoded/puppeteer-sharp</PackageProjectUrl>
Expand All @@ -11,33 +11,13 @@
<Title>PuppeteerSharp</Title>
<Description>Headless Browser .NET API</Description>
<PackageId>PuppeteerSharp</PackageId>
<PackageReleaseNotes><![CDATA[
# Experimental
* We are laying the ground to support Firefox. Although we are exposing the "Product" property in many methods, these are not ready to be used.
# Fixes
* Optional frame in requests.
* Update the OnRequestAsync in the NetworkManager.cs to support null.
# Changelog
* Add x-server pre-requisite to docs
* Corrects CA2000 and IDE0008.
* fix CA1063.
* Don’t disable BlinkGenPropertyTrees anymore.
* Add reference Microsoft.NETFramework.ReferenceAssemblies.
* Add WaitForFunctionAsync doc.
* Update demo versions.
* Tests: Implement the Chrome bit.
]]></PackageReleaseNotes>
<ReleaseVersion>2.0.4</ReleaseVersion>
<PackageReleaseNotes></PackageReleaseNotes>
<ReleaseVersion>3.0.0</ReleaseVersion>
<SynchReleaseVersion>false</SynchReleaseVersion>
<StyleCopTreatErrorsAsWarnings>false</StyleCopTreatErrorsAsWarnings>
<CodeAnalysisRuleSet>../PuppeteerSharp.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<Import Project="../Common/SignAssembly.props" />
<PropertyGroup>
<DebugType>embedded</DebugType>
<DebugSymbols>true</DebugSymbols>
Expand Down
Binary file added lib/keys/keypair.snk
Binary file not shown.
Binary file added lib/keys/public.snk
Binary file not shown.

0 comments on commit 984fdc0

Please sign in to comment.