Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | from sut import MockAgent |
michael@0 | 2 | import mozdevice |
michael@0 | 3 | import mozlog |
michael@0 | 4 | import unittest |
michael@0 | 5 | |
michael@0 | 6 | class LaunchTest(unittest.TestCase): |
michael@0 | 7 | |
michael@0 | 8 | def test_nouserserial(self): |
michael@0 | 9 | a = MockAgent(self, commands = [("ps", |
michael@0 | 10 | "10029 549 com.android.launcher\n" |
michael@0 | 11 | "10066 1198 com.twitter.android"), |
michael@0 | 12 | ("info sutuserinfo", ""), |
michael@0 | 13 | ("exec am start -W -n " |
michael@0 | 14 | "org.mozilla.fennec/.App -a " |
michael@0 | 15 | "android.intent.action.VIEW", |
michael@0 | 16 | "OK\nreturn code [0]")]) |
michael@0 | 17 | d = mozdevice.DroidSUT("127.0.0.1", port=a.port, logLevel=mozlog.DEBUG) |
michael@0 | 18 | d.launchFennec("org.mozilla.fennec") |
michael@0 | 19 | a.wait() |
michael@0 | 20 | |
michael@0 | 21 | def test_userserial(self): |
michael@0 | 22 | a = MockAgent(self, commands = [("ps", |
michael@0 | 23 | "10029 549 com.android.launcher\n" |
michael@0 | 24 | "10066 1198 com.twitter.android"), |
michael@0 | 25 | ("info sutuserinfo", "User Serial:0"), |
michael@0 | 26 | ("exec am start --user 0 -W -n " |
michael@0 | 27 | "org.mozilla.fennec/.App -a " |
michael@0 | 28 | "android.intent.action.VIEW", |
michael@0 | 29 | "OK\nreturn code [0]")]) |
michael@0 | 30 | d = mozdevice.DroidSUT("127.0.0.1", port=a.port, logLevel=mozlog.DEBUG) |
michael@0 | 31 | d.launchFennec("org.mozilla.fennec") |
michael@0 | 32 | a.wait() |
michael@0 | 33 | |
michael@0 | 34 | if __name__ == '__main__': |
michael@0 | 35 | unittest.main() |