michael@0: #!/usr/bin/env python michael@0: michael@0: import mozdevice michael@0: import mozlog michael@0: import unittest michael@0: from sut import MockAgent michael@0: michael@0: michael@0: class TestKill(unittest.TestCase): michael@0: michael@0: def test_killprocess(self): michael@0: commands = [("ps", "1000 1486 com.android.settings\n" michael@0: "10016 420 com.android.location.fused\n" michael@0: "10023 335 com.android.systemui\n"), michael@0: ("kill com.android.settings", michael@0: "Successfully killed com.android.settings\n")] michael@0: m = MockAgent(self, commands=commands) michael@0: d = mozdevice.DroidSUT("127.0.0.1", port=m.port, logLevel=mozlog.DEBUG) michael@0: # No error raised means success michael@0: self.assertEqual(None, d.killProcess("com.android.settings")) michael@0: michael@0: michael@0: if __name__ == '__main__': michael@0: unittest.main()