Skip to content

Commit eec7292

Browse files
authored
add ChromeOS (#61)
* add ChromeOS * add chrome os
1 parent 642abba commit eec7292

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

src/MyCSharp.HttpUserAgentParser/HttpUserAgentPlatformType.cs

+5-1
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,9 @@ public enum HttpUserAgentPlatformType : byte
4646
/// <summary>
4747
/// Symbian
4848
/// </summary>
49-
Symbian
49+
Symbian,
50+
/// <summary>
51+
/// ChromeOS
52+
/// </summary>
53+
ChromeOS
5054
}

src/MyCSharp.HttpUserAgentParser/HttpUserAgentStatics.cs

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ public static class HttpUserAgentStatics
4747
new(CreateDefaultPlatformRegex("iphone"), "iOS", HttpUserAgentPlatformType.IOS),
4848
new(CreateDefaultPlatformRegex("ipad"), "iOS", HttpUserAgentPlatformType.IOS),
4949
new(CreateDefaultPlatformRegex("ipod"), "iOS", HttpUserAgentPlatformType.IOS),
50+
new(CreateDefaultPlatformRegex("cros"), "ChromeOS", HttpUserAgentPlatformType.ChromeOS),
5051
new(CreateDefaultPlatformRegex("os x"), "Mac OS X", HttpUserAgentPlatformType.MacOS),
5152
new(CreateDefaultPlatformRegex("ppc mac"), "Power PC Mac", HttpUserAgentPlatformType.MacOS),
5253
new(CreateDefaultPlatformRegex("freebsd"), "FreeBSD", HttpUserAgentPlatformType.Linux),

tests/MyCSharp.HttpUserAgentParser.UnitTests/HttpUserAgentParserTests.cs

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ public class HttpUserAgentParserTests
3131
[InlineData("Mozilla/5.0 (Linux; Android 10) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.210 Mobile Safari/537.36", "Chrome", "90.0.4430.210", "Android", HttpUserAgentPlatformType.Android, "Android")]
3232
[InlineData("Mozilla/5.0 (Linux; Android 10; SM-A205U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.210 Mobile Safari/537.36", "Chrome", "90.0.4430.210", "Android", HttpUserAgentPlatformType.Android, "Android")]
3333
[InlineData("Mozilla/5.0 (Linux; Android 10; LM-Q720) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.210 Mobile Safari/537.36", "Chrome", "90.0.4430.210", "Android", HttpUserAgentPlatformType.Android, "Android")]
34+
[InlineData("Mozilla/5.0 (X11; CrOS x86_64 15917.71.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.6533.132 Safari/537.36", "Chrome", "127.0.6533.132", "ChromeOS", HttpUserAgentPlatformType.ChromeOS, null)]
3435
// Safari
3536
[InlineData("Mozilla/5.0 (Windows; U; Windows NT 10.0; en-US) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/11.0 Safari/605.1.15", "Safari", "11.0", "Windows 10", HttpUserAgentPlatformType.Windows, null)]
3637
[InlineData("Mozilla/5.0 (Macintosh; Intel Mac OS X 11_3_1) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1 Safari/605.1.15", "Safari", "14.1", "Mac OS X", HttpUserAgentPlatformType.MacOS, null)]

0 commit comments

Comments
 (0)