summaryrefslogtreecommitdiffstats
path: root/tests/client-side
diff options
context:
space:
mode:
authorArtur Signell <artur.signell@itmill.com>2012-04-25 06:21:30 +0000
committerArtur Signell <artur.signell@itmill.com>2012-04-25 06:21:30 +0000
commit935850bc41d42e29b75279a718312dbefc70f405 (patch)
treedf842ad18eb20b8d72d2b6b26d2f41a9f2a28c41 /tests/client-side
parenta6aaabefcc63b182287e04789c01b63baf90c243 (diff)
downloadvaadin-framework-935850bc41d42e29b75279a718312dbefc70f405.tar.gz
vaadin-framework-935850bc41d42e29b75279a718312dbefc70f405.zip
Added v-ios and v-android for mobile devices (#7911)
svn changeset:23625/svn branch:6.8
Diffstat (limited to 'tests/client-side')
-rw-r--r--tests/client-side/com/vaadin/terminal/gwt/client/TestVBrowserDetailsUserAgentParser.java39
1 files changed, 37 insertions, 2 deletions
diff --git a/tests/client-side/com/vaadin/terminal/gwt/client/TestVBrowserDetailsUserAgentParser.java b/tests/client-side/com/vaadin/terminal/gwt/client/TestVBrowserDetailsUserAgentParser.java
index f661b6cf15..98159775bd 100644
--- a/tests/client-side/com/vaadin/terminal/gwt/client/TestVBrowserDetailsUserAgentParser.java
+++ b/tests/client-side/com/vaadin/terminal/gwt/client/TestVBrowserDetailsUserAgentParser.java
@@ -2,8 +2,6 @@ package com.vaadin.terminal.gwt.client;
import junit.framework.TestCase;
-import com.vaadin.terminal.gwt.client.VBrowserDetails;
-
public class TestVBrowserDetailsUserAgentParser extends TestCase {
private static final String FIREFOX30_WINDOWS = "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.0.6) Gecko/2009011913 Firefox/3.0.6";
@@ -37,6 +35,9 @@ public class TestVBrowserDetailsUserAgentParser extends TestCase {
private static final String SAFARI3_WINDOWS = "Mozilla/5.0 (Windows; U; Windows NT 5.1; cs-CZ) AppleWebKit/525.28.3 (KHTML, like Gecko) Version/3.2.3 Safari/525.29";
private static final String SAFARI4_MAC = "Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_5_8; en-us) AppleWebKit/531.22.7 (KHTML, like Gecko) Version/4.0.5 Safari/531.22.7";
+ private static final String IPHONE_IOS_5_1 = "Mozilla/5.0 (iPhone; CPU iPhone OS 5_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9B179 Safari/7534.48.3";
+ private static final String IPAD_IOS_4_3_1 = "Mozilla/5.0 (iPad; U; CPU OS 4_3_1 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8G4 Safari/6533.18.5";
+
public void testSafari3() {
VBrowserDetails bd = new VBrowserDetails(SAFARI3_WINDOWS);
assertWebKit(bd);
@@ -57,6 +58,28 @@ public class TestVBrowserDetailsUserAgentParser extends TestCase {
assertMacOSX(bd);
}
+ public void testIPhoneIOS5() {
+ VBrowserDetails bd = new VBrowserDetails(IPHONE_IOS_5_1);
+ assertWebKit(bd);
+ assertSafari(bd);
+ assertBrowserMajorVersion(bd, 5);
+ assertBrowserMinorVersion(bd, 1);
+ assertEngineVersion(bd, 534f);
+ assertMacOSX(bd);
+ assertIOS(bd);
+ }
+
+ public void testIPadIOS4() {
+ VBrowserDetails bd = new VBrowserDetails(IPAD_IOS_4_3_1);
+ assertWebKit(bd);
+ assertSafari(bd);
+ assertBrowserMajorVersion(bd, 5);
+ assertBrowserMinorVersion(bd, 0);
+ assertEngineVersion(bd, 533f);
+ assertMacOSX(bd);
+ assertIOS(bd);
+ }
+
public void testChrome3() {
VBrowserDetails bd = new VBrowserDetails(CHROME3_MAC);
assertWebKit(bd);
@@ -352,18 +375,30 @@ public class TestVBrowserDetailsUserAgentParser extends TestCase {
assertFalse(browserDetails.isLinux());
assertFalse(browserDetails.isWindows());
assertTrue(browserDetails.isMacOSX());
+ assertFalse(browserDetails.isAndroid());
+ }
+
+ private void assertIOS(VBrowserDetails browserDetails) {
+ assertFalse(browserDetails.isLinux());
+ assertFalse(browserDetails.isWindows());
+ assertTrue(browserDetails.isMacOSX());
+ assertTrue(browserDetails.isIOS());
+ assertFalse(browserDetails.isAndroid());
}
private void assertWindows(VBrowserDetails browserDetails) {
assertFalse(browserDetails.isLinux());
assertTrue(browserDetails.isWindows());
assertFalse(browserDetails.isMacOSX());
+ assertFalse(browserDetails.isIOS());
+ assertFalse(browserDetails.isAndroid());
}
private void assertLinux(VBrowserDetails browserDetails) {
assertTrue(browserDetails.isLinux());
assertFalse(browserDetails.isWindows());
assertFalse(browserDetails.isMacOSX());
+ assertFalse(browserDetails.isIOS());
}
}