webfontloader 1.4.2 → 1.4.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,6 @@
1
1
  describe('UserAgentParser', function () {
2
- var UserAgentParser = webfont.UserAgentParser;
2
+ var UserAgentParser = webfont.UserAgentParser,
3
+ Version = webfont.Version;
3
4
 
4
5
  beforeEach(function () {
5
6
  this.addMatchers({
@@ -18,7 +19,7 @@ describe('UserAgentParser', function () {
18
19
  return false;
19
20
  }
20
21
 
21
- if (actual.getVersion() !== expected.version) {
22
+ if (actual.getVersion().ne(expected.version)) {
22
23
  this.message = msg('version', actual.getVersion(), expected.version);
23
24
  return false;
24
25
  }
@@ -28,17 +29,17 @@ describe('UserAgentParser', function () {
28
29
  return false;
29
30
  }
30
31
 
31
- if (actual.getPlatformVersion() !== expected.platformVersion) {
32
+ if (actual.getPlatformVersion().ne(expected.platformVersion)) {
32
33
  this.message = msg('platform version', actual.getPlatformVersion(), expected.platformVersion);
33
34
  return false;
34
35
  }
35
36
 
36
- if (actual.getEngine() !== expected.engine) {
37
+ if (actual.getEngine() !== expected.engine) {
37
38
  this.message = msg('engine', actual.getEngine(), expected.engine);
38
39
  return false;
39
40
  }
40
41
 
41
- if (actual.getEngineVersion() !== expected.engineVersion) {
42
+ if (actual.getEngineVersion().ne(expected.engineVersion)) {
42
43
  this.message = msg('engine version', actual.getEngineVersion(), expected.engineVersion);
43
44
  return false;
44
45
  }
@@ -68,6 +69,26 @@ describe('UserAgentParser', function () {
68
69
  });
69
70
  });
70
71
 
72
+ describe('#getPlatformVersionString_', function () {
73
+ function parsePlatformVersion(str) {
74
+ return new UserAgentParser(str, {}).getPlatformVersionString_();
75
+ }
76
+
77
+ it('should parse Linux versions correctly', function () {
78
+ expect(parsePlatformVersion('(Linux; U; en-us; KFJWI Build/IML74K)')).toEqual('Unknown');
79
+ expect(parsePlatformVersion('(Linux i686; U; en)')).toEqual('Unknown');
80
+ expect(parsePlatformVersion('(X11; Linux i686; U; Linux Mint; nb)')).toEqual('Unknown');
81
+ expect(parsePlatformVersion('(X11; Linux x86_64)')).toEqual('Unknown');
82
+ expect(parsePlatformVersion('(X11; U; en-US; rv:2.0; Linux i686 10.1)')).toEqual('10.1');
83
+ expect(parsePlatformVersion('(X11; Linux i868 10.1; U; en-US; rv:2.0)')).toEqual('10.1');
84
+ expect(parsePlatformVersion('(X11; Linux 10.1; U; en-US)')).toEqual('10.1');
85
+ });
86
+
87
+ it('should parse ChromeOS versions correctly', function () {
88
+ expect(parsePlatformVersion('(X11; CrOS i686 1660.57.0)')).toEqual('1660.57.0');
89
+ });
90
+ });
91
+
71
92
  describe('#parse', function () {
72
93
  function parse(userAgentString, doc) {
73
94
  return new UserAgentParser(userAgentString, doc || {}).parse();
@@ -78,11 +99,11 @@ describe('UserAgentParser', function () {
78
99
  expect(parse('Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en) AppleWebKit/531.9 (KHTML, like Gecko) AdobeAIR/2.5'))
79
100
  .toMatchUserAgent({
80
101
  name: 'AdobeAIR',
81
- version: '2.5',
102
+ version: new Version(2, 5),
82
103
  platform: 'Macintosh',
83
- platformVersion: 'Unknown',
104
+ platformVersion: new Version(),
84
105
  engine: 'AppleWebKit',
85
- engineVersion: '531.9',
106
+ engineVersion: new Version(531, 9),
86
107
  documentMode: undefined,
87
108
  browserInfo: {
88
109
  hasWebFontSupport: true,
@@ -96,11 +117,11 @@ describe('UserAgentParser', function () {
96
117
  expect(parse('Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en) AppleWebKit/531.9 (KHTML, like Gecko) AdobeAIR/2.0'))
97
118
  .toMatchUserAgent({
98
119
  name: 'AdobeAIR',
99
- version: '2.0',
120
+ version: new Version(2, 0),
100
121
  platform: 'Macintosh',
101
- platformVersion: 'Unknown',
122
+ platformVersion: new Version(),
102
123
  engine: 'AppleWebKit',
103
- engineVersion: '531.9',
124
+ engineVersion: new Version(531, 9),
104
125
  documentMode: undefined,
105
126
  browserInfo: {
106
127
  hasWebFontSupport: false,
@@ -116,11 +137,11 @@ describe('UserAgentParser', function () {
116
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'))
117
138
  .toMatchUserAgent({
118
139
  name: 'Firefox',
119
- version: '3.6.3',
140
+ version: new Version(3, 6, 3),
120
141
  platform: 'Macintosh',
121
- platformVersion: '10.5',
142
+ platformVersion: new Version(10, 5),
122
143
  engine: 'Gecko',
123
- engineVersion: '1.9.2.3',
144
+ engineVersion: new Version(1, 9, 2, 3),
124
145
  documentMode: undefined,
125
146
  browserInfo: {
126
147
  hasWebFontSupport: true,
@@ -132,11 +153,11 @@ describe('UserAgentParser', function () {
132
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'))
133
154
  .toMatchUserAgent({
134
155
  name: 'Firefox',
135
- version: '3.6a1pre',
156
+ version: new Version(3, 6, null, 'a1pre'),
136
157
  platform: 'Linux',
137
- platformVersion: 'i686',
158
+ platformVersion: new Version(), //'i686'
138
159
  engine: 'Gecko',
139
- engineVersion: '1.9.2a1pre',
160
+ engineVersion: new Version(1, 9, 2, 'a1pre'),
140
161
  documentMode: undefined,
141
162
  browserInfo: {
142
163
  hasWebFontSupport: true,
@@ -150,11 +171,11 @@ describe('UserAgentParser', function () {
150
171
  expect(parse('Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:2.0b1) Gecko/20100630 Firefox/4.0b1'))
151
172
  .toMatchUserAgent({
152
173
  name: 'Firefox',
153
- version: '4.0b1',
174
+ version: new Version(4, 0, null, 'b1'),
154
175
  platform: 'Macintosh',
155
- platformVersion: '10.6',
176
+ platformVersion: new Version(10, 6),
156
177
  engine: 'Gecko',
157
- engineVersion: '2.0b1',
178
+ engineVersion: new Version(2, 0, 'b1'),
158
179
  documentMode: undefined,
159
180
  browserInfo: {
160
181
  hasWebFontSupport: true,
@@ -170,11 +191,11 @@ describe('UserAgentParser', function () {
170
191
  expect(parse('Mozilla/5.0 (Android; Mobile; rv:13.0) Gecko/15.0 Firefox/14.0'))
171
192
  .toMatchUserAgent({
172
193
  name: 'Firefox',
173
- version: '14.0',
194
+ version: new Version(14, 0),
174
195
  platform: 'Android',
175
- platformVersion: 'Unknown',
196
+ platformVersion: new Version(),
176
197
  engine: 'Gecko',
177
- engineVersion: '13.0',
198
+ engineVersion: new Version(13, 0),
178
199
  documentMode: undefined,
179
200
  browserInfo: {
180
201
  hasWebFontSupport: true,
@@ -188,11 +209,11 @@ describe('UserAgentParser', function () {
188
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)'))
189
210
  .toMatchUserAgent({
190
211
  name: 'Firefox',
191
- version: 'Unknown',
212
+ version: new Version(),
192
213
  platform: 'Linux',
193
- platformVersion: 'i686',
214
+ platformVersion: new Version(), //'i686'
194
215
  engine: 'Gecko',
195
- engineVersion: '1.8.1.19',
216
+ engineVersion: new Version(1, 8, 1, 19),
196
217
  documentMode: undefined,
197
218
  browserInfo: {
198
219
  hasWebFontSupport: false,
@@ -208,11 +229,11 @@ describe('UserAgentParser', function () {
208
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'))
209
230
  .toMatchUserAgent({
210
231
  name: 'Chrome',
211
- version: '5.0.342.9',
232
+ version: new Version(5, 0, 342, 9),
212
233
  platform: 'Macintosh',
213
- platformVersion: '10_5_8',
234
+ platformVersion: new Version(10, 5, 8),
214
235
  engine: 'AppleWebKit',
215
- engineVersion: '533.2',
236
+ engineVersion: new Version(533, 2),
216
237
  documentMode: undefined,
217
238
  browserInfo: {
218
239
  hasWebFontSupport: true,
@@ -226,11 +247,11 @@ describe('UserAgentParser', function () {
226
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'))
227
248
  .toMatchUserAgent({
228
249
  name: 'Chrome',
229
- version: '18.0.1025.46',
250
+ version: new Version(18, 0, 1025, 46),
230
251
  platform: 'CrOS',
231
- platformVersion: 'i686 1660.57.0',
252
+ platformVersion: new Version(1660, 57, 0),
232
253
  engine: 'AppleWebKit',
233
- engineVersion: '535.19',
254
+ engineVersion: new Version(535, 19),
234
255
  documentMode: undefined,
235
256
  browserInfo: {
236
257
  hasWebFontSupport: true,
@@ -244,11 +265,11 @@ describe('UserAgentParser', function () {
244
265
  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'))
245
266
  .toMatchUserAgent({
246
267
  name: 'Chrome',
247
- version: '16.0.912.75',
268
+ version: new Version(16, 0, 912, 75),
248
269
  platform: 'Android',
249
- platformVersion: '4.0.3',
270
+ platformVersion: new Version(4, 0, 3),
250
271
  engine: 'AppleWebKit',
251
- engineVersion: '535.7',
272
+ engineVersion: new Version(535, 7),
252
273
  documentMode: undefined,
253
274
  browserInfo: {
254
275
  hasWebFontSupport: true,
@@ -262,11 +283,11 @@ describe('UserAgentParser', function () {
262
283
  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'))
263
284
  .toMatchUserAgent({
264
285
  name: 'Chrome',
265
- version: '19.0.1084.60',
286
+ version: new Version(19, 0, 1084, 60),
266
287
  platform: 'iPad',
267
- platformVersion: '5_1_1',
288
+ platformVersion: new Version(5, 1, 1),
268
289
  engine: 'AppleWebKit',
269
- engineVersion: '534.46.0',
290
+ engineVersion: new Version(534, 46, 0),
270
291
  documentMode: undefined,
271
292
  browserInfo: {
272
293
  hasWebFontSupport: true,
@@ -280,11 +301,11 @@ describe('UserAgentParser', function () {
280
301
  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'))
281
302
  .toMatchUserAgent({
282
303
  name: 'Chrome',
283
- version: '19.0.1084.60',
304
+ version: new Version(19, 0, 1084, 60),
284
305
  platform: 'iPod',
285
- platformVersion: '5_1_1',
306
+ platformVersion: new Version(5, 1, 1),
286
307
  engine: 'AppleWebKit',
287
- engineVersion: '534.46.0',
308
+ engineVersion: new Version(534, 46, 0),
288
309
  documentMode: undefined,
289
310
  browserInfo: {
290
311
  hasWebFontSupport: true,
@@ -300,11 +321,11 @@ describe('UserAgentParser', function () {
300
321
  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'))
301
322
  .toMatchUserAgent({
302
323
  name: 'Safari',
303
- version: '4.0.4',
324
+ version: new Version(4, 0, 4),
304
325
  platform: 'Macintosh',
305
- platformVersion: '10_5_8',
326
+ platformVersion: new Version(10, 5, 8),
306
327
  engine: 'AppleWebKit',
307
- engineVersion: '531.21.8',
328
+ engineVersion: new Version(531, 21, 8),
308
329
  documentMode: undefined,
309
330
  browserInfo: {
310
331
  hasWebFontSupport: true,
@@ -316,11 +337,11 @@ describe('UserAgentParser', function () {
316
337
  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'))
317
338
  .toMatchUserAgent({
318
339
  name: 'Safari',
319
- version: '4.0dp1',
340
+ version: new Version(4, 0, null, 'dp1'),
320
341
  platform: 'Macintosh',
321
- platformVersion: '10_4_11',
342
+ platformVersion: new Version(10, 4, 11),
322
343
  engine: 'AppleWebKit',
323
- engineVersion: '528.4+',
344
+ engineVersion: new Version(528, 4),
324
345
  documentMode: undefined,
325
346
  browserInfo: {
326
347
  hasWebFontSupport: true,
@@ -334,11 +355,11 @@ describe('UserAgentParser', function () {
334
355
  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'))
335
356
  .toMatchUserAgent({
336
357
  name: 'Safari',
337
- version: '4.0',
358
+ version: new Version(4, 0),
338
359
  platform: 'iPhone',
339
- platformVersion: '3_1_2',
360
+ platformVersion: new Version(3, 1, 2),
340
361
  engine: 'AppleWebKit',
341
- engineVersion: '528.18',
362
+ engineVersion: new Version(528, 18),
342
363
  documentMode: undefined,
343
364
  browserInfo: {
344
365
  hasWebFontSupport: true,
@@ -352,11 +373,11 @@ describe('UserAgentParser', function () {
352
373
  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'))
353
374
  .toMatchUserAgent({
354
375
  name: 'Safari',
355
- version: '4.0.4',
376
+ version: new Version(4, 0, 4),
356
377
  platform: 'iPad',
357
- platformVersion: '3_2',
378
+ platformVersion: new Version(3, 2),
358
379
  engine: 'AppleWebKit',
359
- engineVersion: '531.21.10',
380
+ engineVersion: new Version(531, 21, 10),
360
381
  documentMode: undefined,
361
382
  browserInfo: {
362
383
  hasWebFontSupport: true,
@@ -368,11 +389,11 @@ describe('UserAgentParser', function () {
368
389
  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"'))
369
390
  .toMatchUserAgent({
370
391
  name: 'Safari',
371
- version: '4.0.4',
392
+ version: new Version(4, 0, 4),
372
393
  platform: 'iPad',
373
- platformVersion: '3_2',
394
+ platformVersion: new Version(3, 2),
374
395
  engine: 'AppleWebKit',
375
- engineVersion: '531.21.10',
396
+ engineVersion: new Version(531, 21, 10),
376
397
  documentMode: undefined,
377
398
  browserInfo: {
378
399
  hasWebFontSupport: true,
@@ -384,11 +405,11 @@ describe('UserAgentParser', function () {
384
405
  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'))
385
406
  .toMatchUserAgent({
386
407
  name: 'Safari',
387
- version: '4.0.4',
408
+ version: new Version(4, 0, 4),
388
409
  platform: 'iPad',
389
- platformVersion: '3_2',
410
+ platformVersion: new Version(3, 2),
390
411
  engine: 'AppleWebKit',
391
- engineVersion: '531.21.10',
412
+ engineVersion: new Version(531, 21, 10),
392
413
  documentMode: undefined,
393
414
  browserInfo: {
394
415
  hasWebFontSupport: true,
@@ -402,11 +423,11 @@ describe('UserAgentParser', function () {
402
423
  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'))
403
424
  .toMatchUserAgent({
404
425
  name: 'Unknown',
405
- version: 'Unknown',
426
+ version: new Version(),
406
427
  platform: 'iPod',
407
- platformVersion: '2_2_1',
428
+ platformVersion: new Version(2, 2, 1),
408
429
  engine: 'AppleWebKit',
409
- engineVersion: '525.18.1',
430
+ engineVersion: new Version(525, 18, 1),
410
431
  documentMode: undefined,
411
432
  browserInfo: {
412
433
  hasWebFontSupport: true,
@@ -418,11 +439,11 @@ describe('UserAgentParser', function () {
418
439
  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'))
419
440
  .toMatchUserAgent({
420
441
  name: 'Safari',
421
- version: '4.0',
442
+ version: new Version(4, 0),
422
443
  platform: 'iPod',
423
- platformVersion: '3_1',
444
+ platformVersion: new Version(3, 1),
424
445
  engine: 'AppleWebKit',
425
- engineVersion: '528.18',
446
+ engineVersion: new Version(528, 18),
426
447
  documentMode: undefined,
427
448
  browserInfo: {
428
449
  hasWebFontSupport: true,
@@ -438,11 +459,11 @@ describe('UserAgentParser', function () {
438
459
  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)'))
439
460
  .toMatchUserAgent({
440
461
  name: 'MSIE',
441
- version: '7.0',
462
+ version: new Version(7, 0),
442
463
  platform: 'Windows',
443
- platformVersion: '5.1',
464
+ platformVersion: new Version(5, 1),
444
465
  engine: 'MSIE',
445
- engineVersion: '7.0',
466
+ engineVersion: new Version(7, 0),
446
467
  documentMode: undefined,
447
468
  browserInfo: {
448
469
  hasWebFontSupport: true,
@@ -454,11 +475,11 @@ describe('UserAgentParser', function () {
454
475
  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)'))
455
476
  .toMatchUserAgent({
456
477
  name: 'MSIE',
457
- version: '7.0b',
478
+ version: new Version(7, 0, null, 'b'),
458
479
  platform: 'Windows',
459
- platformVersion: '5.1',
480
+ platformVersion: new Version(5, 1),
460
481
  engine: 'MSIE',
461
- engineVersion: '7.0b',
482
+ engineVersion: new Version(7, 0, null, 'b'),
462
483
  documentMode: undefined,
463
484
  browserInfo: {
464
485
  hasWebFontSupport: true,
@@ -472,11 +493,11 @@ describe('UserAgentParser', function () {
472
493
  expect(parse('Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)'))
473
494
  .toMatchUserAgent({
474
495
  name: 'MSIE',
475
- version: '7.0',
496
+ version: new Version(7, 0),
476
497
  platform: 'Windows',
477
- platformVersion: '5.1',
498
+ platformVersion: new Version(5, 1),
478
499
  engine: 'MSIE',
479
- engineVersion: '7.0',
500
+ engineVersion: new Version(7, 0),
480
501
  documentMode: undefined,
481
502
  browserInfo: {
482
503
  hasWebFontSupport: true,
@@ -490,11 +511,11 @@ describe('UserAgentParser', function () {
490
511
  expect(parse('Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; ARM; Touch; IEMobile/10.0; <Manufacturer>; <Device>; <Operator>)'))
491
512
  .toMatchUserAgent({
492
513
  name: 'MSIE',
493
- version: '10.0',
514
+ version: new Version(10, 0),
494
515
  platform: 'Windows Phone',
495
- platformVersion: '8.0',
516
+ platformVersion: new Version(8, 0),
496
517
  engine: 'MSIE',
497
- engineVersion: '10.0',
518
+ engineVersion: new Version(10, 0),
498
519
  documentMode: undefined,
499
520
  browserInfo: {
500
521
  hasWebFontSupport: true,
@@ -508,11 +529,11 @@ describe('UserAgentParser', function () {
508
529
  expect(parse('Mozilla/5.0 (compatible; MSIE 9.0; Windows Phone OS 7.5; Trident/5.0; IEMobile/9.0; SAMSUNG; SGH-i917)'))
509
530
  .toMatchUserAgent({
510
531
  name: 'MSIE',
511
- version: '9.0',
532
+ version: new Version(9, 0),
512
533
  platform: 'Windows Phone',
513
- platformVersion: '7.5',
534
+ platformVersion: new Version(7, 5),
514
535
  engine: 'MSIE',
515
- engineVersion: '9.0',
536
+ engineVersion: new Version(9, 0),
516
537
  documentMode: undefined,
517
538
  browserInfo: {
518
539
  hasWebFontSupport: false,
@@ -526,11 +547,11 @@ describe('UserAgentParser', function () {
526
547
  expect(parse('Mozilla/4.0 (compatible; MSIE 5.23; Mac_PowerPC)'))
527
548
  .toMatchUserAgent({
528
549
  name: 'MSIE',
529
- version: '5.23',
550
+ version: new Version(5, 23),
530
551
  platform: 'Macintosh',
531
- platformVersion: 'Unknown',
552
+ platformVersion: new Version(),
532
553
  engine: 'MSIE',
533
- engineVersion: '5.23',
554
+ engineVersion: new Version(5, 23),
534
555
  documentMode: undefined,
535
556
  browserInfo: {
536
557
  hasWebFontSupport: false,
@@ -544,11 +565,11 @@ describe('UserAgentParser', function () {
544
565
  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 }))
545
566
  .toMatchUserAgent({
546
567
  name: 'MSIE',
547
- version: '8.0',
568
+ version: new Version(8, 0),
548
569
  platform: 'Windows',
549
- platformVersion: '6.1',
570
+ platformVersion: new Version(6, 1),
550
571
  engine: 'MSIE',
551
- engineVersion: '8.0',
572
+ engineVersion: new Version(8, 0),
552
573
  documentMode: 8,
553
574
  browserInfo: {
554
575
  hasWebFontSupport: true,
@@ -564,11 +585,11 @@ describe('UserAgentParser', function () {
564
585
  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'))
565
586
  .toMatchUserAgent({
566
587
  name: 'BuiltinBrowser',
567
- version: 'Unknown',
588
+ version: new Version(),
568
589
  platform: 'Android',
569
- platformVersion: '2.2.1',
590
+ platformVersion: new Version(2, 2, 1),
570
591
  engine: 'AppleWebKit',
571
- engineVersion: '533.1',
592
+ engineVersion: new Version(533, 1),
572
593
  documentMode: undefined,
573
594
  browserInfo: {
574
595
  hasWebFontSupport: true,
@@ -582,11 +603,11 @@ describe('UserAgentParser', function () {
582
603
  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'))
583
604
  .toMatchUserAgent({
584
605
  name: 'BuiltinBrowser',
585
- version: 'Unknown',
606
+ version: new Version(),
586
607
  platform: 'Android',
587
- platformVersion: '2.1-update1',
608
+ platformVersion: new Version(2, 1, null, 'update1'),
588
609
  engine: 'AppleWebKit',
589
- engineVersion: '530.17',
610
+ engineVersion: new Version(530, 17),
590
611
  documentMode: undefined,
591
612
  browserInfo: {
592
613
  hasWebFontSupport: false,
@@ -600,11 +621,11 @@ describe('UserAgentParser', function () {
600
621
  expect(parse('Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.34 Safari/534.24'))
601
622
  .toMatchUserAgent({
602
623
  name: 'Chrome',
603
- version: '11.0.696.34',
624
+ version: new Version(11, 0, 696, 34),
604
625
  platform: 'Linux',
605
- platformVersion: 'Unknown',
626
+ platformVersion: new Version(),
606
627
  engine: 'AppleWebKit',
607
- engineVersion: '534.24',
628
+ engineVersion: new Version(534, 24),
608
629
  documentMode: undefined,
609
630
  browserInfo: {
610
631
  hasWebFontSupport: true,
@@ -618,11 +639,11 @@ describe('UserAgentParser', function () {
618
639
  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'))
619
640
  .toMatchUserAgent({
620
641
  name: 'BuiltinBrowser',
621
- version: 'Unknown',
642
+ version: new Version(),
622
643
  platform: 'Android',
623
- platformVersion: '4.1.2',
644
+ platformVersion: new Version(4, 1, 2),
624
645
  engine: 'AppleWebKit',
625
- engineVersion: '534.30',
646
+ engineVersion: new Version(534, 30),
626
647
  documentMode: undefined,
627
648
  browserInfo: {
628
649
  hasWebFontSupport: true,
@@ -636,11 +657,11 @@ describe('UserAgentParser', function () {
636
657
  expect(parse('Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.34 Safari/534.24'))
637
658
  .toMatchUserAgent({
638
659
  name: 'Chrome',
639
- version: '11.0.696.34',
660
+ version: new Version(11, 0, 696, 34),
640
661
  platform: 'Linux',
641
- platformVersion: 'Unknown',
662
+ platformVersion: new Version(),
642
663
  engine: 'AppleWebKit',
643
- engineVersion: '534.24',
664
+ engineVersion: new Version(534, 24),
644
665
  documentMode: undefined,
645
666
  browserInfo: {
646
667
  hasWebFontSupport: true,
@@ -654,11 +675,11 @@ describe('UserAgentParser', function () {
654
675
  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'))
655
676
  .toMatchUserAgent({
656
677
  name: 'BuiltinBrowser',
657
- version: 'Unknown',
678
+ version: new Version(),
658
679
  platform: 'Android',
659
- platformVersion: '4.1.2',
680
+ platformVersion: new Version(4, 1, 2),
660
681
  engine: 'AppleWebKit',
661
- engineVersion: '534.30',
682
+ engineVersion: new Version(534, 30),
662
683
  documentMode: undefined,
663
684
  browserInfo: {
664
685
  hasWebFontSupport: true,
@@ -672,11 +693,11 @@ describe('UserAgentParser', function () {
672
693
  expect(parse('Mozilla/5.0 (BB10; Touch) AppleWebKit/537.3+ (KHTML, like Gecko) Version/10.0.9.388 Mobile Safari/537.3+'))
673
694
  .toMatchUserAgent({
674
695
  name: 'BuiltinBrowser',
675
- version: 'Unknown',
696
+ version: new Version(),
676
697
  platform: 'BlackBerry',
677
- platformVersion: '10.0.9.388',
698
+ platformVersion: new Version(10, 0, 9, 388),
678
699
  engine: 'AppleWebKit',
679
- engineVersion: '537.3+',
700
+ engineVersion: new Version(537, 3),
680
701
  documentMode: undefined,
681
702
  browserInfo: {
682
703
  hasWebFontSupport: true,
@@ -690,11 +711,11 @@ describe('UserAgentParser', function () {
690
711
  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+'))
691
712
  .toMatchUserAgent({
692
713
  name: 'BuiltinBrowser',
693
- version: 'Unknown',
714
+ version: new Version(),
694
715
  platform: 'BlackBerry',
695
- platformVersion: '7.1.0.346',
716
+ platformVersion: new Version(7, 1, 0, 346),
696
717
  engine: 'AppleWebKit',
697
- engineVersion: '534.11+',
718
+ engineVersion: new Version(534, 11),
698
719
  documentMode: undefined,
699
720
  browserInfo: {
700
721
  hasWebFontSupport: false,
@@ -710,11 +731,11 @@ describe('UserAgentParser', function () {
710
731
  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'))
711
732
  .toMatchUserAgent({
712
733
  name: 'Silk',
713
- version: '2.6',
734
+ version: new Version(2, 6),
714
735
  platform: 'Android',
715
- platformVersion: '4.0.3',
736
+ platformVersion: new Version(4, 0, 3),
716
737
  engine: 'AppleWebKit',
717
- engineVersion: '535.19',
738
+ engineVersion: new Version(535, 19),
718
739
  documentMode: undefined,
719
740
  browserInfo: {
720
741
  hasWebFontSupport: true,
@@ -728,11 +749,11 @@ describe('UserAgentParser', function () {
728
749
  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'))
729
750
  .toMatchUserAgent({
730
751
  name: 'Silk',
731
- version: '2.6',
752
+ version: new Version(2, 6),
732
753
  platform: 'Linux',
733
- platformVersion: 'Unknown',
754
+ platformVersion: new Version(),
734
755
  engine: 'AppleWebKit',
735
- engineVersion: '535.19',
756
+ engineVersion: new Version(535, 19),
736
757
  documentMode: undefined,
737
758
  browserInfo: {
738
759
  hasWebFontSupport: true,
@@ -746,11 +767,11 @@ describe('UserAgentParser', function () {
746
767
  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'))
747
768
  .toMatchUserAgent({
748
769
  name: 'Silk',
749
- version: '2.6',
770
+ version: new Version(2, 6),
750
771
  platform: 'Android',
751
- platformVersion: '4.0.3',
772
+ platformVersion: new Version(4, 0, 3),
752
773
  engine: 'AppleWebKit',
753
- engineVersion: '535.19',
774
+ engineVersion: new Version(535, 19),
754
775
  documentMode: undefined,
755
776
  browserInfo: {
756
777
  hasWebFontSupport: true,
@@ -764,11 +785,11 @@ describe('UserAgentParser', function () {
764
785
  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'))
765
786
  .toMatchUserAgent({
766
787
  name: 'Silk',
767
- version: '2.6',
788
+ version: new Version(2, 6),
768
789
  platform: 'Linux',
769
- platformVersion: 'Unknown',
790
+ platformVersion: new Version(),
770
791
  engine: 'AppleWebKit',
771
- engineVersion: '535.19',
792
+ engineVersion: new Version(535, 19),
772
793
  documentMode: undefined,
773
794
  browserInfo: {
774
795
  hasWebFontSupport: true,
@@ -782,11 +803,11 @@ describe('UserAgentParser', function () {
782
803
  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'))
783
804
  .toMatchUserAgent({
784
805
  name: 'Silk',
785
- version: '2.6',
806
+ version: new Version(2, 6),
786
807
  platform: 'Android',
787
- platformVersion: '4.0.3',
808
+ platformVersion: new Version(4, 0, 3),
788
809
  engine: 'AppleWebKit',
789
- engineVersion: '535.19',
810
+ engineVersion: new Version(535, 19),
790
811
  documentMode: undefined,
791
812
  browserInfo: {
792
813
  hasWebFontSupport: true,
@@ -800,11 +821,11 @@ describe('UserAgentParser', function () {
800
821
  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'))
801
822
  .toMatchUserAgent({
802
823
  name: 'Silk',
803
- version: '2.6',
824
+ version: new Version(2, 6),
804
825
  platform: 'Linux',
805
- platformVersion: 'Unknown',
826
+ platformVersion: new Version(),
806
827
  engine: 'AppleWebKit',
807
- engineVersion: '535.19',
828
+ engineVersion: new Version(535, 19),
808
829
  documentMode: undefined,
809
830
  browserInfo: {
810
831
  hasWebFontSupport: true,
@@ -818,11 +839,11 @@ describe('UserAgentParser', function () {
818
839
  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'))
819
840
  .toMatchUserAgent({
820
841
  name: 'Silk',
821
- version: '2.6',
842
+ version: new Version(2, 6),
822
843
  platform: 'Android',
823
- platformVersion: '4.0.3',
844
+ platformVersion: new Version(4, 0, 3),
824
845
  engine: 'AppleWebKit',
825
- engineVersion: '535.19',
846
+ engineVersion: new Version(535, 19),
826
847
  documentMode: undefined,
827
848
  browserInfo: {
828
849
  hasWebFontSupport: true,
@@ -836,11 +857,11 @@ describe('UserAgentParser', function () {
836
857
  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'))
837
858
  .toMatchUserAgent({
838
859
  name: 'Silk',
839
- version: '2.6',
860
+ version: new Version(2, 6),
840
861
  platform: 'Linux',
841
- platformVersion: 'Unknown',
862
+ platformVersion: new Version(),
842
863
  engine: 'AppleWebKit',
843
- engineVersion: '535.19',
864
+ engineVersion: new Version(535, 19),
844
865
  documentMode: undefined,
845
866
  browserInfo: {
846
867
  hasWebFontSupport: true,
@@ -854,11 +875,11 @@ describe('UserAgentParser', function () {
854
875
  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'))
855
876
  .toMatchUserAgent({
856
877
  name: 'Silk',
857
- version: '1.0.22.79_10013310',
878
+ version: new Version(1, 0, 22, '79_10013310'),
858
879
  platform: 'Android',
859
- platformVersion: '2.3.4',
880
+ platformVersion: new Version(2, 3, 4),
860
881
  engine: 'AppleWebKit',
861
- engineVersion: '533.1',
882
+ engineVersion: new Version(533, 1),
862
883
  documentMode: undefined,
863
884
  browserInfo: {
864
885
  hasWebFontSupport: true,
@@ -872,11 +893,11 @@ describe('UserAgentParser', function () {
872
893
  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'))
873
894
  .toMatchUserAgent({
874
895
  name: 'Silk',
875
- version: '1.0.22.79_10013310',
896
+ version: new Version(1, 0, 22, '79_10013310'),
876
897
  platform: 'Macintosh',
877
- platformVersion: '10_6_3',
898
+ platformVersion: new Version(10, 6, 3),
878
899
  engine: 'AppleWebKit',
879
- engineVersion: '533.16',
900
+ engineVersion: new Version(533, 16),
880
901
  documentMode: undefined,
881
902
  browserInfo: {
882
903
  hasWebFontSupport: true,
@@ -892,11 +913,11 @@ describe('UserAgentParser', function () {
892
913
  expect(parse('Opera/9.80 (Linux i686; U; en) Presto/2.5.22 Version/10.51'))
893
914
  .toMatchUserAgent({
894
915
  name: 'Opera',
895
- version: '10.51',
916
+ version: new Version(10, 51),
896
917
  platform: 'Linux',
897
- platformVersion: 'i686',
918
+ platformVersion: new Version(), //'i686'
898
919
  engine: 'Presto',
899
- engineVersion: '2.5.22',
920
+ engineVersion: new Version(2, 5, 22),
900
921
  documentMode: undefined,
901
922
  browserInfo: {
902
923
  hasWebFontSupport: true,
@@ -910,9 +931,9 @@ describe('UserAgentParser', function () {
910
931
  expect(parse('Mozilla/5.0 (Linux i686 ; U; en; rv:1.8.1) Gecko/20061208 Firefox/2.0.0 Opera 9.70'))
911
932
  .toMatchUserAgent({
912
933
  name: 'Opera',
913
- version: '9.70',
934
+ version: new Version(9, 70),
914
935
  platform: 'Linux',
915
- platformVersion: 'i686',
936
+ platformVersion: new Version(), //'i686'
916
937
  engine: 'Gecko',
917
938
  engineVersion: '1.8.1',
918
939
  documentMode: undefined,
@@ -928,11 +949,11 @@ describe('UserAgentParser', function () {
928
949
  expect(parse('Opera/9.64 (X11; Linux i686; U; Linux Mint; nb) Presto/2.1.1'))
929
950
  .toMatchUserAgent({
930
951
  name: 'Opera',
931
- version: '9.64',
952
+ version: new Version(9, 64),
932
953
  platform: 'Linux',
933
- platformVersion: 'i686',
954
+ platformVersion: new Version(), //'i686'
934
955
  engine: 'Presto',
935
- engineVersion: '2.1.1',
956
+ engineVersion: new Version(2, 1, 1),
936
957
  documentMode: undefined,
937
958
  browserInfo: {
938
959
  hasWebFontSupport: false,
@@ -946,11 +967,11 @@ describe('UserAgentParser', function () {
946
967
  expect(parse('Opera/9.80 (Android 4.1.1; Linux; Opera Mobi/ADR-1207201819; U; en) Presto/2.10.254 Version/12.00'))
947
968
  .toMatchUserAgent({
948
969
  name: 'Opera',
949
- version: '12.00',
970
+ version: new Version(12, 0),
950
971
  platform: 'Android',
951
- platformVersion: '4.1.1',
972
+ platformVersion: new Version(4, 1, 1),
952
973
  engine: 'Presto',
953
- engineVersion: '2.10.254',
974
+ engineVersion: new Version(2, 10, 254),
954
975
  documentMode: undefined,
955
976
  browserInfo: {
956
977
  hasWebFontSupport: true,
@@ -964,11 +985,11 @@ describe('UserAgentParser', function () {
964
985
  expect(parse('Opera/9.80 (Android; Opera Mini/7.0.29952/28.2144; U; en) Presto/2.8.119 Version/11.10'))
965
986
  .toMatchUserAgent({
966
987
  name: 'OperaMini',
967
- version: '7.0.29952',
988
+ version: new Version(7, 0, 29952),
968
989
  platform: 'Android',
969
990
  platformVersion: 'Unknown',
970
991
  engine: 'Presto',
971
- engineVersion: '2.8.119',
992
+ engineVersion: new Version(2, 8, 119),
972
993
  documentMode: undefined,
973
994
  browserInfo: {
974
995
  hasWebFontSupport: false,
@@ -984,11 +1005,11 @@ describe('UserAgentParser', function () {
984
1005
  expect(parse('Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.9 Safari/536.5'))
985
1006
  .toMatchUserAgent({
986
1007
  name: 'Chrome',
987
- version: '19.0.1084.9',
1008
+ version: new Version(19, 0, 1084, 9),
988
1009
  platform: 'Linux',
989
- platformVersion: 'Unknown',
1010
+ platformVersion: new Version(),
990
1011
  engine: 'AppleWebKit',
991
- engineVersion: '536.5',
1012
+ engineVersion: new Version(536, 5),
992
1013
  documentMode: undefined,
993
1014
  browserInfo: {
994
1015
  hasWebFontSupport: true,
@@ -1002,11 +1023,11 @@ describe('UserAgentParser', function () {
1002
1023
  expect(parse('Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.814.2 Safari/536.11'))
1003
1024
  .toMatchUserAgent({
1004
1025
  name: 'Chrome',
1005
- version: '20.0.814.2',
1026
+ version: new Version(20, 0, 814, 2),
1006
1027
  platform: 'Linux',
1007
- platformVersion: 'Unknown',
1028
+ platformVersion: new Version(),
1008
1029
  engine: 'AppleWebKit',
1009
- engineVersion: '536.11',
1030
+ engineVersion: new Version(536, 11),
1010
1031
  documentMode: undefined,
1011
1032
  browserInfo: {
1012
1033
  hasWebFontSupport: true,
@@ -1022,11 +1043,11 @@ describe('UserAgentParser', function () {
1022
1043
  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)'))
1023
1044
  .toMatchUserAgent({
1024
1045
  name: 'Mozilla',
1025
- version: 'Unknown',
1046
+ version: new Version(),
1026
1047
  platform: 'Windows',
1027
- platformVersion: '5.1',
1048
+ platformVersion: new Version(5, 1),
1028
1049
  engine: 'Gecko',
1029
- engineVersion: '1.9.1.4',
1050
+ engineVersion: new Version(1, 9, 1, 4),
1030
1051
  documentMode: undefined,
1031
1052
  browserInfo: {
1032
1053
  hasWebFontSupport: true,
@@ -1040,11 +1061,11 @@ describe('UserAgentParser', function () {
1040
1061
  expect(parse('Mozilla/5.0 (Windows; U; Windows NT 5.1; ru-RU; rv:2.5.8) Gecko/20091016 (.NET CLR 3.5.30729)'))
1041
1062
  .toMatchUserAgent({
1042
1063
  name: 'Mozilla',
1043
- version: 'Unknown',
1064
+ version: new Version(),
1044
1065
  platform: 'Windows',
1045
- platformVersion: '5.1',
1066
+ platformVersion: new Version(5, 1),
1046
1067
  engine: 'Gecko',
1047
- engineVersion: '2.5.8',
1068
+ engineVersion: new Version(2, 5, 8),
1048
1069
  documentMode: undefined,
1049
1070
  browserInfo: {
1050
1071
  hasWebFontSupport: true,
@@ -1058,11 +1079,11 @@ describe('UserAgentParser', function () {
1058
1079
  expect(parse('Mozilla/5.0 (Windows; U; Windows NT 5.1; ru-RU; rv:1.10.1b) Gecko/20091016 (.NET CLR 3.5.30729)'))
1059
1080
  .toMatchUserAgent({
1060
1081
  name: 'Mozilla',
1061
- version: 'Unknown',
1082
+ version: new Version(),
1062
1083
  platform: 'Windows',
1063
- platformVersion: '5.1',
1084
+ platformVersion: new Version(5, 1),
1064
1085
  engine: 'Gecko',
1065
- engineVersion: '1.10.1b',
1086
+ engineVersion: new Version(1, 10, 1, 'b'),
1066
1087
  documentMode: undefined,
1067
1088
  browserInfo: {
1068
1089
  hasWebFontSupport: true,
@@ -1076,11 +1097,11 @@ describe('UserAgentParser', function () {
1076
1097
  expect(parse('Mozilla/5.0 (Windows; U; Windows NT 5.1; ru-RU; rv:1.b) Gecko/20091016 (.NET CLR 3.5.30729)'))
1077
1098
  .toMatchUserAgent({
1078
1099
  name: 'Mozilla',
1079
- version: 'Unknown',
1100
+ version: new Version(),
1080
1101
  platform: 'Windows',
1081
- platformVersion: '5.1',
1102
+ platformVersion: new Version(5, 1),
1082
1103
  engine: 'Gecko',
1083
- engineVersion: '1.b',
1104
+ engineVersion: new Version(1, null, null, 'b'),
1084
1105
  documentMode: undefined,
1085
1106
  browserInfo: {
1086
1107
  hasWebFontSupport: false,
@@ -1092,11 +1113,11 @@ describe('UserAgentParser', function () {
1092
1113
  expect(parse('Mozilla/5.0 (Windows; U; Windows NT 5.1; ru-RU; rv:1.b) Gecko/20091016 (.NET CLR 3.5.30729)'))
1093
1114
  .toMatchUserAgent({
1094
1115
  name: 'Mozilla',
1095
- version: 'Unknown',
1116
+ version: new Version(),
1096
1117
  platform: 'Windows',
1097
- platformVersion: '5.1',
1118
+ platformVersion: new Version(5, 1),
1098
1119
  engine: 'Gecko',
1099
- engineVersion: '1.b',
1120
+ engineVersion: new Version(1, null, null, 'b'),
1100
1121
  documentMode: undefined,
1101
1122
  browserInfo: {
1102
1123
  hasWebFontSupport: false,
@@ -1108,11 +1129,11 @@ describe('UserAgentParser', function () {
1108
1129
  expect(parse('Mozilla/5.0 (Windows; U; Windows NT 5.1; ru-RU; rv:1.9) Gecko/20091016 (.NET CLR 3.5.30729)'))
1109
1130
  .toMatchUserAgent({
1110
1131
  name: 'Mozilla',
1111
- version: 'Unknown',
1132
+ version: new Version(),
1112
1133
  platform: 'Windows',
1113
- platformVersion: '5.1',
1134
+ platformVersion: new Version(5, 1),
1114
1135
  engine: 'Gecko',
1115
- engineVersion: '1.9',
1136
+ engineVersion: new Version(1, 9),
1116
1137
  documentMode: undefined,
1117
1138
  browserInfo: {
1118
1139
  hasWebFontSupport: false,
@@ -1124,11 +1145,11 @@ describe('UserAgentParser', function () {
1124
1145
  expect(parse('Mozilla/5.0 (Windows; U; Windows NT 5.1; ru-RU; rv:0.10.1) Gecko/20091016 (.NET CLR 3.5.30729)'))
1125
1146
  .toMatchUserAgent({
1126
1147
  name: 'Mozilla',
1127
- version: 'Unknown',
1148
+ version: new Version(),
1128
1149
  platform: 'Windows',
1129
- platformVersion: '5.1',
1150
+ platformVersion: new Version(5, 1),
1130
1151
  engine: 'Gecko',
1131
- engineVersion: '0.10.1',
1152
+ engineVersion: new Version(0, 10, 1),
1132
1153
  documentMode: undefined,
1133
1154
  browserInfo: {
1134
1155
  hasWebFontSupport: false,
@@ -1140,11 +1161,11 @@ describe('UserAgentParser', function () {
1140
1161
  expect(parse('Mozilla/5.0 (Windows; U; Windows NT 5.1; ru-RU; rv:0.3.42) Gecko/20091016 (.NET CLR 3.5.30729)'))
1141
1162
  .toMatchUserAgent({
1142
1163
  name: 'Mozilla',
1143
- version: 'Unknown',
1164
+ version: new Version(),
1144
1165
  platform: 'Windows',
1145
- platformVersion: '5.1',
1166
+ platformVersion: new Version(5, 1),
1146
1167
  engine: 'Gecko',
1147
- engineVersion: '0.3.42',
1168
+ engineVersion: new Version(0, 3, 42),
1148
1169
  documentMode: undefined,
1149
1170
  browserInfo: {
1150
1171
  hasWebFontSupport: false,