Chromium Code Reviews| OLD | NEW |
|---|---|
| 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(['sessionType', 'playStoreStatus'], | 12 chrome.chromeosInfoPrivate.get( |
| 13 function (values) { | 13 ['sessionType', 'playStoreStatus', 'managedDeviceStatus'], |
| 14 if (testName == 'kiosk') { | 14 function(values) { |
|
tbarzic
2017/02/22 02:18:35
You can use chrome.test.callbackPass(function(valu
Wenzhao (Colin) Zang
2017/02/22 03:11:07
Done.
| |
| 15 chrome.test.assertEq('kiosk', values['sessionType']); | 15 if (testName == 'kiosk') { |
| 16 } else if (testName == 'arc not-available') { | 16 chrome.test.assertEq('kiosk', values['sessionType']); |
| 17 chrome.test.assertEq('not available', values['playStoreStatus']); | 17 } else if (testName == 'arc not-available') { |
|
tbarzic
2017/02/22 02:18:35
nit: maybe switch this to switch {case:}
Wenzhao (Colin) Zang
2017/02/22 03:11:07
Done.
| |
| 18 } else if (testName == 'arc available') { | 18 chrome.test.assertEq('not available', values['playStoreStatus']); |
| 19 chrome.test.assertEq('available', values['playStoreStatus']); | 19 } else if (testName == 'arc available') { |
| 20 } else if (testName == 'arc enabled') { | 20 chrome.test.assertEq('available', values['playStoreStatus']); |
| 21 chrome.test.assertEq('enabled', values['playStoreStatus']); | 21 } else if (testName == 'arc enabled') { |
| 22 } | 22 chrome.test.assertEq('enabled', values['playStoreStatus']); |
| 23 chrome.test.succeed(); | 23 } else if (testName == 'managed') { |
| 24 }); | 24 chrome.test.assertEq('managed', values['managedDeviceStatus']); |
| 25 } | |
| 26 chrome.test.succeed(); | |
| 27 }); | |
| 25 }); | 28 }); |
| 26 }); | 29 }); |
| OLD | NEW |