diff options
author | Leif Åstrand <leif@vaadin.com> | 2012-10-10 15:10:07 +0300 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2012-10-10 15:10:07 +0300 |
commit | 235c4cb98a16d2f60aeb8c49cd0c25b81371dd22 (patch) | |
tree | b57fb3da9c8d8192c0711d297e351f1b355aad66 /client/tests | |
parent | 60342e38e0fae5af57a1500ef1517f035af0be30 (diff) | |
download | vaadin-framework-235c4cb98a16d2f60aeb8c49cd0c25b81371dd22.tar.gz vaadin-framework-235c4cb98a16d2f60aeb8c49cd0c25b81371dd22.zip |
Parse Trident versions to support IE in compatibility mode (#9887)
Change-Id: If4c12ed2ec4fca63bb68259f44904e014782792b
Diffstat (limited to 'client/tests')
-rw-r--r-- | client/tests/src/com/vaadin/client/TestVBrowserDetailsUserAgentParser.java | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/client/tests/src/com/vaadin/client/TestVBrowserDetailsUserAgentParser.java b/client/tests/src/com/vaadin/client/TestVBrowserDetailsUserAgentParser.java index 70c1b130fd..b1d60f50b5 100644 --- a/client/tests/src/com/vaadin/client/TestVBrowserDetailsUserAgentParser.java +++ b/client/tests/src/com/vaadin/client/TestVBrowserDetailsUserAgentParser.java @@ -22,7 +22,7 @@ public class TestVBrowserDetailsUserAgentParser extends TestCase { private static final String IE8_WINDOWS = "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.2)"; private static final String IE8_IN_IE7_MODE_WINDOWS = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.2)"; - private static final String IE9_BETA_IN_IE7_MODE_WINDOWS_7 = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C)"; + private static final String IE9_IN_IE7_MODE_WINDOWS_7 = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C)"; private static final String IE9_BETA_IN_IE8_MODE_WINDOWS_7 = "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C)"; private static final String IE9_BETA_WINDOWS_7 = "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)"; @@ -279,7 +279,7 @@ public class TestVBrowserDetailsUserAgentParser extends TestCase { public void testIE6() { VBrowserDetails bd = new VBrowserDetails(IE6_WINDOWS); - // assertTrident(bd); + assertEngineVersion(bd, -1); assertIE(bd); assertBrowserMajorVersion(bd, 6); assertBrowserMinorVersion(bd, 0); @@ -288,7 +288,7 @@ public class TestVBrowserDetailsUserAgentParser extends TestCase { public void testIE7() { VBrowserDetails bd = new VBrowserDetails(IE7_WINDOWS); - // assertTrident(bd); + assertEngineVersion(bd, -1); assertIE(bd); assertBrowserMajorVersion(bd, 7); assertBrowserMinorVersion(bd, 0); @@ -297,7 +297,7 @@ public class TestVBrowserDetailsUserAgentParser extends TestCase { public void testIE8() { VBrowserDetails bd = new VBrowserDetails(IE8_WINDOWS); - // assertTrident(bd); + assertEngineVersion(bd, 4); assertIE(bd); assertBrowserMajorVersion(bd, 8); assertBrowserMinorVersion(bd, 0); @@ -308,7 +308,7 @@ public class TestVBrowserDetailsUserAgentParser extends TestCase { VBrowserDetails bd = new VBrowserDetails(IE8_IN_IE7_MODE_WINDOWS); bd.setIEMode(7); - // assertTrident(bd); + assertEngineVersion(bd, 4); assertIE(bd); assertBrowserMajorVersion(bd, 7); assertBrowserMinorVersion(bd, 0); @@ -318,7 +318,7 @@ public class TestVBrowserDetailsUserAgentParser extends TestCase { public void testIE9() { VBrowserDetails bd = new VBrowserDetails(IE9_BETA_WINDOWS_7); - // assertTrident(bd); + assertEngineVersion(bd, 5); assertIE(bd); assertBrowserMajorVersion(bd, 9); assertBrowserMinorVersion(bd, 0); @@ -326,10 +326,10 @@ public class TestVBrowserDetailsUserAgentParser extends TestCase { } public void testIE9InIE7CompatibilityMode() { - VBrowserDetails bd = new VBrowserDetails(IE9_BETA_IN_IE7_MODE_WINDOWS_7); + VBrowserDetails bd = new VBrowserDetails(IE9_IN_IE7_MODE_WINDOWS_7); // bd.setIE8InCompatibilityMode(); - // assertTrident(bd); + assertEngineVersion(bd, 5); assertIE(bd); assertBrowserMajorVersion(bd, 7); assertBrowserMinorVersion(bd, 0); @@ -341,7 +341,11 @@ public class TestVBrowserDetailsUserAgentParser extends TestCase { VBrowserDetails bd = new VBrowserDetails(IE9_BETA_IN_IE8_MODE_WINDOWS_7); // bd.setIE8InCompatibilityMode(); - // assertTrident(bd); + /* + * Trident/4.0 in example user agent string based on beta even though it + * should be Trident/5.0 in real (non-beta) user agent strings + */ + assertEngineVersion(bd, 4); assertIE(bd); assertBrowserMajorVersion(bd, 8); assertBrowserMinorVersion(bd, 0); |