Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1596)

Side by Side Diff: chrome/test/data/extensions/api_test/chromeos_info_private/extended/background.js

Issue 2761263007: ChromeOS: Expose 'device type' signal (Closed)
Patch Set: replace StringPrintf with string Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/common/extensions/api/chromeos_info_private.json ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 chrome.app.runtime.onLaunched.addListener(function() { 5 chrome.app.runtime.onLaunched.addListener(function() {
6 chrome.test.getConfig(function(config) { 6 chrome.test.getConfig(function(config) {
7 var testName = config.customArg; 7 var testName = config.customArg;
8 if (!testName) { 8 if (!testName) {
9 chrome.test.fail("Missing test name."); 9 chrome.test.fail("Missing test name.");
10 return; 10 return;
11 } 11 }
12 chrome.chromeosInfoPrivate.get([ 12 chrome.chromeosInfoPrivate.get([
13 'sessionType', 13 'sessionType',
14 'playStoreStatus', 14 'playStoreStatus',
15 'managedDeviceStatus' 15 'managedDeviceStatus',
16 'deviceType'
16 ], chrome.test.callbackPass(function(values) { 17 ], chrome.test.callbackPass(function(values) {
17 switch (testName) { 18 switch (testName) {
18 case 'kiosk': 19 case 'kiosk':
19 chrome.test.assertEq('kiosk', values['sessionType']); 20 chrome.test.assertEq('kiosk', values['sessionType']);
20 break; 21 break;
21 case 'arc not-available': 22 case 'arc not-available':
22 chrome.test.assertEq('not available', values['playStoreStatus']); 23 chrome.test.assertEq('not available', values['playStoreStatus']);
23 break; 24 break;
24 case 'arc available': 25 case 'arc available':
25 chrome.test.assertEq('available', values['playStoreStatus']); 26 chrome.test.assertEq('available', values['playStoreStatus']);
26 break; 27 break;
27 case 'arc enabled': 28 case 'arc enabled':
28 chrome.test.assertEq('enabled', values['playStoreStatus']); 29 chrome.test.assertEq('enabled', values['playStoreStatus']);
29 break; 30 break;
30 case 'managed': 31 case 'managed':
31 chrome.test.assertEq('managed', values['managedDeviceStatus']); 32 chrome.test.assertEq('managed', values['managedDeviceStatus']);
33 break;
34 case 'chromebase':
35 chrome.test.assertEq('chromebase', values['deviceType']);
36 break;
37 case 'chromebit':
38 chrome.test.assertEq('chromebit', values['deviceType']);
39 break;
40 case 'chromebook':
41 chrome.test.assertEq('chromebook', values['deviceType']);
42 break;
43 case 'chromebox':
44 chrome.test.assertEq('chromebox', values['deviceType']);
45 break;
46 case 'unknown device type':
47 chrome.test.assertEq('chromedevice', values['deviceType']);
32 } 48 }
33 })); 49 }));
34 }); 50 });
35 }); 51 });
OLDNEW
« no previous file with comments | « chrome/common/extensions/api/chromeos_info_private.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698