webfontloader 1.5.8 → 1.5.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 088656bde5c596913646d9a155dbe923e1442b9a
4
- data.tar.gz: 7a82e483c12beee3e9da8720839ec8e5532a350e
3
+ metadata.gz: 70bf8c6b61ccb3b4e26328fa29c51aff7fc9c3bc
4
+ data.tar.gz: ed30c08fd73534ba6bc6ceff1b3f3d78f458c1ba
5
5
  SHA512:
6
- metadata.gz: 8157026b19f8ff949842907b142f3709fea24a2c691f3e6aff2747061650e6ab4918036c311a05556f0392edbd194bf9de4cef66db2d7b718c31c5f94d056989
7
- data.tar.gz: 2961d9efb79810462949a18250fb31b77ba8d98a162a38843a593669cbcfccf2eeefbb1a5c2f656c47e4c5098c4837ca7e98009076c978989294fcbb64d28166
6
+ metadata.gz: a42b3eeea5586f49ea43dc92f32a14c20e1ed5139cdddd2a06963b66f317c5d71e5cf51d87d67562dbe67f4c8565e478e779f7055e0ad4d653eb57089abb3d4a
7
+ data.tar.gz: 9999410a47c058f6d7d4e23bae27fd1296d69e2be8e5b6709ce886d7a6a0ee4f6230303fe6d8788c4880b0e2d88442c166151665d4d18dedeaaf7c68a71b24fb
data/CHANGELOG CHANGED
@@ -1,3 +1,8 @@
1
+ v1.5.9 (December 18, 2014)
2
+ * Use visibility hidden instead of off-screen positioning
3
+ * Decouple Typekit internal API
4
+ * Disable native font loading (see comment)
5
+
1
6
  v1.5.8 (November 17, 2014)
2
7
  * Add prebuilt library to repository
3
8
 
data/README.md CHANGED
@@ -116,6 +116,24 @@ WebFontConfig = {
116
116
 
117
117
  The `fontloading`, `fontactive` and `fontinactive` callbacks are passed the family name and font variation description of the font that concerns the event.
118
118
 
119
+ It is possible to disable setting classes on the HTML element by setting the `classes` configuration parameter to `false` (defaults to `true`).
120
+
121
+ ```javascript
122
+ WebFontConfig = {
123
+ classes: false
124
+ };
125
+ ```
126
+
127
+ You can also disable font events (callbacks) by setting the `events` parameter to `false` (defaults to `true`).
128
+
129
+ ```javascript
130
+ WebFontConfig = {
131
+ events: false
132
+ };
133
+ ```
134
+
135
+ If both events and classes are disabled, the Web Font Loader does not perform font watching and only acts as a way to insert @font-face rules in the document.
136
+
119
137
  ### Timeouts
120
138
 
121
139
  Since the Internet is not 100% reliable, it's possible that a font will fail to load. The `fontinactive` event will be triggered after 5 seconds if the font fails to render. If *at least* one font succesfully renders, the `active` event will be triggered, else the `inactive` event will be triggered.
data/lib/webfontloader.rb CHANGED
@@ -3,7 +3,7 @@ require 'yaml'
3
3
  require 'webfontloader/modules'
4
4
 
5
5
  module WebFontLoader
6
- VERSION = '1.5.8'
6
+ VERSION = '1.5.9'
7
7
 
8
8
  ProjectRoot = File.expand_path(File.dirname(__FILE__) + "/..")
9
9
 
@@ -6,29 +6,22 @@ describe('EventDispatcher', function () {
6
6
  element = null
7
7
  eventDispatcher = null,
8
8
  namespace = 'ns',
9
- font = null,
10
- nullFn = function () {},
11
- callbacks = {
12
- loading: nullFn,
13
- active: nullFn,
14
- inactive: nullFn,
15
- fontloading: nullFn,
16
- fontactive: nullFn,
17
- fontinactive: nullFn
18
- };
9
+ font = null;
19
10
 
20
11
  beforeEach(function () {
21
12
  element = domHelper.createElement();
13
+ callbacks = {
14
+ loading: jasmine.createSpy('loading'),
15
+ active: jasmine.createSpy('active'),
16
+ inactive: jasmine.createSpy('inactive'),
17
+ fontloading: jasmine.createSpy('fontloading'),
18
+ fontactive: jasmine.createSpy('fontactive'),
19
+ fontinactive: jasmine.createSpy('fontinactive')
20
+ };
21
+
22
22
  eventDispatcher = new EventDispatcher(domHelper, element, callbacks, namespace);
23
23
 
24
24
  font = new Font('My Family', 'n4');
25
-
26
- spyOn(callbacks, 'loading');
27
- spyOn(callbacks, 'active');
28
- spyOn(callbacks, 'inactive');
29
- spyOn(callbacks, 'fontloading');
30
- spyOn(callbacks, 'fontactive');
31
- spyOn(callbacks, 'fontinactive');
32
25
  });
33
26
 
34
27
  describe('#dispatchLoading', function () {
@@ -210,4 +203,41 @@ describe('EventDispatcher', function () {
210
203
  expect(element.className).toEqual('ns-active');
211
204
  });
212
205
  });
206
+
207
+ describe('disable callbacks', function () {
208
+ beforeEach(function () {
209
+ eventDispatcher = new EventDispatcher(domHelper, element, callbacks, namespace, false);
210
+ eventDispatcher.dispatchInactive();
211
+ eventDispatcher.dispatchActive();
212
+ eventDispatcher.dispatchLoading();
213
+ eventDispatcher.dispatchFontInactive(font);
214
+ eventDispatcher.dispatchFontActive(font);
215
+ eventDispatcher.dispatchFontLoading(font);
216
+ });
217
+
218
+ it('should not fire any events', function () {
219
+ expect(callbacks.inactive).not.toHaveBeenCalled();
220
+ expect(callbacks.active).not.toHaveBeenCalled();
221
+ expect(callbacks.loading).not.toHaveBeenCalled();
222
+ expect(callbacks.fontinactive).not.toHaveBeenCalled();
223
+ expect(callbacks.fontactive).not.toHaveBeenCalled();
224
+ expect(callbacks.fontloading).not.toHaveBeenCalled();
225
+ });
226
+ });
227
+
228
+ describe('disable classes', function () {
229
+ beforeEach(function () {
230
+ eventDispatcher = new EventDispatcher(domHelper, element, callbacks, namespace, true, false);
231
+ eventDispatcher.dispatchInactive();
232
+ eventDispatcher.dispatchActive();
233
+ eventDispatcher.dispatchLoading();
234
+ eventDispatcher.dispatchFontInactive(font);
235
+ eventDispatcher.dispatchFontActive(font);
236
+ eventDispatcher.dispatchFontLoading(font);
237
+ });
238
+
239
+ it('should not fire any events', function () {
240
+ expect(element.className).toEqual('');
241
+ });
242
+ });
213
243
  });
@@ -19,13 +19,8 @@ describe('UserAgentParser', function () {
19
19
  return false;
20
20
  }
21
21
 
22
- if (actual.getParsedVersion().ne(expected.parsedVersion)) {
23
- this.message = msg('parsed version', actual.getParsedVersion(), expected.parsedVersion);
24
- return false;
25
- }
26
-
27
- if (actual.getVersion() !== expected.version) {
28
- this.message = msg('version', actual.getVersion(), expected.version);
22
+ if (actual.getVersion().ne(expected.version)) {
23
+ this.message = msg('parsed version', actual.getVersion(), expected.version);
29
24
  return false;
30
25
  }
31
26
 
@@ -34,13 +29,8 @@ describe('UserAgentParser', function () {
34
29
  return false;
35
30
  }
36
31
 
37
- if (actual.getParsedPlatformVersion().ne(expected.parsedPlatformVersion)) {
38
- this.message = msg('platform parsed version', actual.getParsedPlatformVersion(), expected.parsedPlatformVersion);
39
- return false;
40
- }
41
-
42
- if (actual.getPlatformVersion() !== expected.platformVersion) {
43
- this.message = msg('platform version', actual.getPlatformVersion(), expected.platformVersion);
32
+ if (actual.getPlatformVersion().ne(expected.platformVersion)) {
33
+ this.message = msg('platform parsed version', actual.gePlatformVersion(), expected.platformVersion);
44
34
  return false;
45
35
  }
46
36
 
@@ -49,13 +39,8 @@ describe('UserAgentParser', function () {
49
39
  return false;
50
40
  }
51
41
 
52
- if (actual.getParsedEngineVersion().ne(expected.parsedEngineVersion)) {
53
- this.message = msg('engine parsed version', actual.getParsedEngineVersion(), expected.parsedEngineVersion);
54
- return false;
55
- }
56
-
57
- if (actual.getEngineVersion() !== expected.engineVersion) {
58
- this.message = msg('engine version', actual.getEngineVersion(), expected.engineVersion);
42
+ if (actual.getEngineVersion().ne(expected.engineVersion)) {
43
+ this.message = msg('engine parsed version', actual.getEngineVersion(), expected.engineVersion);
59
44
  return false;
60
45
  }
61
46
 
@@ -89,7 +74,7 @@ describe('UserAgentParser', function () {
89
74
  return new UserAgentParser(str, {}).getPlatformVersionString_();
90
75
  }
91
76
 
92
- it('should parse Linux parsedVersions correctly', function () {
77
+ it('should parse Linux versions correctly', function () {
93
78
  expect(parsePlatformVersion('(Linux; U; en-us; KFJWI Build/IML74K)')).toEqual('Unknown');
94
79
  expect(parsePlatformVersion('(Linux i686; U; en)')).toEqual('Unknown');
95
80
  expect(parsePlatformVersion('(X11; Linux i686; U; Linux Mint; nb)')).toEqual('Unknown');
@@ -99,7 +84,7 @@ describe('UserAgentParser', function () {
99
84
  expect(parsePlatformVersion('(X11; Linux 10.1; U; en-US)')).toEqual('10.1');
100
85
  });
101
86
 
102
- it('should parse ChromeOS parsedVersions correctly', function () {
87
+ it('should parse ChromeOS versions correctly', function () {
103
88
  expect(parsePlatformVersion('(X11; CrOS i686 1660.57.0)')).toEqual('1660.57.0');
104
89
  });
105
90
  });
@@ -114,14 +99,11 @@ describe('UserAgentParser', function () {
114
99
  expect(parse('Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en) AppleWebKit/531.9 (KHTML, like Gecko) AdobeAIR/2.5'))
115
100
  .toMatchUserAgent({
116
101
  name: 'AdobeAIR',
117
- parsedVersion: new Version(2, 5),
118
- version: '2.5',
102
+ version: new Version(2, 5),
119
103
  platform: 'Macintosh',
120
- parsedPlatformVersion: new Version(),
121
- platformVersion: 'Unknown',
104
+ platformVersion: new Version(),
122
105
  engine: 'AppleWebKit',
123
- parsedEngineVersion: new Version(531, 9),
124
- engineVersion: '531.9',
106
+ engineVersion: new Version(531, 9),
125
107
  documentMode: undefined,
126
108
  browserInfo: {
127
109
  hasWebFontSupport: true,
@@ -135,14 +117,11 @@ describe('UserAgentParser', function () {
135
117
  expect(parse('Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en) AppleWebKit/531.9 (KHTML, like Gecko) AdobeAIR/2.0'))
136
118
  .toMatchUserAgent({
137
119
  name: 'AdobeAIR',
138
- parsedVersion: new Version(2, 0),
139
- version: '2.0',
120
+ version: new Version(2, 0),
140
121
  platform: 'Macintosh',
141
- parsedPlatformVersion: new Version(),
142
- platformVersion: 'Unknown',
122
+ platformVersion: new Version(),
143
123
  engine: 'AppleWebKit',
144
- parsedEngineVersion: new Version(531, 9),
145
- engineVersion: '531.9',
124
+ engineVersion: new Version(531, 9),
146
125
  documentMode: undefined,
147
126
  browserInfo: {
148
127
  hasWebFontSupport: false,
@@ -158,14 +137,11 @@ describe('UserAgentParser', function () {
158
137
  expect(parse('Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 GTB7.1'))
159
138
  .toMatchUserAgent({
160
139
  name: 'Firefox',
161
- parsedVersion: new Version(3, 6, 3),
162
- version: '3.6.3',
140
+ version: new Version(3, 6, 3),
163
141
  platform: 'Macintosh',
164
- parsedPlatformVersion: new Version(10, 5),
165
- platformVersion: '10.5',
142
+ platformVersion: new Version(10, 5),
166
143
  engine: 'Gecko',
167
- parsedEngineVersion: new Version(1, 9, 2, 3),
168
- engineVersion: '1.9.2.3',
144
+ engineVersion: new Version(1, 9, 2, 3),
169
145
  documentMode: undefined,
170
146
  browserInfo: {
171
147
  hasWebFontSupport: true,
@@ -177,14 +153,11 @@ describe('UserAgentParser', function () {
177
153
  expect(parse('Mozilla/5.0 (X11; U; Linux i686; ru-RU; rv:1.9.2a1pre) Gecko/20090405 Ubuntu/9.04 (jaunty) Firefox/3.6a1pre'))
178
154
  .toMatchUserAgent({
179
155
  name: 'Firefox',
180
- parsedVersion: new Version(3, 6, null, 'a1pre'),
181
- version: '3.6a1pre',
156
+ version: new Version(3, 6, null, 'a1pre'),
182
157
  platform: 'Linux',
183
- parsedPlatformVersion: new Version(), //'i686'
184
- platformVersion: 'Unknown',
158
+ platformVersion: new Version(), //'i686'
185
159
  engine: 'Gecko',
186
- parsedEngineVersion: new Version(1, 9, 2, 'a1pre'),
187
- engineVersion: '1.9.2a1pre',
160
+ engineVersion: new Version(1, 9, 2, 'a1pre'),
188
161
  documentMode: undefined,
189
162
  browserInfo: {
190
163
  hasWebFontSupport: true,
@@ -198,14 +171,11 @@ describe('UserAgentParser', function () {
198
171
  expect(parse('Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:2.0b1) Gecko/20100630 Firefox/4.0b1'))
199
172
  .toMatchUserAgent({
200
173
  name: 'Firefox',
201
- parsedVersion: new Version(4, 0, null, 'b1'),
202
- version: '4.0b1',
174
+ version: new Version(4, 0, null, 'b1'),
203
175
  platform: 'Macintosh',
204
- parsedPlatformVersion: new Version(10, 6),
205
- platformVersion: '10.6',
176
+ platformVersion: new Version(10, 6),
206
177
  engine: 'Gecko',
207
- parsedEngineVersion: new Version(2, 0, 'b1'),
208
- engineVersion: '2.0b1',
178
+ engineVersion: new Version(2, 0, 'b1'),
209
179
  documentMode: undefined,
210
180
  browserInfo: {
211
181
  hasWebFontSupport: true,
@@ -216,19 +186,16 @@ describe('UserAgentParser', function () {
216
186
  });
217
187
 
218
188
  it('should detect Firefox on Android', function () {
219
- // This useragent has been slightly doctored with parsedVersions to ensure the right
189
+ // This useragent has been slightly doctored with versions to ensure the right
220
190
  // info is coming from the right places.
221
191
  expect(parse('Mozilla/5.0 (Android; Mobile; rv:13.0) Gecko/15.0 Firefox/14.0'))
222
192
  .toMatchUserAgent({
223
193
  name: 'Firefox',
224
- parsedVersion: new Version(14, 0),
225
- version: '14.0',
194
+ version: new Version(14, 0),
226
195
  platform: 'Android',
227
- parsedPlatformVersion: new Version(),
228
- platformVersion: 'Unknown',
196
+ platformVersion: new Version(),
229
197
  engine: 'Gecko',
230
- parsedEngineVersion: new Version(13, 0),
231
- engineVersion: '13.0',
198
+ engineVersion: new Version(13, 0),
232
199
  documentMode: undefined,
233
200
  browserInfo: {
234
201
  hasWebFontSupport: true,
@@ -242,14 +209,11 @@ describe('UserAgentParser', function () {
242
209
  expect(parse('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.19) Gecko/20081202 Firefox (Debian-2.0.0.19-0etch1)'))
243
210
  .toMatchUserAgent({
244
211
  name: 'Firefox',
245
- parsedVersion: new Version(),
246
- version: '',
212
+ version: new Version(),
247
213
  platform: 'Linux',
248
- parsedPlatformVersion: new Version(), //'i686'
249
- platformVersion: 'Unknown',
214
+ platformVersion: new Version(), //'i686'
250
215
  engine: 'Gecko',
251
- parsedEngineVersion: new Version(1, 8, 1, 19),
252
- engineVersion: '1.8.1.19',
216
+ engineVersion: new Version(1, 8, 1, 19),
253
217
  documentMode: undefined,
254
218
  browserInfo: {
255
219
  hasWebFontSupport: false,
@@ -265,14 +229,11 @@ describe('UserAgentParser', function () {
265
229
  expect(parse('Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_8; en-US) AppleWebKit/533.2 (KHTML, like Gecko) Chrome/5.0.342.9 Safari/533.2'))
266
230
  .toMatchUserAgent({
267
231
  name: 'Chrome',
268
- parsedVersion: new Version(5, 0, 342, 9),
269
- version: '5.0.342.9',
232
+ version: new Version(5, 0, 342, 9),
270
233
  platform: 'Macintosh',
271
- parsedPlatformVersion: new Version(10, 5, 8),
272
- platformVersion: '10_5_8',
234
+ platformVersion: new Version(10, 5, 8),
273
235
  engine: 'AppleWebKit',
274
- parsedEngineVersion: new Version(533, 2),
275
- engineVersion: '533.2',
236
+ engineVersion: new Version(533, 2),
276
237
  documentMode: undefined,
277
238
  browserInfo: {
278
239
  hasWebFontSupport: true,
@@ -286,14 +247,11 @@ describe('UserAgentParser', function () {
286
247
  expect(parse('Mozilla/5.0 (X11; CrOS i686 1660.57.0) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.46 Safari/535.19'))
287
248
  .toMatchUserAgent({
288
249
  name: 'Chrome',
289
- parsedVersion: new Version(18, 0, 1025, 46),
290
- version: '18.0.1025.46',
250
+ version: new Version(18, 0, 1025, 46),
291
251
  platform: 'CrOS',
292
- parsedPlatformVersion: new Version(1660, 57, 0),
293
- platformVersion: '1660.57.0',
252
+ platformVersion: new Version(1660, 57, 0),
294
253
  engine: 'AppleWebKit',
295
- parsedEngineVersion: new Version(535, 19),
296
- engineVersion: '535.19',
254
+ engineVersion: new Version(535, 19),
297
255
  documentMode: undefined,
298
256
  browserInfo: {
299
257
  hasWebFontSupport: true,
@@ -307,14 +265,11 @@ describe('UserAgentParser', function () {
307
265
  expect(parse('Mozilla/5.0 (CrKey armv71 1.6.16664) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.0 Safari/537.36'))
308
266
  .toMatchUserAgent({
309
267
  name: 'Chrome',
310
- parsedVersion: new Version(31, 0, 1650, 0),
311
- version: '31.0.1650.0',
268
+ version: new Version(31, 0, 1650, 0),
312
269
  platform: 'CrKey',
313
- parsedPlatformVersion: new Version(1, 6, 16664),
314
- platformVersion: '1.6.16664',
270
+ platformVersion: new Version(1, 6, 16664),
315
271
  engine: 'AppleWebKit',
316
- parsedEngineVersion: new Version(537, 36),
317
- engineVersion: '537.36',
272
+ engineVersion: new Version(537, 36),
318
273
  documentMode: undefined,
319
274
  browserInfo: {
320
275
  hasWebFontSupport: true,
@@ -328,14 +283,11 @@ describe('UserAgentParser', function () {
328
283
  expect(parse('Mozilla/5.0 (Linux; U; Android 4.0.3; en-us; Nexus S Build/IML74K) AppleWebKit/535.7 (KHTML, like Gecko) CrMo/16.0.912.75 Mobile Safari/535.7'))
329
284
  .toMatchUserAgent({
330
285
  name: 'Chrome',
331
- parsedVersion: new Version(16, 0, 912, 75),
332
- version: '16.0.912.75',
286
+ version: new Version(16, 0, 912, 75),
333
287
  platform: 'Android',
334
- parsedPlatformVersion: new Version(4, 0, 3),
335
- platformVersion: '4.0.3',
288
+ platformVersion: new Version(4, 0, 3),
336
289
  engine: 'AppleWebKit',
337
- parsedEngineVersion: new Version(535, 7),
338
- engineVersion: '535.7',
290
+ engineVersion: new Version(535, 7),
339
291
  documentMode: undefined,
340
292
  browserInfo: {
341
293
  hasWebFontSupport: true,
@@ -347,14 +299,11 @@ describe('UserAgentParser', function () {
347
299
  expect(parse('Mozilla/5.0 (Linux; Android 4.2.2; SGH-M919 Build/JDQ39) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.169 Mobile Safari/537.22'))
348
300
  .toMatchUserAgent({
349
301
  name: 'Chrome',
350
- parsedVersion: new Version(25, 0, 1364, 169),
351
- version: '25.0.1364.169',
302
+ version: new Version(25, 0, 1364, 169),
352
303
  platform: 'Android',
353
- parsedPlatformVersion: new Version(4, 2, 2),
354
- platformVersion: '4.2.2',
304
+ platformVersion: new Version(4, 2, 2),
355
305
  engine: 'AppleWebKit',
356
- parsedEngineVersion: new Version(537, 22),
357
- engineVersion: '537.22',
306
+ engineVersion: new Version(537, 22),
358
307
  documentMode: undefined,
359
308
  browserInfo: {
360
309
  hasWebFontSupport: true,
@@ -368,14 +317,11 @@ describe('UserAgentParser', function () {
368
317
  expect(parse('Mozilla/5.0 (iPad; U; CPU OS 5_1_1 like Mac OS X; en-us) AppleWebKit/534.46.0 (KHTML, like Gecko) CriOS/19.0.1084.60 Mobile/9B206 Safari/7534.48.3'))
369
318
  .toMatchUserAgent({
370
319
  name: 'Chrome',
371
- parsedVersion: new Version(19, 0, 1084, 60),
372
- version: '19.0.1084.60',
320
+ version: new Version(19, 0, 1084, 60),
373
321
  platform: 'iPad',
374
- parsedPlatformVersion: new Version(5, 1, 1),
375
- platformVersion: '5_1_1',
322
+ platformVersion: new Version(5, 1, 1),
376
323
  engine: 'AppleWebKit',
377
- parsedEngineVersion: new Version(534, 46, 0),
378
- engineVersion: '534.46.0',
324
+ engineVersion: new Version(534, 46, 0),
379
325
  documentMode: undefined,
380
326
  browserInfo: {
381
327
  hasWebFontSupport: true,
@@ -389,14 +335,11 @@ describe('UserAgentParser', function () {
389
335
  expect(parse('Mozilla/5.0 (iPod; U; CPU iPhone OS 5_1_1 like Mac OS X; en-us) AppleWebKit/534.46.0 (KHTML, like Gecko) CriOS/19.0.1084.60 Mobile/9B206 Safari/7534.48.3'))
390
336
  .toMatchUserAgent({
391
337
  name: 'Chrome',
392
- parsedVersion: new Version(19, 0, 1084, 60),
393
- version: '19.0.1084.60',
338
+ version: new Version(19, 0, 1084, 60),
394
339
  platform: 'iPod',
395
- parsedPlatformVersion: new Version(5, 1, 1),
396
- platformVersion: '5_1_1',
340
+ platformVersion: new Version(5, 1, 1),
397
341
  engine: 'AppleWebKit',
398
- parsedEngineVersion: new Version(534, 46, 0),
399
- engineVersion: '534.46.0',
342
+ engineVersion: new Version(534, 46, 0),
400
343
  documentMode: undefined,
401
344
  browserInfo: {
402
345
  hasWebFontSupport: true,
@@ -412,14 +355,11 @@ describe('UserAgentParser', function () {
412
355
  expect(parse('Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_8; en-us) AppleWebKit/531.21.8 (KHTML, like Gecko) Version/4.0.4 Safari/531.21.10'))
413
356
  .toMatchUserAgent({
414
357
  name: 'Safari',
415
- parsedVersion: new Version(4, 0, 4),
416
- version: '4.0.4',
358
+ version: new Version(4, 0, 4),
417
359
  platform: 'Macintosh',
418
- parsedPlatformVersion: new Version(10, 5, 8),
419
- platformVersion: '10_5_8',
360
+ platformVersion: new Version(10, 5, 8),
420
361
  engine: 'AppleWebKit',
421
- parsedEngineVersion: new Version(531, 21, 8),
422
- engineVersion: '531.21.8',
362
+ engineVersion: new Version(531, 21, 8),
423
363
  documentMode: undefined,
424
364
  browserInfo: {
425
365
  hasWebFontSupport: true,
@@ -431,14 +371,11 @@ describe('UserAgentParser', function () {
431
371
  expect(parse('Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_4_11; tr) AppleWebKit/528.4+ (KHTML, like Gecko) Version/4.0dp1 Safari/526.11.2'))
432
372
  .toMatchUserAgent({
433
373
  name: 'Safari',
434
- parsedVersion: new Version(4, 0, null, 'dp1'),
435
- version: '4.0dp1',
374
+ version: new Version(4, 0, null, 'dp1'),
436
375
  platform: 'Macintosh',
437
- parsedPlatformVersion: new Version(10, 4, 11),
438
- platformVersion: '10_4_11',
376
+ platformVersion: new Version(10, 4, 11),
439
377
  engine: 'AppleWebKit',
440
- parsedEngineVersion: new Version(528, 4),
441
- engineVersion: '528.4+',
378
+ engineVersion: new Version(528, 4),
442
379
  documentMode: undefined,
443
380
  browserInfo: {
444
381
  hasWebFontSupport: true,
@@ -452,14 +389,11 @@ describe('UserAgentParser', function () {
452
389
  expect(parse('Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_1_2 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7D11 Safari/528.16'))
453
390
  .toMatchUserAgent({
454
391
  name: 'Safari',
455
- parsedVersion: new Version(4, 0),
456
- version: '4.0',
392
+ version: new Version(4, 0),
457
393
  platform: 'iPhone',
458
- parsedPlatformVersion: new Version(3, 1, 2),
459
- platformVersion: '3_1_2',
394
+ platformVersion: new Version(3, 1, 2),
460
395
  engine: 'AppleWebKit',
461
- parsedEngineVersion: new Version(528, 18),
462
- engineVersion: '528.18',
396
+ engineVersion: new Version(528, 18),
463
397
  documentMode: undefined,
464
398
  browserInfo: {
465
399
  hasWebFontSupport: true,
@@ -473,14 +407,11 @@ describe('UserAgentParser', function () {
473
407
  expect(parse('Mozilla/5.0(iPad; U; CPU iPhone OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B314 Safari/531.21.10'))
474
408
  .toMatchUserAgent({
475
409
  name: 'Safari',
476
- parsedVersion: new Version(4, 0, 4),
477
- version: '4.0.4',
410
+ version: new Version(4, 0, 4),
478
411
  platform: 'iPad',
479
- parsedPlatformVersion: new Version(3, 2),
480
- platformVersion: '3_2',
412
+ platformVersion: new Version(3, 2),
481
413
  engine: 'AppleWebKit',
482
- parsedEngineVersion: new Version(531, 21, 10),
483
- engineVersion: '531.21.10',
414
+ engineVersion: new Version(531, 21, 10),
484
415
  documentMode: undefined,
485
416
  browserInfo: {
486
417
  hasWebFontSupport: true,
@@ -492,14 +423,11 @@ describe('UserAgentParser', function () {
492
423
  expect(parse('Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B360 Safari/531.21.10"'))
493
424
  .toMatchUserAgent({
494
425
  name: 'Safari',
495
- parsedVersion: new Version(4, 0, 4),
496
- version: '4.0.4',
426
+ version: new Version(4, 0, 4),
497
427
  platform: 'iPad',
498
- parsedPlatformVersion: new Version(3, 2),
499
- platformVersion: '3_2',
428
+ platformVersion: new Version(3, 2),
500
429
  engine: 'AppleWebKit',
501
- parsedEngineVersion: new Version(531, 21, 10),
502
- engineVersion: '531.21.10',
430
+ engineVersion: new Version(531, 21, 10),
503
431
  documentMode: undefined,
504
432
  browserInfo: {
505
433
  hasWebFontSupport: true,
@@ -511,14 +439,11 @@ describe('UserAgentParser', function () {
511
439
  expect(parse('Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10'))
512
440
  .toMatchUserAgent({
513
441
  name: 'Safari',
514
- parsedVersion: new Version(4, 0, 4),
515
- version: '4.0.4',
442
+ version: new Version(4, 0, 4),
516
443
  platform: 'iPad',
517
- parsedPlatformVersion: new Version(3, 2),
518
- platformVersion: '3_2',
444
+ platformVersion: new Version(3, 2),
519
445
  engine: 'AppleWebKit',
520
- parsedEngineVersion: new Version(531, 21, 10),
521
- engineVersion: '531.21.10',
446
+ engineVersion: new Version(531, 21, 10),
522
447
  documentMode: undefined,
523
448
  browserInfo: {
524
449
  hasWebFontSupport: true,
@@ -532,14 +457,11 @@ describe('UserAgentParser', function () {
532
457
  expect(parse('Mozilla/5.0 (iPod; U; CPU iPhone OS 2_2_1 like Mac OS X; en-us) AppleWebKit/525.18.1 (KHTML, like Gecko) Mobile/5H11a'))
533
458
  .toMatchUserAgent({
534
459
  name: 'Unknown',
535
- parsedVersion: new Version(),
536
- version: 'Unknown',
460
+ version: new Version(),
537
461
  platform: 'iPod',
538
- parsedPlatformVersion: new Version(2, 2, 1),
539
- platformVersion: '2_2_1',
462
+ platformVersion: new Version(2, 2, 1),
540
463
  engine: 'AppleWebKit',
541
- parsedEngineVersion: new Version(525, 18, 1),
542
- engineVersion: '525.18.1',
464
+ engineVersion: new Version(525, 18, 1),
543
465
  documentMode: undefined,
544
466
  browserInfo: {
545
467
  hasWebFontSupport: true,
@@ -551,14 +473,11 @@ describe('UserAgentParser', function () {
551
473
  expect(parse('Mozilla/5.0 (iPod; U; CPU iPhone OS 3_1 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7C144 Safari/528.16'))
552
474
  .toMatchUserAgent({
553
475
  name: 'Safari',
554
- parsedVersion: new Version(4, 0),
555
- version: '4.0',
476
+ version: new Version(4, 0),
556
477
  platform: 'iPod',
557
- parsedPlatformVersion: new Version(3, 1),
558
- platformVersion: '3_1',
478
+ platformVersion: new Version(3, 1),
559
479
  engine: 'AppleWebKit',
560
- parsedEngineVersion: new Version(528, 18),
561
- engineVersion: '528.18',
480
+ engineVersion: new Version(528, 18),
562
481
  documentMode: undefined,
563
482
  browserInfo: {
564
483
  hasWebFontSupport: true,
@@ -574,14 +493,11 @@ describe('UserAgentParser', function () {
574
493
  expect(parse('Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; InfoPath.2; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)'))
575
494
  .toMatchUserAgent({
576
495
  name: 'MSIE',
577
- parsedVersion: new Version(7, 0),
578
- version: '7.0',
496
+ version: new Version(7, 0),
579
497
  platform: 'Windows',
580
- parsedPlatformVersion: new Version(5, 1),
581
- platformVersion: '5.1',
498
+ platformVersion: new Version(5, 1),
582
499
  engine: 'Unknown',
583
- parsedEngineVersion: new Version(),
584
- engineVersion: 'Unknown',
500
+ engineVersion: new Version(),
585
501
  documentMode: undefined,
586
502
  browserInfo: {
587
503
  hasWebFontSupport: true,
@@ -593,14 +509,11 @@ describe('UserAgentParser', function () {
593
509
  expect(parse('Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 5.1; Media Center PC 3.0; .NET CLR 1.0.3705; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.1)'))
594
510
  .toMatchUserAgent({
595
511
  name: 'MSIE',
596
- parsedVersion: new Version(7, 0, null, 'b'),
597
- version: '7.0b',
512
+ version: new Version(7, 0, null, 'b'),
598
513
  platform: 'Windows',
599
- parsedPlatformVersion: new Version(5, 1),
600
- platformVersion: '5.1',
514
+ platformVersion: new Version(5, 1),
601
515
  engine: 'Unknown',
602
- parsedEngineVersion: new Version(),
603
- engineVersion: 'Unknown',
516
+ engineVersion: new Version(),
604
517
  documentMode: undefined,
605
518
  browserInfo: {
606
519
  hasWebFontSupport: true,
@@ -614,14 +527,11 @@ describe('UserAgentParser', function () {
614
527
  expect(parse('Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)'))
615
528
  .toMatchUserAgent({
616
529
  name: 'MSIE',
617
- parsedVersion: new Version(7, 0),
618
- version: '7.0',
530
+ version: new Version(7, 0),
619
531
  platform: 'Windows',
620
- parsedPlatformVersion: new Version(5, 1),
621
- platformVersion: '5.1',
532
+ platformVersion: new Version(5, 1),
622
533
  engine: 'Unknown',
623
- parsedEngineVersion: new Version(),
624
- engineVersion: 'Unknown',
534
+ engineVersion: new Version(),
625
535
  documentMode: undefined,
626
536
  browserInfo: {
627
537
  hasWebFontSupport: true,
@@ -635,14 +545,11 @@ describe('UserAgentParser', function () {
635
545
  expect(parse('Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; ARM; Touch; IEMobile/10.0; <Manufacturer>; <Device>; <Operator>)'))
636
546
  .toMatchUserAgent({
637
547
  name: 'MSIE',
638
- parsedVersion: new Version(10, 0),
639
- version: '10.0',
548
+ version: new Version(10, 0),
640
549
  platform: 'Windows Phone',
641
- parsedPlatformVersion: new Version(8, 0),
642
- platformVersion: '8.0',
550
+ platformVersion: new Version(8, 0),
643
551
  engine: 'Trident',
644
- parsedEngineVersion: new Version(6, 0),
645
- engineVersion: '6.0',
552
+ engineVersion: new Version(6, 0),
646
553
  documentMode: undefined,
647
554
  browserInfo: {
648
555
  hasWebFontSupport: true,
@@ -654,14 +561,11 @@ describe('UserAgentParser', function () {
654
561
  expect(parse('Mozilla/5.0 (Windows Phone 8.1; ARM; Trident/7.0; Touch; rv:11.0; IEMobile/11.0; NOKIA; id404) like Gecko'))
655
562
  .toMatchUserAgent({
656
563
  name: 'MSIE',
657
- parsedVersion: new Version(11, 0),
658
- version: '11.0',
564
+ version: new Version(11, 0),
659
565
  platform: 'Windows Phone',
660
- parsedPlatformVersion: new Version(8, 1),
661
- platformVersion: '8.1',
566
+ platformVersion: new Version(8, 1),
662
567
  engine: 'Trident',
663
- parsedEngineVersion: new Version(7, 0),
664
- engineVersion: '7.0',
568
+ engineVersion: new Version(7, 0),
665
569
  documentMode: undefined,
666
570
  browserInfo: {
667
571
  hasWebFontSupport: true,
@@ -675,14 +579,11 @@ describe('UserAgentParser', function () {
675
579
  expect(parse('Mozilla/5.0 (compatible; MSIE 9.0; Windows Phone OS 7.5; Trident/5.0; IEMobile/9.0; SAMSUNG; SGH-i917)'))
676
580
  .toMatchUserAgent({
677
581
  name: 'MSIE',
678
- parsedVersion: new Version(9, 0),
679
- version: '9.0',
582
+ version: new Version(9, 0),
680
583
  platform: 'Windows Phone',
681
- parsedPlatformVersion: new Version(7, 5),
682
- platformVersion: '7.5',
584
+ platformVersion: new Version(7, 5),
683
585
  engine: 'Trident',
684
- parsedEngineVersion: new Version(5, 0),
685
- engineVersion: '5.0',
586
+ engineVersion: new Version(5, 0),
686
587
  documentMode: undefined,
687
588
  browserInfo: {
688
589
  hasWebFontSupport: false,
@@ -696,14 +597,11 @@ describe('UserAgentParser', function () {
696
597
  expect(parse('Mozilla/4.0 (compatible; MSIE 5.23; Mac_PowerPC)'))
697
598
  .toMatchUserAgent({
698
599
  name: 'MSIE',
699
- parsedVersion: new Version(5, 23),
700
- version: '5.23',
600
+ version: new Version(5, 23),
701
601
  platform: 'Macintosh',
702
- parsedPlatformVersion: new Version(),
703
- platformVersion: 'Unknown',
602
+ platformVersion: new Version(),
704
603
  engine: 'Unknown',
705
- parsedEngineVersion: new Version(),
706
- engineVersion: 'Unknown',
604
+ engineVersion: new Version(),
707
605
  documentMode: undefined,
708
606
  browserInfo: {
709
607
  hasWebFontSupport: false,
@@ -717,14 +615,11 @@ describe('UserAgentParser', function () {
717
615
  expect(parse('Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)', { documentMode: 8 }))
718
616
  .toMatchUserAgent({
719
617
  name: 'MSIE',
720
- parsedVersion: new Version(8, 0),
721
- version: '8.0',
618
+ version: new Version(8, 0),
722
619
  platform: 'Windows',
723
- parsedPlatformVersion: new Version(6, 1),
724
- platformVersion: '6.1',
620
+ platformVersion: new Version(6, 1),
725
621
  engine: 'Trident',
726
- parsedEngineVersion: new Version(4, 0),
727
- engineVersion: '4.0',
622
+ engineVersion: new Version(4, 0),
728
623
  documentMode: 8,
729
624
  browserInfo: {
730
625
  hasWebFontSupport: true,
@@ -738,14 +633,11 @@ describe('UserAgentParser', function () {
738
633
  expect(parse('Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko', { documentMode: 11 }))
739
634
  .toMatchUserAgent({
740
635
  name: 'MSIE',
741
- parsedVersion: new Version(11, 0),
742
- version: '11.0',
636
+ version: new Version(11, 0),
743
637
  platform: 'Windows',
744
- parsedPlatformVersion: new Version(6, 3),
745
- platformVersion: '6.3',
638
+ platformVersion: new Version(6, 3),
746
639
  engine: 'Trident',
747
- parsedEngineVersion: new Version(7, 0),
748
- engineVersion: '7.0',
640
+ engineVersion: new Version(7, 0),
749
641
  documentMode: 11,
750
642
  browserInfo: {
751
643
  hasWebFontSupport: true,
@@ -761,14 +653,11 @@ describe('UserAgentParser', function () {
761
653
  expect(parse('Mozilla/5.0 (Linux; U; Android 2.2.1; en-ca; LG-P505R Build/FRG83) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1'))
762
654
  .toMatchUserAgent({
763
655
  name: 'BuiltinBrowser',
764
- parsedVersion: new Version(),
765
- version: 'Unknown',
656
+ version: new Version(),
766
657
  platform: 'Android',
767
- parsedPlatformVersion: new Version(2, 2, 1),
768
- platformVersion: '2.2.1',
658
+ platformVersion: new Version(2, 2, 1),
769
659
  engine: 'AppleWebKit',
770
- parsedEngineVersion: new Version(533, 1),
771
- engineVersion: '533.1',
660
+ engineVersion: new Version(533, 1),
772
661
  documentMode: undefined,
773
662
  browserInfo: {
774
663
  hasWebFontSupport: true,
@@ -782,14 +671,11 @@ describe('UserAgentParser', function () {
782
671
  expect(parse('Mozilla/5.0 (Linux; U; Android 2.1-update1; en-us; Nexus One Build/ERE27) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17'))
783
672
  .toMatchUserAgent({
784
673
  name: 'BuiltinBrowser',
785
- parsedVersion: new Version(),
786
- version: 'Unknown',
674
+ version: new Version(),
787
675
  platform: 'Android',
788
- parsedPlatformVersion: new Version(2, 1, null, 'update1'),
789
- platformVersion: '2.1-update1',
676
+ platformVersion: new Version(2, 1, null, 'update1'),
790
677
  engine: 'AppleWebKit',
791
- parsedEngineVersion: new Version(530, 17),
792
- engineVersion: '530.17',
678
+ engineVersion: new Version(530, 17),
793
679
  documentMode: undefined,
794
680
  browserInfo: {
795
681
  hasWebFontSupport: false,
@@ -803,14 +689,11 @@ describe('UserAgentParser', function () {
803
689
  expect(parse('Mozilla/5.0 (Linux; Android 4.2.2; sl-si; SAMSUNG GT-I9505 Build/JDQ39) AppleWebKit/535.19 (KHTML, like Gecko) Version/1.0 Chrome/18.0.1025.308 Mobile Safari/535.19'))
804
690
  .toMatchUserAgent({
805
691
  name: 'Chrome',
806
- parsedVersion: new Version(18, 0, 1025, 308),
807
- version: '18.0.1025.308',
692
+ version: new Version(18, 0, 1025, 308),
808
693
  platform: 'Android',
809
- parsedPlatformVersion: new Version(4, 2, 2),
810
- platformVersion: '4.2.2',
694
+ platformVersion: new Version(4, 2, 2),
811
695
  engine: 'AppleWebKit',
812
- parsedEngineVersion: new Version(535, 19),
813
- engineVersion: '535.19',
696
+ engineVersion: new Version(535, 19),
814
697
  documentMode: undefined,
815
698
  browserInfo: {
816
699
  hasWebFontSupport: true,
@@ -822,14 +705,11 @@ describe('UserAgentParser', function () {
822
705
  expect(parse('Mozilla/5.0 (Linux; Android 4.2.2; en-us; SAMSUNG SGH-M919 Build/JDQ39) AppleWebKit/535.19 (KHTML, like Gecko) Version/1.0 Chrome/18.0.1025.308 Mobile Safari/535.19'))
823
706
  .toMatchUserAgent({
824
707
  name: 'Chrome',
825
- parsedVersion: new Version(18, 0, 1025, 308),
826
- version: '18.0.1025.308',
708
+ version: new Version(18, 0, 1025, 308),
827
709
  platform: 'Android',
828
- parsedPlatformVersion: new Version(4, 2, 2),
829
- platformVersion: '4.2.2',
710
+ platformVersion: new Version(4, 2, 2),
830
711
  engine: 'AppleWebKit',
831
- parsedEngineVersion: new Version(535, 19),
832
- engineVersion: '535.19',
712
+ engineVersion: new Version(535, 19),
833
713
  documentMode: undefined,
834
714
  browserInfo: {
835
715
  hasWebFontSupport: true,
@@ -843,14 +723,11 @@ describe('UserAgentParser', function () {
843
723
  expect(parse('Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.34 Safari/534.24'))
844
724
  .toMatchUserAgent({
845
725
  name: 'Chrome',
846
- parsedVersion: new Version(11, 0, 696, 34),
847
- version: '11.0.696.34',
726
+ version: new Version(11, 0, 696, 34),
848
727
  platform: 'Linux',
849
- parsedPlatformVersion: new Version(),
850
- platformVersion: 'Unknown',
728
+ platformVersion: new Version(),
851
729
  engine: 'AppleWebKit',
852
- parsedEngineVersion: new Version(534, 24),
853
- engineVersion: '534.24',
730
+ engineVersion: new Version(534, 24),
854
731
  documentMode: undefined,
855
732
  browserInfo: {
856
733
  hasWebFontSupport: true,
@@ -864,14 +741,11 @@ describe('UserAgentParser', function () {
864
741
  expect(parse('Mozilla/5.0 (Linux; U; Android 4.1.2; en-us; sdk Build/MASTER) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30'))
865
742
  .toMatchUserAgent({
866
743
  name: 'BuiltinBrowser',
867
- parsedVersion: new Version(),
868
- version: 'Unknown',
744
+ version: new Version(),
869
745
  platform: 'Android',
870
- parsedPlatformVersion: new Version(4, 1, 2),
871
- platformVersion: '4.1.2',
746
+ platformVersion: new Version(4, 1, 2),
872
747
  engine: 'AppleWebKit',
873
- parsedEngineVersion: new Version(534, 30),
874
- engineVersion: '534.30',
748
+ engineVersion: new Version(534, 30),
875
749
  documentMode: undefined,
876
750
  browserInfo: {
877
751
  hasWebFontSupport: true,
@@ -885,14 +759,11 @@ describe('UserAgentParser', function () {
885
759
  expect(parse('Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.34 Safari/534.24'))
886
760
  .toMatchUserAgent({
887
761
  name: 'Chrome',
888
- parsedVersion: new Version(11, 0, 696, 34),
889
- version: '11.0.696.34',
762
+ version: new Version(11, 0, 696, 34),
890
763
  platform: 'Linux',
891
- parsedPlatformVersion: new Version(),
892
- platformVersion: 'Unknown',
764
+ platformVersion: new Version(),
893
765
  engine: 'AppleWebKit',
894
- parsedEngineVersion: new Version(534, 24),
895
- engineVersion: '534.24',
766
+ engineVersion: new Version(534, 24),
896
767
  documentMode: undefined,
897
768
  browserInfo: {
898
769
  hasWebFontSupport: true,
@@ -906,14 +777,11 @@ describe('UserAgentParser', function () {
906
777
  expect(parse('Mozilla/5.0 (Linux; U; Android 4.1.2; en-us; Nexus S Build/JZO54K) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30'))
907
778
  .toMatchUserAgent({
908
779
  name: 'BuiltinBrowser',
909
- parsedVersion: new Version(),
910
- version: 'Unknown',
780
+ version: new Version(),
911
781
  platform: 'Android',
912
- parsedPlatformVersion: new Version(4, 1, 2),
913
- platformVersion: '4.1.2',
782
+ platformVersion: new Version(4, 1, 2),
914
783
  engine: 'AppleWebKit',
915
- parsedEngineVersion: new Version(534, 30),
916
- engineVersion: '534.30',
784
+ engineVersion: new Version(534, 30),
917
785
  documentMode: undefined,
918
786
  browserInfo: {
919
787
  hasWebFontSupport: true,
@@ -927,14 +795,11 @@ describe('UserAgentParser', function () {
927
795
  expect(parse('Mozilla/5.0 (BB10; Touch) AppleWebKit/537.3+ (KHTML, like Gecko) Version/10.0.9.388 Mobile Safari/537.3+'))
928
796
  .toMatchUserAgent({
929
797
  name: 'BuiltinBrowser',
930
- parsedVersion: new Version(),
931
- version: 'Unknown',
798
+ version: new Version(),
932
799
  platform: 'BlackBerry',
933
- parsedPlatformVersion: new Version(10, 0, 9, 388),
934
- platformVersion: '10.0.9.388',
800
+ platformVersion: new Version(10, 0, 9, 388),
935
801
  engine: 'AppleWebKit',
936
- parsedEngineVersion: new Version(537, 3),
937
- engineVersion: '537.3+',
802
+ engineVersion: new Version(537, 3),
938
803
  documentMode: undefined,
939
804
  browserInfo: {
940
805
  hasWebFontSupport: true,
@@ -948,14 +813,11 @@ describe('UserAgentParser', function () {
948
813
  expect(parse('Mozilla/5.0 (BlackBerry; U; BlackBerry 9900; en) AppleWebKit/534.11+ (KHTML, like Gecko) Version/7.1.0.346 Mobile Safari/534.11+'))
949
814
  .toMatchUserAgent({
950
815
  name: 'BuiltinBrowser',
951
- parsedVersion: new Version(),
952
- version: 'Unknown',
816
+ version: new Version(),
953
817
  platform: 'BlackBerry',
954
- parsedPlatformVersion: new Version(7, 1, 0, 346),
955
- platformVersion: '7.1.0.346',
818
+ platformVersion: new Version(7, 1, 0, 346),
956
819
  engine: 'AppleWebKit',
957
- parsedEngineVersion: new Version(534, 11),
958
- engineVersion: '534.11+',
820
+ engineVersion: new Version(534, 11),
959
821
  documentMode: undefined,
960
822
  browserInfo: {
961
823
  hasWebFontSupport: false,
@@ -969,14 +831,11 @@ describe('UserAgentParser', function () {
969
831
  expect(parse('Mozilla/5.0 (PlayStation 4 1.70) AppleWebKit/536.26 (KHTML, like Gecko)'))
970
832
  .toMatchUserAgent({
971
833
  name: 'BuiltinBrowser',
972
- parsedVersion: new Version(),
973
- version: 'Unknown',
834
+ version: new Version(),
974
835
  platform: 'Linux',
975
- parsedPlatformVersion: new Version(),
976
- platformVersion: 'Unknown',
836
+ platformVersion: new Version(),
977
837
  engine: 'AppleWebKit',
978
- parsedEngineVersion: new Version(536, 26),
979
- engineVersion: '536.26',
838
+ engineVersion: new Version(536, 26),
980
839
  documentMode: undefined,
981
840
  browserInfo: {
982
841
  hasWebFontSupport: true,
@@ -992,14 +851,11 @@ describe('UserAgentParser', function () {
992
851
  expect(parse('Mozilla/5.0 (Linux; U; Android 4.0.3; en-us; KFOT Build/IML74K) AppleWebKit/535.19 (KHTML, like Gecko) Silk/2.6 Mobile Safari/535.19 Silk-Accelerated=false'))
993
852
  .toMatchUserAgent({
994
853
  name: 'Silk',
995
- parsedVersion: new Version(2, 6),
996
- version: '2.6',
854
+ version: new Version(2, 6),
997
855
  platform: 'Android',
998
- parsedPlatformVersion: new Version(4, 0, 3),
999
- platformVersion: '4.0.3',
856
+ platformVersion: new Version(4, 0, 3),
1000
857
  engine: 'AppleWebKit',
1001
- parsedEngineVersion: new Version(535, 19),
1002
- engineVersion: '535.19',
858
+ engineVersion: new Version(535, 19),
1003
859
  documentMode: undefined,
1004
860
  browserInfo: {
1005
861
  hasWebFontSupport: true,
@@ -1013,14 +869,11 @@ describe('UserAgentParser', function () {
1013
869
  expect(parse('Mozilla/5.0 (Linux; U; en-us; KFOT Build/IML74K) AppleWebKit/535.19 (KHTML, like Gecko) Silk/2.6 Safari/535.19 Silk-Accelerated=false'))
1014
870
  .toMatchUserAgent({
1015
871
  name: 'Silk',
1016
- parsedVersion: new Version(2, 6),
1017
- version: '2.6',
872
+ version: new Version(2, 6),
1018
873
  platform: 'Linux',
1019
- parsedPlatformVersion: new Version(),
1020
- platformVersion: 'Unknown',
874
+ platformVersion: new Version(),
1021
875
  engine: 'AppleWebKit',
1022
- parsedEngineVersion: new Version(535, 19),
1023
- engineVersion: '535.19',
876
+ engineVersion: new Version(535, 19),
1024
877
  documentMode: undefined,
1025
878
  browserInfo: {
1026
879
  hasWebFontSupport: true,
@@ -1034,14 +887,11 @@ describe('UserAgentParser', function () {
1034
887
  expect(parse('Mozilla/5.0 (Linux; U; Android 4.0.3; en-us; KFTT Build/IML74K) AppleWebKit/535.19 (KHTML, like Gecko) Silk/2.6 Mobile Safari/535.19 Silk-Accelerated=false'))
1035
888
  .toMatchUserAgent({
1036
889
  name: 'Silk',
1037
- parsedVersion: new Version(2, 6),
1038
- version: '2.6',
890
+ version: new Version(2, 6),
1039
891
  platform: 'Android',
1040
- parsedPlatformVersion: new Version(4, 0, 3),
1041
- platformVersion: '4.0.3',
892
+ platformVersion: new Version(4, 0, 3),
1042
893
  engine: 'AppleWebKit',
1043
- parsedEngineVersion: new Version(535, 19),
1044
- engineVersion: '535.19',
894
+ engineVersion: new Version(535, 19),
1045
895
  documentMode: undefined,
1046
896
  browserInfo: {
1047
897
  hasWebFontSupport: true,
@@ -1055,14 +905,11 @@ describe('UserAgentParser', function () {
1055
905
  expect(parse('Mozilla/5.0 (Linux; U; en-us; KFTT Build/IML74K) AppleWebKit/535.19 (KHTML, like Gecko) Silk/2.6 Safari/535.19 Silk-Accelerated=false'))
1056
906
  .toMatchUserAgent({
1057
907
  name: 'Silk',
1058
- parsedVersion: new Version(2, 6),
1059
- version: '2.6',
908
+ version: new Version(2, 6),
1060
909
  platform: 'Linux',
1061
- parsedPlatformVersion: new Version(),
1062
- platformVersion: 'Unknown',
910
+ platformVersion: new Version(),
1063
911
  engine: 'AppleWebKit',
1064
- parsedEngineVersion: new Version(535, 19),
1065
- engineVersion: '535.19',
912
+ engineVersion: new Version(535, 19),
1066
913
  documentMode: undefined,
1067
914
  browserInfo: {
1068
915
  hasWebFontSupport: true,
@@ -1076,14 +923,11 @@ describe('UserAgentParser', function () {
1076
923
  expect(parse('Mozilla/5.0 (Linux; U; Android 4.0.3; en-us; KFJWI Build/IML74K) AppleWebKit/535.19 (KHTML, like Gecko) Silk/2.6 Mobile Safari/535.19 Silk-Accelerated=false'))
1077
924
  .toMatchUserAgent({
1078
925
  name: 'Silk',
1079
- parsedVersion: new Version(2, 6),
1080
- version: '2.6',
926
+ version: new Version(2, 6),
1081
927
  platform: 'Android',
1082
- parsedPlatformVersion: new Version(4, 0, 3),
1083
- platformVersion: '4.0.3',
928
+ platformVersion: new Version(4, 0, 3),
1084
929
  engine: 'AppleWebKit',
1085
- parsedEngineVersion: new Version(535, 19),
1086
- engineVersion: '535.19',
930
+ engineVersion: new Version(535, 19),
1087
931
  documentMode: undefined,
1088
932
  browserInfo: {
1089
933
  hasWebFontSupport: true,
@@ -1097,14 +941,11 @@ describe('UserAgentParser', function () {
1097
941
  expect(parse('Mozilla/5.0 (Linux; U; en-us; KFJWI Build/IML74K) AppleWebKit/535.19 (KHTML, like Gecko) Silk/2.6 Safari/535.19 Silk-Accelerated=false'))
1098
942
  .toMatchUserAgent({
1099
943
  name: 'Silk',
1100
- parsedVersion: new Version(2, 6),
1101
- version: '2.6',
944
+ version: new Version(2, 6),
1102
945
  platform: 'Linux',
1103
- parsedPlatformVersion: new Version(),
1104
- platformVersion: 'Unknown',
946
+ platformVersion: new Version(),
1105
947
  engine: 'AppleWebKit',
1106
- parsedEngineVersion: new Version(535, 19),
1107
- engineVersion: '535.19',
948
+ engineVersion: new Version(535, 19),
1108
949
  documentMode: undefined,
1109
950
  browserInfo: {
1110
951
  hasWebFontSupport: true,
@@ -1118,14 +959,11 @@ describe('UserAgentParser', function () {
1118
959
  expect(parse('Mozilla/5.0 (Linux; U; Android 4.0.3; en-us; KFJWA Build/IML74K) AppleWebKit/535.19 (KHTML, like Gecko) Silk/2.6 Mobile Safari/535.19 Silk-Accelerated=false'))
1119
960
  .toMatchUserAgent({
1120
961
  name: 'Silk',
1121
- parsedVersion: new Version(2, 6),
1122
- version: '2.6',
962
+ version: new Version(2, 6),
1123
963
  platform: 'Android',
1124
- parsedPlatformVersion: new Version(4, 0, 3),
1125
- platformVersion: '4.0.3',
964
+ platformVersion: new Version(4, 0, 3),
1126
965
  engine: 'AppleWebKit',
1127
- parsedEngineVersion: new Version(535, 19),
1128
- engineVersion: '535.19',
966
+ engineVersion: new Version(535, 19),
1129
967
  documentMode: undefined,
1130
968
  browserInfo: {
1131
969
  hasWebFontSupport: true,
@@ -1139,14 +977,11 @@ describe('UserAgentParser', function () {
1139
977
  expect(parse('Mozilla/5.0 (Linux; U; en-us; KFJWA Build/IML74K) AppleWebKit/535.19 (KHTML, like Gecko) Silk/2.6 Safari/535.19 Silk-Accelerated=false'))
1140
978
  .toMatchUserAgent({
1141
979
  name: 'Silk',
1142
- parsedVersion: new Version(2, 6),
1143
- version: '2.6',
980
+ version: new Version(2, 6),
1144
981
  platform: 'Linux',
1145
- parsedPlatformVersion: new Version(),
1146
- platformVersion: 'Unknown',
982
+ platformVersion: new Version(),
1147
983
  engine: 'AppleWebKit',
1148
- parsedEngineVersion: new Version(535, 19),
1149
- engineVersion: '535.19',
984
+ engineVersion: new Version(535, 19),
1150
985
  documentMode: undefined,
1151
986
  browserInfo: {
1152
987
  hasWebFontSupport: true,
@@ -1160,14 +995,11 @@ describe('UserAgentParser', function () {
1160
995
  expect(parse('Mozilla/5.0 (Linux; U; Android 2.3.4; en-us; Silk/1.0.22.79_10013310) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1 Silk-Accelerated=false'))
1161
996
  .toMatchUserAgent({
1162
997
  name: 'Silk',
1163
- parsedVersion: new Version(1, 0, 22, '79_10013310'),
1164
- version: '1.0.22.79_10013310',
998
+ version: new Version(1, 0, 22, '79_10013310'),
1165
999
  platform: 'Android',
1166
- parsedPlatformVersion: new Version(2, 3, 4),
1167
- platformVersion: '2.3.4',
1000
+ platformVersion: new Version(2, 3, 4),
1168
1001
  engine: 'AppleWebKit',
1169
- parsedEngineVersion: new Version(533, 1),
1170
- engineVersion: '533.1',
1002
+ engineVersion: new Version(533, 1),
1171
1003
  documentMode: undefined,
1172
1004
  browserInfo: {
1173
1005
  hasWebFontSupport: true,
@@ -1181,14 +1013,11 @@ describe('UserAgentParser', function () {
1181
1013
  expect(parse('Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us; Silk/1.0.22.79_10013310) AppleWebKit/533.16 (KHTML, like Gecko) Version/5.0 Safari/533.16 Silk-Accelerated=false'))
1182
1014
  .toMatchUserAgent({
1183
1015
  name: 'Silk',
1184
- parsedVersion: new Version(1, 0, 22, '79_10013310'),
1185
- version: '1.0.22.79_10013310',
1016
+ version: new Version(1, 0, 22, '79_10013310'),
1186
1017
  platform: 'Macintosh',
1187
- parsedPlatformVersion: new Version(10, 6, 3),
1188
- platformVersion: '10_6_3',
1018
+ platformVersion: new Version(10, 6, 3),
1189
1019
  engine: 'AppleWebKit',
1190
- parsedEngineVersion: new Version(533, 16),
1191
- engineVersion: '533.16',
1020
+ engineVersion: new Version(533, 16),
1192
1021
  documentMode: undefined,
1193
1022
  browserInfo: {
1194
1023
  hasWebFontSupport: true,
@@ -1204,14 +1033,11 @@ describe('UserAgentParser', function () {
1204
1033
  expect(parse('Opera/9.80 (Linux i686; U; en) Presto/2.5.22 Version/10.51'))
1205
1034
  .toMatchUserAgent({
1206
1035
  name: 'Opera',
1207
- parsedVersion: new Version(10, 51),
1208
- version: '10.51',
1036
+ version: new Version(10, 51),
1209
1037
  platform: 'Linux',
1210
- parsedPlatformVersion: new Version(), //'i686'
1211
- platformVersion: 'Unknown',
1038
+ platformVersion: new Version(), //'i686'
1212
1039
  engine: 'Presto',
1213
- parsedEngineVersion: new Version(2, 5, 22),
1214
- engineVersion: '2.5.22',
1040
+ engineVersion: new Version(2, 5, 22),
1215
1041
  documentMode: undefined,
1216
1042
  browserInfo: {
1217
1043
  hasWebFontSupport: true,
@@ -1225,14 +1051,11 @@ describe('UserAgentParser', function () {
1225
1051
  expect(parse('Mozilla/5.0 (Linux i686 ; U; en; rv:1.8.1) Gecko/20061208 Firefox/2.0.0 Opera 9.70'))
1226
1052
  .toMatchUserAgent({
1227
1053
  name: 'Opera',
1228
- parsedVersion: new Version(9, 70),
1229
- version: '9.70',
1054
+ version: new Version(9, 70),
1230
1055
  platform: 'Linux',
1231
- parsedPlatformVersion: new Version(), //'i686'
1232
- platformVersion: 'Unknown',
1056
+ platformVersion: new Version(), //'i686'
1233
1057
  engine: 'Gecko',
1234
- parsedEngineVersion: new Version(1, 8, 1),
1235
- engineVersion: '1.8.1',
1058
+ engineVersion: new Version(1, 8, 1),
1236
1059
  documentMode: undefined,
1237
1060
  browserInfo: {
1238
1061
  hasWebFontSupport: false,
@@ -1246,14 +1069,11 @@ describe('UserAgentParser', function () {
1246
1069
  expect(parse('Opera/9.64 (X11; Linux i686; U; Linux Mint; nb) Presto/2.1.1'))
1247
1070
  .toMatchUserAgent({
1248
1071
  name: 'Opera',
1249
- parsedVersion: new Version(9, 64),
1250
- version: '9.64',
1072
+ version: new Version(9, 64),
1251
1073
  platform: 'Linux',
1252
- parsedPlatformVersion: new Version(), //'i686'
1253
- platformVersion: 'Unknown',
1074
+ platformVersion: new Version(), //'i686'
1254
1075
  engine: 'Presto',
1255
- parsedEngineVersion: new Version(2, 1, 1),
1256
- engineVersion: '2.1.1',
1076
+ engineVersion: new Version(2, 1, 1),
1257
1077
  documentMode: undefined,
1258
1078
  browserInfo: {
1259
1079
  hasWebFontSupport: false,
@@ -1267,14 +1087,11 @@ describe('UserAgentParser', function () {
1267
1087
  expect(parse('Opera/9.80 (Android 4.1.1; Linux; Opera Mobi/ADR-1207201819; U; en) Presto/2.10.254 Version/12.00'))
1268
1088
  .toMatchUserAgent({
1269
1089
  name: 'Opera',
1270
- parsedVersion: new Version(12, 0),
1271
- version: '12.00',
1090
+ version: new Version(12, 0),
1272
1091
  platform: 'Android',
1273
- parsedPlatformVersion: new Version(4, 1, 1),
1274
- platformVersion: '4.1.1',
1092
+ platformVersion: new Version(4, 1, 1),
1275
1093
  engine: 'Presto',
1276
- parsedEngineVersion: new Version(2, 10, 254),
1277
- engineVersion: '2.10.254',
1094
+ engineVersion: new Version(2, 10, 254),
1278
1095
  documentMode: undefined,
1279
1096
  browserInfo: {
1280
1097
  hasWebFontSupport: true,
@@ -1288,14 +1105,11 @@ describe('UserAgentParser', function () {
1288
1105
  expect(parse('Opera/9.80 (Android; Opera Mini/7.0.29952/28.2144; U; en) Presto/2.8.119 Version/11.10'))
1289
1106
  .toMatchUserAgent({
1290
1107
  name: 'OperaMini',
1291
- parsedVersion: new Version(7, 0, 29952),
1292
- version: '7.0.29952',
1108
+ version: new Version(7, 0, 29952),
1293
1109
  platform: 'Android',
1294
- parsedPlatformVersion: new Version(),
1295
- platformVersion: 'Unknown',
1110
+ platformVersion: new Version(),
1296
1111
  engine: 'Presto',
1297
- parsedEngineVersion: new Version(2, 8, 119),
1298
- engineVersion: '2.8.119',
1112
+ engineVersion: new Version(2, 8, 119),
1299
1113
  documentMode: undefined,
1300
1114
  browserInfo: {
1301
1115
  hasWebFontSupport: false,
@@ -1309,14 +1123,11 @@ describe('UserAgentParser', function () {
1309
1123
  expect(parse('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.20 Safari/537.36 OPR/15.0.1147.18 (Edition Next)'))
1310
1124
  .toMatchUserAgent({
1311
1125
  name: 'Opera',
1312
- parsedVersion: new Version(15, 0, 1147, 18),
1313
- version: '15.0.1147.18',
1126
+ version: new Version(15, 0, 1147, 18),
1314
1127
  platform: 'Macintosh',
1315
- parsedPlatformVersion: new Version(10, 8, 3),
1316
- platformVersion: '10_8_3',
1128
+ platformVersion: new Version(10, 8, 3),
1317
1129
  engine: 'AppleWebKit',
1318
- parsedEngineVersion: new Version(537, 36),
1319
- engineVersion: '537.36',
1130
+ engineVersion: new Version(537, 36),
1320
1131
  documentMode: undefined,
1321
1132
  browserInfo: {
1322
1133
  hasWebFontSupport: true,
@@ -1332,14 +1143,11 @@ describe('UserAgentParser', function () {
1332
1143
  expect(parse('Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.9 Safari/536.5'))
1333
1144
  .toMatchUserAgent({
1334
1145
  name: 'Chrome',
1335
- parsedVersion: new Version(19, 0, 1084, 9),
1336
- version: '19.0.1084.9',
1146
+ version: new Version(19, 0, 1084, 9),
1337
1147
  platform: 'Linux',
1338
- parsedPlatformVersion: new Version(),
1339
- platformVersion: 'Unknown',
1148
+ platformVersion: new Version(),
1340
1149
  engine: 'AppleWebKit',
1341
- parsedEngineVersion: new Version(536, 5),
1342
- engineVersion: '536.5',
1150
+ engineVersion: new Version(536, 5),
1343
1151
  documentMode: undefined,
1344
1152
  browserInfo: {
1345
1153
  hasWebFontSupport: true,
@@ -1353,14 +1161,11 @@ describe('UserAgentParser', function () {
1353
1161
  expect(parse('Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.814.2 Safari/536.11'))
1354
1162
  .toMatchUserAgent({
1355
1163
  name: 'Chrome',
1356
- parsedVersion: new Version(20, 0, 814, 2),
1357
- version: '20.0.814.2',
1164
+ version: new Version(20, 0, 814, 2),
1358
1165
  platform: 'Linux',
1359
- parsedPlatformVersion: new Version(),
1360
- platformVersion: 'Unknown',
1166
+ platformVersion: new Version(),
1361
1167
  engine: 'AppleWebKit',
1362
- parsedEngineVersion: new Version(536, 11),
1363
- engineVersion: '536.11',
1168
+ engineVersion: new Version(536, 11),
1364
1169
  documentMode: undefined,
1365
1170
  browserInfo: {
1366
1171
  hasWebFontSupport: true,
@@ -1372,60 +1177,15 @@ describe('UserAgentParser', function () {
1372
1177
  });
1373
1178
 
1374
1179
  describe('Invented user agents', function () {
1375
- it('should detect Gecko as supporting web fonts', function () {
1376
- expect(parse('Mozilla/5.0 (Windows; U; Windows NT 5.1; ru-RU; rv:1.9.1.4) Gecko/20091016 (.NET CLR 3.5.30729)'))
1377
- .toMatchUserAgent({
1378
- name: 'Mozilla',
1379
- parsedVersion: new Version(),
1380
- version: 'Unknown',
1381
- platform: 'Windows',
1382
- parsedPlatformVersion: new Version(5, 1),
1383
- platformVersion: '5.1',
1384
- engine: 'Gecko',
1385
- parsedEngineVersion: new Version(1, 9, 1, 4),
1386
- engineVersion: '1.9.1.4',
1387
- documentMode: undefined,
1388
- browserInfo: {
1389
- hasWebFontSupport: true,
1390
- hasWebKitFallbackBug: false,
1391
- hasWebKitMetricsBug: false
1392
- }
1393
- });
1394
- });
1395
-
1396
- it('should detect unknown parsedVersions of Gecko as supporting web fonts', function () {
1180
+ it('should detect unknown versions of Gecko as supporting web fonts', function () {
1397
1181
  expect(parse('Mozilla/5.0 (Windows; U; Windows NT 5.1; ru-RU; rv:2.5.8) Gecko/20091016 (.NET CLR 3.5.30729)'))
1398
1182
  .toMatchUserAgent({
1399
1183
  name: 'Mozilla',
1400
- parsedVersion: new Version(),
1401
- version: 'Unknown',
1402
- platform: 'Windows',
1403
- parsedPlatformVersion: new Version(5, 1),
1404
- platformVersion: '5.1',
1405
- engine: 'Gecko',
1406
- parsedEngineVersion: new Version(2, 5, 8),
1407
- engineVersion: '2.5.8',
1408
- documentMode: undefined,
1409
- browserInfo: {
1410
- hasWebFontSupport: true,
1411
- hasWebKitFallbackBug: false,
1412
- hasWebKitMetricsBug: false
1413
- }
1414
- });
1415
- });
1416
-
1417
- it('should detect Gecko v1.10 as supporting web fonts', function () {
1418
- expect(parse('Mozilla/5.0 (Windows; U; Windows NT 5.1; ru-RU; rv:1.10.1b) Gecko/20091016 (.NET CLR 3.5.30729)'))
1419
- .toMatchUserAgent({
1420
- name: 'Mozilla',
1421
- parsedVersion: new Version(),
1422
- version: 'Unknown',
1184
+ version: new Version(),
1423
1185
  platform: 'Windows',
1424
- parsedPlatformVersion: new Version(5, 1),
1425
- platformVersion: '5.1',
1186
+ platformVersion: new Version(5, 1),
1426
1187
  engine: 'Gecko',
1427
- parsedEngineVersion: new Version(1, 10, 1, 'b'),
1428
- engineVersion: '1.10.1b',
1188
+ engineVersion: new Version(2, 5, 8),
1429
1189
  documentMode: undefined,
1430
1190
  browserInfo: {
1431
1191
  hasWebFontSupport: true,
@@ -1435,18 +1195,15 @@ describe('UserAgentParser', function () {
1435
1195
  });
1436
1196
  });
1437
1197
 
1438
- it('should detect Gecko with an invalid parsedVersion number as not supporting web fonts', function () {
1198
+ it('should detect Gecko with an invalid version number as not supporting web fonts', function () {
1439
1199
  expect(parse('Mozilla/5.0 (Windows; U; Windows NT 5.1; ru-RU; rv:1.b) Gecko/20091016 (.NET CLR 3.5.30729)'))
1440
1200
  .toMatchUserAgent({
1441
1201
  name: 'Mozilla',
1442
- parsedVersion: new Version(),
1443
- version: 'Unknown',
1202
+ version: new Version(),
1444
1203
  platform: 'Windows',
1445
- parsedPlatformVersion: new Version(5, 1),
1446
- platformVersion: '5.1',
1204
+ platformVersion: new Version(5, 1),
1447
1205
  engine: 'Gecko',
1448
- parsedEngineVersion: new Version(1, null, null, 'b'),
1449
- engineVersion: '1.b',
1206
+ engineVersion: new Version(1, null, null, 'b'),
1450
1207
  documentMode: undefined,
1451
1208
  browserInfo: {
1452
1209
  hasWebFontSupport: false,
@@ -1458,14 +1215,11 @@ describe('UserAgentParser', function () {
1458
1215
  expect(parse('Mozilla/5.0 (Windows; U; Windows NT 5.1; ru-RU; rv:1.b) Gecko/20091016 (.NET CLR 3.5.30729)'))
1459
1216
  .toMatchUserAgent({
1460
1217
  name: 'Mozilla',
1461
- parsedVersion: new Version(),
1462
- version: 'Unknown',
1218
+ version: new Version(),
1463
1219
  platform: 'Windows',
1464
- parsedPlatformVersion: new Version(5, 1),
1465
- platformVersion: '5.1',
1220
+ platformVersion: new Version(5, 1),
1466
1221
  engine: 'Gecko',
1467
- parsedEngineVersion: new Version(1, null, null, 'b'),
1468
- engineVersion: '1.b',
1222
+ engineVersion: new Version(1, null, null, 'b'),
1469
1223
  documentMode: undefined,
1470
1224
  browserInfo: {
1471
1225
  hasWebFontSupport: false,
@@ -1477,14 +1231,11 @@ describe('UserAgentParser', function () {
1477
1231
  expect(parse('Mozilla/5.0 (Windows; U; Windows NT 5.1; ru-RU; rv:1.9) Gecko/20091016 (.NET CLR 3.5.30729)'))
1478
1232
  .toMatchUserAgent({
1479
1233
  name: 'Mozilla',
1480
- parsedVersion: new Version(),
1481
- version: 'Unknown',
1234
+ version: new Version(),
1482
1235
  platform: 'Windows',
1483
- parsedPlatformVersion: new Version(5, 1),
1484
- platformVersion: '5.1',
1236
+ platformVersion: new Version(5, 1),
1485
1237
  engine: 'Gecko',
1486
- parsedEngineVersion: new Version(1, 9),
1487
- engineVersion: '1.9',
1238
+ engineVersion: new Version(1, 9),
1488
1239
  documentMode: undefined,
1489
1240
  browserInfo: {
1490
1241
  hasWebFontSupport: false,
@@ -1496,14 +1247,11 @@ describe('UserAgentParser', function () {
1496
1247
  expect(parse('Mozilla/5.0 (Windows; U; Windows NT 5.1; ru-RU; rv:0.10.1) Gecko/20091016 (.NET CLR 3.5.30729)'))
1497
1248
  .toMatchUserAgent({
1498
1249
  name: 'Mozilla',
1499
- parsedVersion: new Version(),
1500
- version: 'Unknown',
1250
+ version: new Version(),
1501
1251
  platform: 'Windows',
1502
- parsedPlatformVersion: new Version(5, 1),
1503
- platformVersion: '5.1',
1252
+ platformVersion: new Version(5, 1),
1504
1253
  engine: 'Gecko',
1505
- parsedEngineVersion: new Version(0, 10, 1),
1506
- engineVersion: '0.10.1',
1254
+ engineVersion: new Version(0, 10, 1),
1507
1255
  documentMode: undefined,
1508
1256
  browserInfo: {
1509
1257
  hasWebFontSupport: false,
@@ -1515,14 +1263,11 @@ describe('UserAgentParser', function () {
1515
1263
  expect(parse('Mozilla/5.0 (Windows; U; Windows NT 5.1; ru-RU; rv:0.3.42) Gecko/20091016 (.NET CLR 3.5.30729)'))
1516
1264
  .toMatchUserAgent({
1517
1265
  name: 'Mozilla',
1518
- parsedVersion: new Version(),
1519
- version: 'Unknown',
1266
+ version: new Version(),
1520
1267
  platform: 'Windows',
1521
- parsedPlatformVersion: new Version(5, 1),
1522
- platformVersion: '5.1',
1268
+ platformVersion: new Version(5, 1),
1523
1269
  engine: 'Gecko',
1524
- parsedEngineVersion: new Version(0, 3, 42),
1525
- engineVersion: '0.3.42',
1270
+ engineVersion: new Version(0, 3, 42),
1526
1271
  documentMode: undefined,
1527
1272
  browserInfo: {
1528
1273
  hasWebFontSupport: false,
@@ -1538,14 +1283,11 @@ describe('UserAgentParser', function () {
1538
1283
  expect(parse('Mozilla/5.0 (Macintosh; Intel Mac OS X) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.9.0 (development) Safari/534.34'))
1539
1284
  .toMatchUserAgent({
1540
1285
  name: 'PhantomJS',
1541
- parsedVersion: new Version(1, 9, 0),
1542
- version: '1.9.0',
1286
+ version: new Version(1, 9, 0),
1543
1287
  platform: 'Macintosh',
1544
- parsedPlatformVersion: new Version(),
1545
- platformVersion: 'Unknown',
1288
+ platformVersion: new Version(),
1546
1289
  engine: 'AppleWebKit',
1547
- parsedEngineVersion: new Version(534, 34),
1548
- engineVersion: '534.34',
1290
+ engineVersion: new Version(534, 34),
1549
1291
  documentMode: undefined,
1550
1292
  browserInfo: {
1551
1293
  hasWebFontSupport: true,