1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
10 userAgent
: 'Mozilla/5.0 (X11; CrOS x86_64 6457.107.0) AppleWebKit/537.36 ' +
11 '(KHTML, like Gecko) Chrome/40.0.2214.115 Safari/537.36,gzip(gfe)',
13 osVersion
: '6457.107.0',
15 chromeVersion
: '40.0.2214.115'
17 userAgent
: 'Mozilla/5.0 (X11; CrOS i686 6812.88.0) AppleWebKit/537.36 ' +
18 '(KHTML, like Gecko) Chrome/42.0.2311.153 Safari/537.36,gzip(gfe)',
20 osVersion
: '6812.88.0',
22 chromeVersion
: '42.0.2311.153'
24 userAgent
: 'Mozilla/5.0 (X11; CrOS armv7l 6946.52.0) AppleWebKit/537.36 ' +
25 '(KHTML, like Gecko) Chrome/43.0.2357.73 Safari/537.36,gzip(gfe)',
27 osVersion
: '6946.52.0',
29 chromeVersion
: '43.0.2357.73'
31 userAgent
: 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 ' +
32 '(KHTML, like Gecko) Chrome/45.0.2414.0 Safari/537.36,gzip(gfe)',
36 chromeVersion
: '45.0.2414.0'
38 userAgent
: 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 ' +
39 '(KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36,gzip(gfe)',
43 chromeVersion
: '43.0.2357.81'
45 userAgent
: 'Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 ' +
46 '(KHTML, like Gecko) Chrome/42.0.2311.152 Safari/537.36,gzip(gfe)',
50 chromeVersion
: '42.0.2311.152'
52 userAgent
: 'Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 ' +
53 '(KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36,gzip(gfe)',
57 chromeVersion
: '43.0.2357.81'
59 userAgent
: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 '+
60 '(KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36,gzip(gfe)',
64 chromeVersion
: '43.0.2357.81'
66 userAgent
: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit' +
67 '/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36,gzip(gfe)',
71 chromeVersion
: '43.0.2357.81'
73 userAgent
: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit' +
74 '/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36,gzip(gfe)',
78 chromeVersion
: '43.0.2357.81'
80 userAgent
: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit' +
81 '/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36,gzip(gfe)',
85 chromeVersion
: '43.0.2357.81'
87 userAgent
: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit' +
88 '/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36,gzip(gfe)',
92 chromeVersion
: '43.0.2357.81'
96 QUnit
.module('platform');
98 function forEachUserAgent(/** function(Object<string>, string) */ callback
) {
99 testData
.forEach(function(/** Object<string>*/ testCase
) {
100 var message
= 'userAgent: ' + testCase
['userAgent']
101 var userAgentStub
= sinon
.stub(remoting
, 'getUserAgent');
102 userAgentStub
.returns(testCase
['userAgent']);
103 var result
= remoting
.getSystemInfo();
104 callback(testCase
, message
);
105 userAgentStub
.restore();
109 QUnit
.test('OS name, OS version, chrome version and cpu detection',
112 function(/** Object<string> */ testCase
, /** string */ message
) {
113 var result
= remoting
.getSystemInfo();
114 assert
.equal(result
.osName
, testCase
['osName'], message
);
115 assert
.equal(result
.osVersion
, testCase
['osVersion'], message
);
116 assert
.equal(result
.cpu
, testCase
['cpu'], message
);
117 assert
.equal(result
.chromeVersion
, testCase
['chromeVersion'], message
);
121 QUnit
.test('platform is Mac', function(assert
) {
123 function(/** Object<string> */ testCase
, /** string */ message
) {
124 assert
.equal(remoting
.platformIsMac(),
125 testCase
['osName'] === 'Mac', message
);
129 QUnit
.test('platform is Windows', function(assert
) {
131 function(/** Object<string> */ testCase
, /** string */ message
) {
132 assert
.equal(remoting
.platformIsWindows(),
133 testCase
['osName'] === 'Windows', message
);
137 QUnit
.test('platform is Linux', function(assert
) {
139 function(/** Object<string> */ testCase
, /** string */ message
) {
140 assert
.equal(remoting
.platformIsLinux(),
141 testCase
['osName'] === 'Linux', message
);
145 QUnit
.test('platform is ChromeOS', function(assert
) {
147 function(/** Object<string> */ testCase
, /** string */ message
) {
148 assert
.equal(remoting
.platformIsChromeOS(),
149 testCase
['osName'] === 'ChromeOS', message
);