michael@0: # This Source Code Form is subject to the terms of the Mozilla Public michael@0: # License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: # file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: michael@0: from dmunit import DeviceManagerTestCase michael@0: michael@0: class ProcessListTestCase(DeviceManagerTestCase): michael@0: michael@0: def runTest(self): michael@0: """This tests getting a process list from the device. michael@0: """ michael@0: proclist = self.dm.getProcessList() michael@0: michael@0: # This returns a process list of the form: michael@0: # [[, ], [, ], ...] michael@0: # on android the userID is affixed to the process array: michael@0: # [[, , ], ...] michael@0: michael@0: self.assertNotEqual(len(proclist), 0) michael@0: michael@0: for item in proclist: michael@0: self.assertIsInstance(item[0], int) michael@0: self.assertIsInstance(item[1], str) michael@0: self.assertGreater(len(item[1]), 0) michael@0: if len(item) > 2: michael@0: self.assertIsInstance(item[2], int) michael@0: