Merge "Selenium: replace UserLoginPage with BlankPage where possible"
[lhc/web/wiklou.git] / tests / qunit / suites / resources / startup.test.js
1 /* global isCompatible: true */
2 ( function () {
3 var featureTestable, blacklisted;
4
5 // Browsers that pass or fail the feature test and get bucketed
6 // correctly as Grade A and Grade C. This is tested here to make
7 // sure they don't get caught in any bad UX-snif regexes
8 featureTestable = [
9 /* Grade A */
10
11 // Chrome
12 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.205 Safari/534.16',
13 // Firefox 4+
14 'Mozilla/5.0 (Windows NT 6.1.1; rv:5.0) Gecko/20100101 Firefox/5.0',
15 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:9.0) Gecko/20100101 Firefox/9.0',
16 'Mozilla/5.0 (Macintosh; I; Intel Mac OS X 11_7_9; de-LI; rv:1.9b4) Gecko/2012010317 Firefox/10.0a4',
17 'Mozilla/5.0 (X11; Linux i686; rv:10.0) Gecko/20100101 Firefox/10.0',
18 'Mozilla/5.0 (Windows NT 6.1; rv:12.0) Gecko/20120403211507 Firefox/12.0',
19 'Mozilla/5.0 (Windows NT 6.2; Win64; x64; rv:16.0.1) Gecko/20121011 Firefox/16.0.1',
20 // Kindle Fire
21 'Mozilla/5.0 (Linux; U; Android 2.3.4; en-us; Kindle Fire Build/GINGERBREAD) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Safari/533.1',
22 // Safari 5.0+
23 'Mozilla/5.0 (Macintosh; I; Intel Mac OS X 10_6_7; ru-ru) AppleWebKit/534.31+ (KHTML, like Gecko) Version/5.0.5 Safari/533.21.1',
24 // Opera 15+ (Chromium-based)
25 'Mozilla/5.0 (Windows NT 6.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36 OPR/15.0.1147.153',
26 'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.57 Safari/537.36 OPR/16.0.1196.62',
27 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36 OPR/23.0.1522.75',
28 // Internet Explorer 11
29 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko',
30 // Edge
31 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.246',
32 // Edge Mobile
33 'Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; Microsoft; Lumia 640 XL LTE) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Mobile Safari/537.36 Edge/12.10166',
34 // BlackBerry 6+
35 'Mozilla/5.0 (BlackBerry; U; BlackBerry 9300; en) AppleWebKit/534.8+ (KHTML, like Gecko) Version/6.0.0.570 Mobile Safari/534.8+',
36 'Mozilla/5.0 (BlackBerry; U; BlackBerry 9900; en) AppleWebKit/534.11+ (KHTML, like Gecko) Version/7.1.0.346 Mobile Safari/534.11+',
37 'Mozilla/5.0 (BB10; Touch) AppleWebKit/537.3+ (KHTML, like Gecko) Version/10.0.9.386 Mobile Safari/537.3+',
38 // Open WebOS 1.4+ (HP Veer 4G)
39 'Mozilla/5.0 (webOS/2.1.2; U; en-US) AppleWebKit/532.2 (KHTML, like Gecko) Version/1.0 Safari/532.2 P160UNA/1.0',
40 // Firefox Mobile
41 'Mozilla/5.0 (Mobile; rv:14.0) Gecko/14.0 Firefox/14.0',
42 // iOS
43 'Mozilla/5.0 (ipod: U;CPU iPhone OS 2_2 like Mac OS X: es_es) AppleWebKit/525.18.1 (KHTML, like Gecko) Version/3.0 Mobile/3B48b Safari/419.3',
44 'Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/3B48b Safari/419.3',
45 // Android
46 'Mozilla/5.0 (Linux; U; Android 2.1; en-us; Nexus One Build/ERD62) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17',
47 // UC Mini (speed mode off)
48 'Mozilla/5.0 (Linux; U; Android 6.0.1; en-US; Nexus_5 Build/MMB29S) AppleWebKit/528.5+ (KHTML, like Gecko) Version/3.1.2 Mobile Safari/525.20.1 UCBrowser/10.7.6.805 Mobile',
49
50 /* Grade C */
51
52 // Internet Explorer < 10
53 'Mozilla/2.0 (compatible; MSIE 3.03; Windows 3.1)',
54 'Mozilla/4.0 (compatible; MSIE 4.01; Windows 95)',
55 'Mozilla/4.0 (compatible; MSIE 5.0; Windows 98;)',
56 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)',
57 'Mozilla/5.0 (compatible; MSIE 6.0; Windows NT 5.1)',
58 'Mozilla/5.0 (compatible; MSIE 7.0; Windows NT 6.0; en-US)',
59 'Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 5.2; Trident/4.0; Media Center PC 4.0; SLCC1; .NET CLR 3.0.04320)',
60 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 7.1; Trident/5.0)',
61 // Firefox < 4
62 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.2) Gecko/20060308 Firefox/1.5.0.2',
63 'Mozilla/5.0 (X11; U; Linux i686; nl; rv:1.8.1.1) Gecko/20070311 Firefox/2.0.0.1',
64 'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3',
65 // Opera < 15 (Presto-based)
66 'Mozilla/5.0 (Windows NT 5.0; U) Opera 7.54 [en]',
67 'Opera/7.54 (Windows NT 5.0; U) [en]',
68 'Mozilla/5.0 (Windows NT 5.1; U; en) Opera 8.0',
69 'Opera/8.0 (X11; Linux i686; U; cs)',
70 'Opera/9.00 (X11; Linux i686; U; de)',
71 'Opera/9.62 (X11; Linux i686; U; en) Presto/2.1.1',
72 'Opera/9.80 (Windows NT 6.1; U; en) Presto/2.2.15 Version/10.00',
73 'Opera/9.80 (Windows NT 6.1; U; ru) Presto/2.8.131 Version/11.10',
74 'Opera/9.80 (Windows NT 6.1; WOW64; U; pt) Presto/2.10.229 Version/11.62',
75 'Opera/9.80 (Windows NT 6.1; U; es-ES) Presto/2.9.181 Version/12.00',
76 'Opera/9.80 (Windows NT 5.1) Presto/2.12.388 Version/12.17',
77 // BlackBerry < 6
78 'BlackBerry9300/5.0.0.716 Profile/MIDP-2.1 Configuration/CLDC-1.1 VendorID/133',
79 'BlackBerry7250/4.0.0 Profile/MIDP-2.0 Configuration/CLDC-1.1',
80
81 /* Grade X */
82
83 // Gecko
84 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.7) Gecko/20060928 (Debian|Debian-1.8.0.7-1) Epiphany/2.14',
85 'Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.6) Gecko/20070817 IceWeasel/2.0.0.6-g2',
86 // KHTML
87 'Mozilla/5.0 (compatible; Konqueror/3.5; Linux) KHTML/3.5.4 (like Gecko)',
88 'Mozilla/5.0 (compatible; Konqueror/4.3; Linux) KHTML/4.3.5 (like Gecko)',
89 // Text browsers
90 'Links (2.1pre33; Darwin 8.11.0 Power Macintosh; x)',
91 'Links (6.9; Unix 6.9-astral sparc; 80x25)',
92 'Lynx/2.8.6rel.4 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.8g',
93 'w3m/0.5.1',
94 // Bots
95 'Googlebot/2.1 (+http://www.google.com/bot.html)',
96 'Mozilla/5.0 (compatible; googlebot/2.1; +http://www.google.com/bot.html)',
97 'Mozilla/5.0 (compatible; YandexBot/3.0)',
98 // Scripts
99 'curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5',
100 'Wget/1.9',
101 'Wget/1.10.1 (Red Hat modified)',
102 // Unknown
103 'I\'m an unknown browser',
104 'I\'m an unknown Glass browser',
105 // Empty
106 ''
107 ];
108
109 // Browsers that pass the feature test but for which we chose to serve
110 // a Grade C experience instead. E.g. they have implementation bugs
111 // for which support would be more expensive than deem worthwhile.
112 blacklisted = [
113 /* Grade C */
114
115 // Internet Explorer 10
116 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)',
117 // IE Mobile 10
118 'Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; Touch; HTC; Windows Phone 8X by HTC)',
119 // Open WebOS < 1.5 (Palm Pre, Palm Pixi)
120 'Mozilla/5.0 (webOS/1.0; U; en-US) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/1.0 Safari/525.27.1 Pre/1.0',
121 'Mozilla/5.0 (webOS/1.4.0; U; en-US) AppleWebKit/532.2 (KHTML, like Gecko) Version/1.0 Safari/532.2 Pixi/1.1 ',
122 // SymbianOS
123 'NokiaN95_8GB-3;Mozilla/5.0 SymbianOS/9.2;U;Series60/3.1 NokiaN95_8GB-3/11.2.011 Profile/MIDP-2.0 Configuration/CLDC-1.1 AppleWebKit/413 (KHTML, like Gecko)',
124 'Nokia7610/2.0 (5.0509.0) SymbianOS/7.0s Series60/2.1 Profile/MIDP-2.0 Configuration/CLDC-1.0 ',
125 'Mozilla/5.0 (SymbianOS/9.1; U; [en]; SymbianOS/91 Series60/3.0) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
126 'Mozilla/5.0 (SymbianOS/9.3; Series60/3.2 NokiaE52-2/091.003; Profile/MIDP-2.1 Configuration/CLDC-1.1 ) AppleWebKit/533.4 (KHTML, like Gecko) NokiaBrowser/7.3.1.34 Mobile Safari/533.4',
127 // NetFront
128 'Mozilla/4.0 (compatible; Linux 2.6.10) NetFront/3.3 Kindle/1.0 (screen 600x800)',
129 'Mozilla/4.0 (compatible; Linux 2.6.22) NetFront/3.4 Kindle/2.0 (screen 824x1200; rotate)',
130 'Mozilla/4.08 (Windows; Mobile Content Viewer/1.0) NetFront/3.2',
131 // Opera Mini
132 'Opera/9.80 (J2ME/MIDP; Opera Mini/3.1.10423/22.387; U; en) Presto/2.5.25 Version/10.54',
133 'Opera/9.50 (J2ME/MIDP; Opera Mini/4.0.10031/298; U; en)',
134 'Opera/9.80 (J2ME/MIDP; Opera Mini/6.24093/26.1305; U; en) Presto/2.8.119 Version/10.54',
135 'Opera/9.80 (Android; Opera Mini/7.29530/27.1407; U; en) Presto/2.8.119 Version/11.10',
136 // Ovi Browser
137 'Mozilla/5.0 (Series40; NokiaX3-02/05.60; Profile/MIDP-2.1 Configuration/CLDC-1.1) Gecko/20100401 S40OviBrowser/3.2.0.0.6',
138 'Mozilla/5.0 (Series40; Nokia305/05.92; Profile/MIDP-2.1 Configuration/CLDC-1.1) Gecko/20100401 S40OviBrowser/3.7.0.0.11',
139 // Google Glass
140 'Mozilla/5.0 (Linux; U; Android 4.0.4; en-us; Glass 1 Build/IMM76L; XE11) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30',
141 // MeeGo
142 'Mozilla/5.0 (MeeGo; NokiaN9) AppleWebKit/534.13 (KHTML, like Gecko) NokiaBrowser/8.5.0 Mobile Safari/534.13',
143 // UC Mini (speed mode on)
144 'Mozilla/5.0 (X11; U; Linux i686; zh-CN; r:1.2.3.4) Gecko/',
145 // Google Web Light proxy
146 'Mozilla/5.0 (Linux; Android 4.2.1; en-us; Nexus 5 Build/JOP40D) AppleWebKit/535.19 (KHTML, like Gecko; googleweblight) Chrome/38.0.1025.166 Mobile Safari/535.19',
147 // PlayStation
148 'Mozilla/5.0 (PLAYSTATION 3; 1.10)',
149 'Mozilla/5.0 (PLAYSTATION 3; 3.55)',
150 'Mozilla/5.0 (PLAYSTATION 3 4.21) AppleWebKit/531.22.8 (KHTML, like Gecko)',
151 'Mozilla/5.0 (PlayStation 4 1.70) AppleWebKit/536.26 (KHTML, like Gecko)'
152 ];
153
154 QUnit.module( 'startup', QUnit.newMwEnvironment() );
155
156 QUnit.test( 'isCompatible( featureTestable )', function ( assert ) {
157 featureTestable.forEach( function ( ua ) {
158 assert.strictEqual( isCompatible( ua ), true, ua );
159 } );
160 } );
161
162 QUnit.test( 'isCompatible( blacklisted )', function ( assert ) {
163 blacklisted.forEach( function ( ua ) {
164 assert.strictEqual( isCompatible( ua ), false, ua );
165 } );
166 } );
167 }() );