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

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

Issue 2686233006: Add managed device signal (Closed)
Patch Set: Minor changes in comments Created 3 years, 10 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 var pass = chrome.test.callbackPass; 5 var pass = chrome.test.callbackPass;
6 var fail = chrome.test.callbackFail; 6 var fail = chrome.test.callbackFail;
7 7
8 function getTestFunctionFor(keys, fails) { 8 function getTestFunctionFor(keys, fails) {
9 return function generatedTest () { 9 return function generatedTest () {
10 // Debug. 10 // Debug.
11 console.warn('keys: ' + keys + '; fails: ' + fails); 11 console.warn('keys: ' + keys + '; fails: ' + fails);
12 12
13 chrome.chromeosInfoPrivate.get( 13 chrome.chromeosInfoPrivate.get(
14 keys, 14 keys,
15 pass( 15 pass(
16 function(values) { 16 function(values) {
17 for (var i = 0; i < keys.length; ++i) { 17 for (var i = 0; i < keys.length; ++i) {
18 // Default session type should be normal. 18 // Default session type should be normal.
19 if (keys[i] == 'sessionType') { 19 if (keys[i] == 'sessionType') {
20 chrome.test.assertEq('normal', values[keys[i]]); 20 chrome.test.assertEq('normal', values[keys[i]]);
21 } 21 }
22 // PlayStoreStatus by default should be not available. 22 // PlayStoreStatus by default should be not available.
23 if (keys[i] == 'playStoreStatus') { 23 if (keys[i] == 'playStoreStatus') {
24 chrome.test.assertEq('not available', values[keys[i]]); 24 chrome.test.assertEq('not available', values[keys[i]]);
25 } 25 }
26 if (keys[i] == 'managedDeviceStatus') {
27 chrome.test.assertEq('not managed', values[keys[i]]);
28 }
26 // Debug 29 // Debug
27 if (keys[i] in values) { 30 if (keys[i] in values) {
28 console.log(' values["' + keys[i] + '"] = ' + 31 console.log(' values["' + keys[i] + '"] = ' +
29 values[keys[i]]); 32 values[keys[i]]);
30 } else { 33 } else {
31 console.log(' ' + keys[i] + ' is missing in values'); 34 console.log(' ' + keys[i] + ' is missing in values');
32 } 35 }
33 36
34 chrome.test.assertEq(fails.indexOf(keys[i]) == -1, 37 chrome.test.assertEq(fails.indexOf(keys[i]) == -1,
35 keys[i] in values); 38 keys[i] in values);
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 113
111 // Run generated chrome.chromeosInfoPrivate.get() tests. 114 // Run generated chrome.chromeosInfoPrivate.get() tests.
112 var tests = generateTestsForKeys(['hwid', 115 var tests = generateTestsForKeys(['hwid',
113 'customizationId', 116 'customizationId',
114 'homeProvider', 117 'homeProvider',
115 'initialLocale', 118 'initialLocale',
116 'board', 119 'board',
117 'isOwner', 120 'isOwner',
118 'sessionType', 121 'sessionType',
119 'playStoreStatus', 122 'playStoreStatus',
123 'managedDeviceStatus',
120 'clientId', 124 'clientId',
121 'a11yLargeCursorEnabled', 125 'a11yLargeCursorEnabled',
122 'a11yStickyKeysEnabled', 126 'a11yStickyKeysEnabled',
123 'a11ySpokenFeedbackEnabled', 127 'a11ySpokenFeedbackEnabled',
124 'a11yHighContrastEnabled', 128 'a11yHighContrastEnabled',
125 'a11yScreenMagnifierEnabled', 129 'a11yScreenMagnifierEnabled',
126 'a11yAutoClickEnabled', 130 'a11yAutoClickEnabled',
127 'a11yVirtualKeyboardEnabled', 131 'a11yVirtualKeyboardEnabled',
128 'sendFunctionKeys', 132 'sendFunctionKeys',
129 'timezone', 133 'timezone',
130 'supportedTimezones']) 134 'supportedTimezones'])
131 135
132 // Add chrome.chromeosInfoPrivate.set() test. 136 // Add chrome.chromeosInfoPrivate.set() test.
133 tests.push(timezoneSetTest); 137 tests.push(timezoneSetTest);
134 tests.push(prefsTest); 138 tests.push(prefsTest);
135 139
136 chrome.test.runTests(tests); 140 chrome.test.runTests(tests);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698