Fields Summary |
---|
private static final String | LOG_TAG |
private static final long | QUIET_TIME_TO_BE_CONSIDERD_IDLE_STATEThis value has the greatest bearing on the appearance of test execution speeds.
This value is used as the minimum time to wait before considering the UI idle after
each action. |
private static final long | TOTAL_TIME_TO_WAIT_FOR_IDLE_STATEThis is the maximum time the automation will wait for the UI to go idle. Execution
will resume normally anyway. This is to prevent waiting forever on display updates
that may be related to spinning wheels or progress updates of sorts etc... |
private final android.app.UiAutomation | mUiAutomation |
private final InteractionController | mInteractionController |
private final QueryController | mQueryController |
Methods Summary |
---|
public android.view.accessibility.AccessibilityEvent | executeCommandAndWaitForAccessibilityEvent(java.lang.Runnable command, android.app.UiAutomation.AccessibilityEventFilter filter, long timeoutMillis)
return mUiAutomation.executeAndWaitForEvent(command,
filter, timeoutMillis);
|
public abstract android.view.Display | getDefaultDisplay()
|
InteractionController | getInteractionController()
return mInteractionController;
|
QueryController | getQueryController()
return mQueryController;
|
public android.view.accessibility.AccessibilityNodeInfo | getRootInActiveWindow()
return mUiAutomation.getRootInActiveWindow();
|
public abstract int | getRotation()
|
public abstract long | getSystemLongPressTime()
|
public boolean | injectInputEvent(android.view.InputEvent event, boolean sync)
return mUiAutomation.injectInputEvent(event, sync);
|
public abstract boolean | isScreenOn()
|
public boolean | performGlobalAction(int action)
return mUiAutomation.performGlobalAction(action);
|
public void | setCompressedLayoutHierarchy(boolean compressed)
AccessibilityServiceInfo info = mUiAutomation.getServiceInfo();
if (compressed)
info.flags &= ~AccessibilityServiceInfo.FLAG_INCLUDE_NOT_IMPORTANT_VIEWS;
else
info.flags |= AccessibilityServiceInfo.FLAG_INCLUDE_NOT_IMPORTANT_VIEWS;
mUiAutomation.setServiceInfo(info);
|
public void | setOnAccessibilityEventListener(android.app.UiAutomation.OnAccessibilityEventListener listener)
mUiAutomation.setOnAccessibilityEventListener(listener);
|
public boolean | setRotation(int rotation)
return mUiAutomation.setRotation(rotation);
|
public boolean | takeScreenshot(java.io.File storePath, int quality)
Bitmap screenshot = mUiAutomation.takeScreenshot();
if (screenshot == null) {
return false;
}
BufferedOutputStream bos = null;
try {
bos = new BufferedOutputStream(new FileOutputStream(storePath));
if (bos != null) {
screenshot.compress(Bitmap.CompressFormat.PNG, quality, bos);
bos.flush();
}
} catch (IOException ioe) {
Log.e(LOG_TAG, "failed to save screen shot to file", ioe);
return false;
} finally {
if (bos != null) {
try {
bos.close();
} catch (IOException ioe) {
/* ignore */
}
}
screenshot.recycle();
}
return true;
|
public void | waitForIdle()
waitForIdle(TOTAL_TIME_TO_WAIT_FOR_IDLE_STATE);
|
public void | waitForIdle(long timeout)
try {
mUiAutomation.waitForIdle(QUIET_TIME_TO_BE_CONSIDERD_IDLE_STATE, timeout);
} catch (TimeoutException te) {
Log.w(LOG_TAG, "Could not detect idle state.", te);
}
|