1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/testing/mozbase/mozdevice/tests/droidsut_launch.py Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,35 @@ 1.4 +from sut import MockAgent 1.5 +import mozdevice 1.6 +import mozlog 1.7 +import unittest 1.8 + 1.9 +class LaunchTest(unittest.TestCase): 1.10 + 1.11 + def test_nouserserial(self): 1.12 + a = MockAgent(self, commands = [("ps", 1.13 + "10029 549 com.android.launcher\n" 1.14 + "10066 1198 com.twitter.android"), 1.15 + ("info sutuserinfo", ""), 1.16 + ("exec am start -W -n " 1.17 + "org.mozilla.fennec/.App -a " 1.18 + "android.intent.action.VIEW", 1.19 + "OK\nreturn code [0]")]) 1.20 + d = mozdevice.DroidSUT("127.0.0.1", port=a.port, logLevel=mozlog.DEBUG) 1.21 + d.launchFennec("org.mozilla.fennec") 1.22 + a.wait() 1.23 + 1.24 + def test_userserial(self): 1.25 + a = MockAgent(self, commands = [("ps", 1.26 + "10029 549 com.android.launcher\n" 1.27 + "10066 1198 com.twitter.android"), 1.28 + ("info sutuserinfo", "User Serial:0"), 1.29 + ("exec am start --user 0 -W -n " 1.30 + "org.mozilla.fennec/.App -a " 1.31 + "android.intent.action.VIEW", 1.32 + "OK\nreturn code [0]")]) 1.33 + d = mozdevice.DroidSUT("127.0.0.1", port=a.port, logLevel=mozlog.DEBUG) 1.34 + d.launchFennec("org.mozilla.fennec") 1.35 + a.wait() 1.36 + 1.37 +if __name__ == '__main__': 1.38 + unittest.main()