use of android.support.test.uiautomator.UiDevice in project android_frameworks_base by ResurrectionRemix.
the class FilesJankPerfTest method setUpInLoop.
public void setUpInLoop() {
final UiDevice device = UiDevice.getInstance(getInstrumentation());
final Context context = getInstrumentation().getTargetContext();
mRootsListBot = new RootsListBot(device, context, BOT_TIMEOUT);
mDirListBot = new DirectoryListBot(device, context, BOT_TIMEOUT);
final Intent intent = new Intent(context, FilesActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
mActivity = getInstrumentation().startActivitySync(intent);
}
use of android.support.test.uiautomator.UiDevice in project android_frameworks_base by ResurrectionRemix.
the class Utils method rotateDevice.
public static void rotateDevice(Instrumentation instrumentation, int rotationMode) {
try {
UiDevice device = UiDevice.getInstance(instrumentation);
long startTime = System.currentTimeMillis();
switch(rotationMode) {
case ROTATION_MODE_NATURAL:
device.setOrientationNatural();
break;
case ROTATION_MODE_LEFT:
device.setOrientationLeft();
break;
case ROTATION_MODE_RIGHT:
device.setOrientationRight();
break;
default:
throw new RuntimeException("Unsupported rotation mode: " + rotationMode);
}
long toSleep = ROTATION_ANIMATION_TIME_FULL_SCREEN_MS - (System.currentTimeMillis() - startTime);
if (toSleep > 0) {
SystemClock.sleep(toSleep);
}
} catch (Exception e) {
throw new RuntimeException(e);
}
}
use of android.support.test.uiautomator.UiDevice in project android_frameworks_base by DirtyUnicorns.
the class Utils method rotateDevice.
public static void rotateDevice(Instrumentation instrumentation, int rotationMode) {
try {
UiDevice device = UiDevice.getInstance(instrumentation);
long startTime = System.currentTimeMillis();
switch(rotationMode) {
case ROTATION_MODE_NATURAL:
device.setOrientationNatural();
break;
case ROTATION_MODE_LEFT:
device.setOrientationLeft();
break;
case ROTATION_MODE_RIGHT:
device.setOrientationRight();
break;
default:
throw new RuntimeException("Unsupported rotation mode: " + rotationMode);
}
long toSleep = ROTATION_ANIMATION_TIME_FULL_SCREEN_MS - (System.currentTimeMillis() - startTime);
if (toSleep > 0) {
SystemClock.sleep(toSleep);
}
} catch (Exception e) {
throw new RuntimeException(e);
}
}
use of android.support.test.uiautomator.UiDevice in project android_frameworks_base by DirtyUnicorns.
the class FilesJankPerfTest method setUpInLoop.
public void setUpInLoop() {
final UiDevice device = UiDevice.getInstance(getInstrumentation());
final Context context = getInstrumentation().getTargetContext();
mRootsListBot = new RootsListBot(device, context, BOT_TIMEOUT);
mDirListBot = new DirectoryListBot(device, context, BOT_TIMEOUT);
final Intent intent = new Intent(context, FilesActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
mActivity = getInstrumentation().startActivitySync(intent);
}
use of android.support.test.uiautomator.UiDevice in project platform_frameworks_base by android.
the class FilesJankPerfTest method setUpInLoop.
public void setUpInLoop() {
final UiDevice device = UiDevice.getInstance(getInstrumentation());
final Context context = getInstrumentation().getTargetContext();
mRootsListBot = new RootsListBot(device, context, BOT_TIMEOUT);
mDirListBot = new DirectoryListBot(device, context, BOT_TIMEOUT);
final Intent intent = new Intent(context, FilesActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
mActivity = getInstrumentation().startActivitySync(intent);
}
Aggregations