diff options
author | Flamenco <Flamenco@users.noreply.github.com> | 2017-07-27 06:24:43 -0400 |
---|---|---|
committer | Henri Sara <henri.sara@gmail.com> | 2017-07-27 13:24:43 +0300 |
commit | 410965ddca3e601343f8b759e1a27a2c1b0d0f29 (patch) | |
tree | 248f9da31766b7d5a3ed538331bcc1f431810832 /client/src/test | |
parent | b4243fe81aefd2f7f61d0a5bc644424616f2312c (diff) | |
download | vaadin-framework-410965ddca3e601343f8b759e1a27a2c1b0d0f29.tar.gz vaadin-framework-410965ddca3e601343f8b759e1a27a2c1b0d0f29.zip |
Add support for detecting ChromeOS operating system (#9698)
Diffstat (limited to 'client/src/test')
-rw-r--r-- | client/src/test/java/com/vaadin/client/VBrowserDetailsUserAgentParserTest.java | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/client/src/test/java/com/vaadin/client/VBrowserDetailsUserAgentParserTest.java b/client/src/test/java/com/vaadin/client/VBrowserDetailsUserAgentParserTest.java index bc4b7d1524..2594b3d09d 100644 --- a/client/src/test/java/com/vaadin/client/VBrowserDetailsUserAgentParserTest.java +++ b/client/src/test/java/com/vaadin/client/VBrowserDetailsUserAgentParserTest.java @@ -57,6 +57,8 @@ public class VBrowserDetailsUserAgentParserTest { private static final String PHANTOMJS_211_MAC = "Mozilla/5.0 (Macintosh; Intel Mac OS X) AppleWebKit/538.1 (KHTML, like Gecko) PhantomJS/2.1.1 Safari/538.1"; private static final String CHROME_57_ON_IOS_10_3_1 = "Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) CriOS/57.0.2987.137 Mobile/14E304 Safari/602.1"; + private static final String CHROME_40_ON_CHROMEOS = "Mozilla/5.0 (X11; CrOS x86_64 6457.31.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.38 Safari/537.36"; + @Test public void testSafari3() { VBrowserDetails bd = new VBrowserDetails(SAFARI3_WINDOWS); @@ -206,6 +208,17 @@ public class VBrowserDetailsUserAgentParserTest { } @Test + public void testChromeChromeOS() { + VBrowserDetails bd = new VBrowserDetails(CHROME_40_ON_CHROMEOS); + assertWebKit(bd); + assertChrome(bd); + assertBrowserMajorVersion(bd, 40); + assertBrowserMinorVersion(bd, 0); + assertEngineVersion(bd, 537f); + assertChromeOS(bd); + } + + @Test public void testChromeIOS() { VBrowserDetails bd = new VBrowserDetails(CHROME_57_ON_IOS_10_3_1); assertWebKit(bd); @@ -570,6 +583,7 @@ public class VBrowserDetailsUserAgentParserTest { assertFalse(browserDetails.isWindows()); assertTrue(browserDetails.isMacOSX()); assertFalse(browserDetails.isAndroid()); + assertFalse(browserDetails.isChromeOS()); } private void assertAndroid(VBrowserDetails browserDetails, int majorVersion, @@ -579,6 +593,7 @@ public class VBrowserDetailsUserAgentParserTest { assertFalse(browserDetails.isMacOSX()); assertFalse(browserDetails.isIOS()); assertTrue(browserDetails.isAndroid()); + assertFalse(browserDetails.isChromeOS()); assertOSMajorVersion(browserDetails, majorVersion); assertOSMinorVersion(browserDetails, minorVersion); @@ -591,6 +606,7 @@ public class VBrowserDetailsUserAgentParserTest { assertFalse(browserDetails.isMacOSX()); assertTrue(browserDetails.isIOS()); assertFalse(browserDetails.isAndroid()); + assertFalse(browserDetails.isChromeOS()); assertOSMajorVersion(browserDetails, majorVersion); assertOSMinorVersion(browserDetails, minorVersion); @@ -617,6 +633,7 @@ public class VBrowserDetailsUserAgentParserTest { assertFalse(browserDetails.isMacOSX()); assertFalse(browserDetails.isIOS()); assertFalse(browserDetails.isAndroid()); + assertFalse(browserDetails.isChromeOS()); Assert.assertEquals(isWindowsPhone, browserDetails.isWindowsPhone()); } @@ -626,6 +643,16 @@ public class VBrowserDetailsUserAgentParserTest { assertFalse(browserDetails.isMacOSX()); assertFalse(browserDetails.isIOS()); assertFalse(browserDetails.isAndroid()); + assertFalse(browserDetails.isChromeOS()); + } + + private void assertChromeOS(VBrowserDetails browserDetails) { + assertFalse(browserDetails.isLinux()); + assertFalse(browserDetails.isWindows()); + assertFalse(browserDetails.isMacOSX()); + assertFalse(browserDetails.isIOS()); + assertFalse(browserDetails.isAndroid()); + assertTrue(browserDetails.isChromeOS()); } } |