ProcessTestpublic class ProcessTest extends TestCase
Methods Summary |
---|
public void | testProcessGetUidFromName()
assertEquals(android.os.Process.SYSTEM_UID, Process.getUidForName("system"));
assertEquals(Process.BLUETOOTH_UID, Process.getUidForName("bluetooth"));
assertEquals(Process.FIRST_APPLICATION_UID, Process.getUidForName("u0_a0"));
assertEquals(UserHandle.getUid(1, Process.SYSTEM_UID), Process.getUidForName("u1_system"));
assertEquals(UserHandle.getUid(2, Process.FIRST_ISOLATED_UID),
Process.getUidForName("u2_i0"));
assertEquals(UserHandle.getUid(3, Process.FIRST_APPLICATION_UID + 100),
Process.getUidForName("u3_a100"));
| public void | testProcessGetUidFromNameFailure()
// Failure cases
assertEquals(-1, Process.getUidForName("u2a_foo"));
assertEquals(-1, Process.getUidForName("u1_abcdef"));
assertEquals(-1, Process.getUidForName("u23"));
assertEquals(-1, Process.getUidForName("u2_i34a"));
assertEquals(-1, Process.getUidForName("akjhwiuefhiuhsf"));
assertEquals(-1, Process.getUidForName("u5_radio5"));
assertEquals(-1, Process.getUidForName("u2jhsajhfkjhsafkhskafhkashfkjashfkjhaskjfdhakj3"));
|
|