Methods Summary |
---|
private void | checkErrorListSanity(java.util.List errList)
if (errList == null) return;
Iterator<ActivityManager.ProcessErrorStateInfo> iter = errList.iterator();
while (iter.hasNext()) {
ActivityManager.ProcessErrorStateInfo info = iter.next();
assertNotNull(info);
// sanity checks
assertTrue((info.condition == ActivityManager.ProcessErrorStateInfo.CRASHED) ||
(info.condition == ActivityManager.ProcessErrorStateInfo.NOT_RESPONDING));
// TODO look at each of these and consider a stronger test
// TODO can we cross-check at the process name via some other API?
// TODO is there a better test for strings, e.g. "assertIsLegalString")
assertNotNull(info.processName);
// reasonableness test for info.pid ?
assertNotNull(info.longMsg);
assertNotNull(info.shortMsg);
// is there any reasonable test for the crashData? Probably not.
}
|
public void | disabledTestErrorTasksEmpty()
List<ActivityManager.ProcessErrorStateInfo> errList;
errList = mActivityManager.getProcessesInErrorState();
// test: confirm list is empty
assertNull(errList);
|
protected void | setUp()
super.setUp();
mContext = getContext();
mActivityManager = (ActivityManager) mContext.getSystemService(Context.ACTIVITY_SERVICE);
|
public void | testErrorTasksWithANR()
List<ActivityManager.ProcessErrorStateInfo> errList;
// TODO: force an application into an ANR state
errList = mActivityManager.getProcessesInErrorState();
// test: the list itself is healthy
checkErrorListSanity(errList);
// test: confirm our ANR'ing application shows up in the list
|
public void | testErrorTasksWithError()
List<ActivityManager.ProcessErrorStateInfo> errList;
// TODO force another process into an error condition. How?
// test: confirm error list length is at least 1 under varying query lengths
// checkErrorListMax(1,-1);
errList = mActivityManager.getProcessesInErrorState();
// test: the list itself is healthy
checkErrorListSanity(errList);
// test: confirm our application shows up in the list
|
public void | testGetDeviceConfigurationInfo()
ConfigurationInfo config = mActivityManager.getDeviceConfigurationInfo();
assertNotNull(config);
// Validate values against configuration retrieved from resources
Configuration vconfig = mContext.getResources().getConfiguration();
assertNotNull(vconfig);
assertEquals(config.reqKeyboardType, vconfig.keyboard);
assertEquals(config.reqTouchScreen, vconfig.touchscreen);
assertEquals(config.reqNavigation, vconfig.navigation);
if (vconfig.navigation == Configuration.NAVIGATION_NONAV) {
assertNotNull(config.reqInputFeatures & ConfigurationInfo.INPUT_FEATURE_FIVE_WAY_NAV);
}
if (vconfig.keyboard != Configuration.KEYBOARD_UNDEFINED) {
assertNotNull(config.reqInputFeatures & ConfigurationInfo.INPUT_FEATURE_HARD_KEYBOARD);
}
|