port AutofillParser unit tests to .net 8
This commit is contained in:
		| @@ -3,17 +3,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 | ||||
| # Visual Studio Version 17 | ||||
| VisualStudioVersion = 17.4.33205.214 | ||||
| MinimumVisualStudioVersion = 10.0.40219.1 | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
| Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Kp2aAutofillParserTest", "Kp2aAutofillParserTest\Kp2aAutofillParserTest.csproj", "{3D1560FF-86BB-4CB4-8367-80BA13B81C38}" | ||||
| EndProject | ||||
| Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ZlibAndroid", "ZlibAndroid\ZlibAndroid.csproj", "{1DF9DA08-D2FE-4227-BD53-761CD3F6CA42}" | ||||
| EndProject | ||||
| Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TwofishCipher", "TwofishCipher\TwofishCipher.csproj", "{69D491AA-3A31-4467-8216-3641A4F157BE}" | ||||
| @@ -38,6 +27,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Kp2aKeyboardBinding", "Kp2a | ||||
| EndProject | ||||
| Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PCloudBindings", "PCloudBindings\PCloudBindings.csproj", "{D5F03D6D-B233-4716-93B5-18C2D965B5EC}" | ||||
| EndProject | ||||
| Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Kp2aAutofillParser.Tests", "Kp2aAutofillParser.Tests\Kp2aAutofillParser.Tests.csproj", "{F5A2A8F9-C084-498F-9603-9D927BA5C626}" | ||||
| EndProject | ||||
| Global | ||||
| 	GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||||
| 		Debug|Any CPU = Debug|Any CPU | ||||
| @@ -54,30 +45,6 @@ Global | ||||
| 		ReleaseNoNet|x64 = ReleaseNoNet|x64 | ||||
| 	EndGlobalSection | ||||
| 	GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||||
| 		{3D1560FF-86BB-4CB4-8367-80BA13B81C38}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||||
| 		{3D1560FF-86BB-4CB4-8367-80BA13B81C38}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||||
| 		{3D1560FF-86BB-4CB4-8367-80BA13B81C38}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU | ||||
| 		{3D1560FF-86BB-4CB4-8367-80BA13B81C38}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU | ||||
| 		{3D1560FF-86BB-4CB4-8367-80BA13B81C38}.Debug|Win32.ActiveCfg = Debug|Any CPU | ||||
| 		{3D1560FF-86BB-4CB4-8367-80BA13B81C38}.Debug|Win32.Build.0 = Debug|Any CPU | ||||
| 		{3D1560FF-86BB-4CB4-8367-80BA13B81C38}.Debug|x64.ActiveCfg = Debug|Any CPU | ||||
| 		{3D1560FF-86BB-4CB4-8367-80BA13B81C38}.Debug|x64.Build.0 = Debug|Any CPU | ||||
| 		{3D1560FF-86BB-4CB4-8367-80BA13B81C38}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||||
| 		{3D1560FF-86BB-4CB4-8367-80BA13B81C38}.Release|Any CPU.Build.0 = Release|Any CPU | ||||
| 		{3D1560FF-86BB-4CB4-8367-80BA13B81C38}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU | ||||
| 		{3D1560FF-86BB-4CB4-8367-80BA13B81C38}.Release|Mixed Platforms.Build.0 = Release|Any CPU | ||||
| 		{3D1560FF-86BB-4CB4-8367-80BA13B81C38}.Release|Win32.ActiveCfg = Release|Any CPU | ||||
| 		{3D1560FF-86BB-4CB4-8367-80BA13B81C38}.Release|Win32.Build.0 = Release|Any CPU | ||||
| 		{3D1560FF-86BB-4CB4-8367-80BA13B81C38}.Release|x64.ActiveCfg = Release|Any CPU | ||||
| 		{3D1560FF-86BB-4CB4-8367-80BA13B81C38}.Release|x64.Build.0 = Release|Any CPU | ||||
| 		{3D1560FF-86BB-4CB4-8367-80BA13B81C38}.ReleaseNoNet|Any CPU.ActiveCfg = Release|Any CPU | ||||
| 		{3D1560FF-86BB-4CB4-8367-80BA13B81C38}.ReleaseNoNet|Any CPU.Build.0 = Release|Any CPU | ||||
| 		{3D1560FF-86BB-4CB4-8367-80BA13B81C38}.ReleaseNoNet|Mixed Platforms.ActiveCfg = Release|Any CPU | ||||
| 		{3D1560FF-86BB-4CB4-8367-80BA13B81C38}.ReleaseNoNet|Mixed Platforms.Build.0 = Release|Any CPU | ||||
| 		{3D1560FF-86BB-4CB4-8367-80BA13B81C38}.ReleaseNoNet|Win32.ActiveCfg = Release|Any CPU | ||||
| 		{3D1560FF-86BB-4CB4-8367-80BA13B81C38}.ReleaseNoNet|Win32.Build.0 = Release|Any CPU | ||||
| 		{3D1560FF-86BB-4CB4-8367-80BA13B81C38}.ReleaseNoNet|x64.ActiveCfg = Release|Any CPU | ||||
| 		{3D1560FF-86BB-4CB4-8367-80BA13B81C38}.ReleaseNoNet|x64.Build.0 = Release|Any CPU | ||||
| 		{1DF9DA08-D2FE-4227-BD53-761CD3F6CA42}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||||
| 		{1DF9DA08-D2FE-4227-BD53-761CD3F6CA42}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||||
| 		{1DF9DA08-D2FE-4227-BD53-761CD3F6CA42}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU | ||||
| @@ -378,6 +345,30 @@ Global | ||||
| 		{D5F03D6D-B233-4716-93B5-18C2D965B5EC}.ReleaseNoNet|Win32.Build.0 = Release|Any CPU | ||||
| 		{D5F03D6D-B233-4716-93B5-18C2D965B5EC}.ReleaseNoNet|x64.ActiveCfg = Release|Any CPU | ||||
| 		{D5F03D6D-B233-4716-93B5-18C2D965B5EC}.ReleaseNoNet|x64.Build.0 = Release|Any CPU | ||||
| 		{F5A2A8F9-C084-498F-9603-9D927BA5C626}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||||
| 		{F5A2A8F9-C084-498F-9603-9D927BA5C626}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||||
| 		{F5A2A8F9-C084-498F-9603-9D927BA5C626}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU | ||||
| 		{F5A2A8F9-C084-498F-9603-9D927BA5C626}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU | ||||
| 		{F5A2A8F9-C084-498F-9603-9D927BA5C626}.Debug|Win32.ActiveCfg = Debug|Any CPU | ||||
| 		{F5A2A8F9-C084-498F-9603-9D927BA5C626}.Debug|Win32.Build.0 = Debug|Any CPU | ||||
| 		{F5A2A8F9-C084-498F-9603-9D927BA5C626}.Debug|x64.ActiveCfg = Debug|Any CPU | ||||
| 		{F5A2A8F9-C084-498F-9603-9D927BA5C626}.Debug|x64.Build.0 = Debug|Any CPU | ||||
| 		{F5A2A8F9-C084-498F-9603-9D927BA5C626}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||||
| 		{F5A2A8F9-C084-498F-9603-9D927BA5C626}.Release|Any CPU.Build.0 = Release|Any CPU | ||||
| 		{F5A2A8F9-C084-498F-9603-9D927BA5C626}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU | ||||
| 		{F5A2A8F9-C084-498F-9603-9D927BA5C626}.Release|Mixed Platforms.Build.0 = Release|Any CPU | ||||
| 		{F5A2A8F9-C084-498F-9603-9D927BA5C626}.Release|Win32.ActiveCfg = Release|Any CPU | ||||
| 		{F5A2A8F9-C084-498F-9603-9D927BA5C626}.Release|Win32.Build.0 = Release|Any CPU | ||||
| 		{F5A2A8F9-C084-498F-9603-9D927BA5C626}.Release|x64.ActiveCfg = Release|Any CPU | ||||
| 		{F5A2A8F9-C084-498F-9603-9D927BA5C626}.Release|x64.Build.0 = Release|Any CPU | ||||
| 		{F5A2A8F9-C084-498F-9603-9D927BA5C626}.ReleaseNoNet|Any CPU.ActiveCfg = Release|Any CPU | ||||
| 		{F5A2A8F9-C084-498F-9603-9D927BA5C626}.ReleaseNoNet|Any CPU.Build.0 = Release|Any CPU | ||||
| 		{F5A2A8F9-C084-498F-9603-9D927BA5C626}.ReleaseNoNet|Mixed Platforms.ActiveCfg = Release|Any CPU | ||||
| 		{F5A2A8F9-C084-498F-9603-9D927BA5C626}.ReleaseNoNet|Mixed Platforms.Build.0 = Release|Any CPU | ||||
| 		{F5A2A8F9-C084-498F-9603-9D927BA5C626}.ReleaseNoNet|Win32.ActiveCfg = Release|Any CPU | ||||
| 		{F5A2A8F9-C084-498F-9603-9D927BA5C626}.ReleaseNoNet|Win32.Build.0 = Release|Any CPU | ||||
| 		{F5A2A8F9-C084-498F-9603-9D927BA5C626}.ReleaseNoNet|x64.ActiveCfg = Release|Any CPU | ||||
| 		{F5A2A8F9-C084-498F-9603-9D927BA5C626}.ReleaseNoNet|x64.Build.0 = Release|Any CPU | ||||
| 	EndGlobalSection | ||||
| 	GlobalSection(SolutionProperties) = preSolution | ||||
| 		HideSolutionNode = FALSE | ||||
|   | ||||
| @@ -26,65 +26,64 @@ namespace Kp2aAutofillParserTest | ||||
|         [Fact] | ||||
|         public void TestNotFocusedPasswordAutoIsNotFilled() | ||||
|         { | ||||
|             var resourceName = "Kp2aAutofillParserTest.com-servicenet-mobile-no-focus.json"; | ||||
|             var resourceName = "com-servicenet-mobile-no-focus.json"; | ||||
|             RunTestFromAutofillInput(resourceName, "com.servicenet.mobile"); | ||||
|         } | ||||
| 
 | ||||
|         [Fact] | ||||
|         public void TestCrashRegressionEmptySequence() | ||||
|         { | ||||
|             var resourceName = "Kp2aAutofillParserTest.imdb.json"; | ||||
|             var resourceName = "imdb.json"; | ||||
|             RunTestFromAutofillInput(resourceName, "com.vivaldi.browser", "m.imdb.com"); | ||||
|         } | ||||
| 
 | ||||
|         [Fact] | ||||
|         public void TestFocusedPasswordAutoIsFilled() | ||||
|         { | ||||
|             var resourceName = "Kp2aAutofillParserTest.com-servicenet-mobile-focused.json"; | ||||
|             var resourceName = "com-servicenet-mobile-focused.json"; | ||||
|             RunTestFromAutofillInput(resourceName, "com.servicenet.mobile"); | ||||
|         } | ||||
| 
 | ||||
|         [Fact] | ||||
|         public void TestMulitpleUnfocusedLoginsIsFilled() | ||||
|         { | ||||
|             var resourceName = "Kp2aAutofillParserTest.firefox-amazon-it.json"; | ||||
|             var resourceName = "firefox-amazon-it.json"; | ||||
|             RunTestFromAutofillInput(resourceName, "org.mozilla.firefox", "www.amazon.it"); | ||||
|         } | ||||
| 
 | ||||
|         [Fact] | ||||
|         public void CanDetectFieldsWithoutAutofillHints() | ||||
|         { | ||||
|             var resourceName = "Kp2aAutofillParserTest.chrome-android10-amazon-it.json"; | ||||
|             var resourceName = "chrome-android10-amazon-it.json"; | ||||
|             RunTestFromAutofillInput(resourceName, "com.android.chrome", "www.amazon.it"); | ||||
|         } | ||||
|          | ||||
|         [Fact] | ||||
|         public void DetectsUsernameFieldDespitePasswordAutoHint() | ||||
|         { | ||||
|             var resourceName = "Kp2aAutofillParserTest.com-ifs-banking-fiid3364-android13.json"; | ||||
|             var resourceName = "com-ifs-banking-fiid3364-android13.json"; | ||||
|             RunTestFromAutofillInput(resourceName, "com.ifs.banking.fiid3364", null); | ||||
|         } | ||||
| 
 | ||||
|         [Fact] | ||||
|         public void DetectsEmailAutofillHint() | ||||
|         { | ||||
|             var resourceName = "Kp2aAutofillParserTest.com-expressvpn-vpn-android13.json"; | ||||
|             var resourceName = "com-expressvpn-vpn-android13.json"; | ||||
|             RunTestFromAutofillInput(resourceName, "com.expressvpn.vpn", null); | ||||
|         } | ||||
|         [Fact] | ||||
|         public void TestIgnoresAndroidSettings() | ||||
|         { | ||||
|             var resourceName = "Kp2aAutofillParserTest.android14-settings.json"; | ||||
|             var resourceName = "android14-settings.json"; | ||||
|             RunTestFromAutofillInput(resourceName, "com.android.settings", null); | ||||
|         } | ||||
| 
 | ||||
|         private void RunTestFromAutofillInput(string resourceName, string expectedPackageName = null, string expectedWebDomain = null) | ||||
|         { | ||||
|             var assembly = Assembly.GetExecutingAssembly(); | ||||
|              | ||||
| 
 | ||||
|             string input; | ||||
|             using (Stream stream = assembly.GetManifestResourceStream(resourceName)) | ||||
|             using (Stream stream = assembly.GetManifestResourceStream(assembly.GetName().Name + "." + resourceName)) | ||||
|             using (StreamReader reader = new StreamReader(stream)) | ||||
|             { | ||||
|                 input = reader.ReadToEnd(); | ||||
| @@ -1,16 +1,18 @@ | ||||
| <Project Sdk="Microsoft.NET.Sdk"> | ||||
| 
 | ||||
|   <PropertyGroup> | ||||
|     <TargetFramework>net6.0</TargetFramework> | ||||
|     <TargetFramework>net8.0</TargetFramework> | ||||
|     <ImplicitUsings>enable</ImplicitUsings> | ||||
|     <Nullable>enable</Nullable> | ||||
| 
 | ||||
|     <IsPackable>false</IsPackable> | ||||
|     <IsTestProject>true</IsTestProject> | ||||
|   </PropertyGroup> | ||||
| 
 | ||||
|   <ItemGroup> | ||||
|     <None Remove="android14-settings.json" /> | ||||
|     <None Remove="chrome-android10-amazon-it.json" /> | ||||
|     <None Remove="citibank.json" /> | ||||
|     <None Remove="com-expressvpn-vpn-android13.json" /> | ||||
|     <None Remove="com-ifs-banking-fiid3364-android13.json" /> | ||||
|     <None Remove="com-servicenet-mobile-focused.json" /> | ||||
| @@ -20,16 +22,10 @@ | ||||
|   </ItemGroup> | ||||
| 
 | ||||
|   <ItemGroup> | ||||
|     <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" /> | ||||
|     <PackageReference Include="xunit" Version="2.4.2" /> | ||||
|     <PackageReference Include="xunit.runner.visualstudio" Version="2.4.5"> | ||||
|       <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||||
|       <PrivateAssets>all</PrivateAssets> | ||||
|     </PackageReference> | ||||
|     <PackageReference Include="coverlet.collector" Version="6.0.2"> | ||||
|       <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||||
|       <PrivateAssets>all</PrivateAssets> | ||||
|     </PackageReference> | ||||
|     <PackageReference Include="coverlet.collector" Version="6.0.0" /> | ||||
|     <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" /> | ||||
|     <PackageReference Include="xunit" Version="2.5.3" /> | ||||
|     <PackageReference Include="xunit.runner.visualstudio" Version="2.5.3" /> | ||||
|   </ItemGroup> | ||||
| 
 | ||||
|   <ItemGroup> | ||||
| @@ -37,25 +33,28 @@ | ||||
|   </ItemGroup> | ||||
| 
 | ||||
|   <ItemGroup> | ||||
|     <EmbeddedResource Include="android14-settings.json"> | ||||
|       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||||
|     </EmbeddedResource> | ||||
|     <EmbeddedResource Include="chrome-android10-amazon-it.json"> | ||||
|       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||||
|     </EmbeddedResource> | ||||
|     <EmbeddedResource Include="citibank.json"> | ||||
|       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||||
|     </EmbeddedResource> | ||||
|     <EmbeddedResource Include="com-expressvpn-vpn-android13.json"> | ||||
|       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||||
|     </EmbeddedResource> | ||||
|     <EmbeddedResource Include="com-ifs-banking-fiid3364-android13.json"> | ||||
|       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||||
|     </EmbeddedResource> | ||||
|     <EmbeddedResource Include="firefox-amazon-it.json"> | ||||
|       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||||
|     </EmbeddedResource> | ||||
|     <EmbeddedResource Include="com-servicenet-mobile-focused.json"> | ||||
|       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||||
|     </EmbeddedResource> | ||||
|     <EmbeddedResource Include="com-servicenet-mobile-no-focus.json"> | ||||
|       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||||
|     </EmbeddedResource> | ||||
|     <EmbeddedResource Include="android14-settings.json"> | ||||
|     <EmbeddedResource Include="firefox-amazon-it.json"> | ||||
|       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||||
|     </EmbeddedResource> | ||||
|     <EmbeddedResource Include="imdb.json"> | ||||
| @@ -63,4 +62,8 @@ | ||||
|     </EmbeddedResource> | ||||
|   </ItemGroup> | ||||
| 
 | ||||
|   <ItemGroup> | ||||
|     <Using Include="Xunit" /> | ||||
|   </ItemGroup> | ||||
| 
 | ||||
| </Project> | ||||
| @@ -1,7 +1,6 @@ | ||||
| <Project Sdk="Microsoft.NET.Sdk"> | ||||
|   <PropertyGroup> | ||||
|     <TargetFramework>net8.0-android</TargetFramework> | ||||
|     <SupportedOSPlatformVersion>21</SupportedOSPlatformVersion> | ||||
|     <TargetFramework>net8.0</TargetFramework> | ||||
|     <Nullable>enable</Nullable> | ||||
|     <ImplicitUsings>enable</ImplicitUsings> | ||||
|   </PropertyGroup> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Philipp Crocoll
					Philipp Crocoll