Fields Summary |
---|
private static final long | TEST_DELAY_TIME_MS |
private static final long | PAGE_LOAD_DELAY_TIMEOUT_MS |
private static final long | PAGE_LOAD_DELAY_TIME_MS |
private static final int | MIN_DATA_SIZE |
private static final long | DEFAULT_ANIMATION_TIME |
private static final String | CHROMIUM_SHELL_APP |
private static final String | CHROMIUM_SHELL_ACTIVITY |
private static final String | AW_CONTAINER |
private android.support.test.uiautomator.UiDevice | mDevice |
private android.support.test.uiautomator.UiScrollable | mWebPageDisplay |
Methods Summary |
---|
public void | beforeLoop()
getContainer().flingToBeginning(20);
SystemClock.sleep(TEST_DELAY_TIME_MS);
|
private android.support.test.uiautomator.UiScrollable | getContainer()
if (mWebPageDisplay == null) {
mWebPageDisplay =
new UiScrollable(new UiSelector().resourceId(AW_CONTAINER).instance(0));
assertTrue("Failed to get web container",
mWebPageDisplay.waitForExists(PAGE_LOAD_DELAY_TIMEOUT_MS));
}
return mWebPageDisplay;
|
protected void | setUp(){@inheritDoc}
super.setUp();
mDevice = UiDevice.getInstance(getInstrumentation());
mDevice.setOrientationNatural();
// Get the URL argument
String url = getArguments().getString("Url");
File webpage = new File(url);
assertNotNull("No test pages", webpage);
// Launch the chromium shell
Intent intent = new Intent(Intent.ACTION_DEFAULT,
Uri.parse("file://" + webpage.getAbsolutePath()));
intent.setClassName(CHROMIUM_SHELL_APP, CHROMIUM_SHELL_ACTIVITY);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
getInstrumentation().getContext().startActivity(intent);
SystemClock.sleep(PAGE_LOAD_DELAY_TIME_MS);
|
protected void | tearDown(){@inheritDoc}
mDevice.unfreezeRotation();
super.tearDown();
|
public void | testBrowserPageFling()
getContainer().flingForward();
SystemClock.sleep(DEFAULT_ANIMATION_TIME);
|