Methods Summary |
---|
private void | flingForward()
getContainer().flingForward();
|
private com.android.uiautomator.core.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;
|
private void | loadUrl(java.lang.String url)
Runtime.getRuntime().exec(START_CMD + url);
// Need to find a good way of detecting when the page is loaded
sleep(PAGE_LOAD_DELAY_TIME_MS);
|
private void | resetFlingTest()
getContainer().flingToBeginning(20);
|
private void | runBrowserPageFling(java.io.File testFile)
loadUrl("file://" + testFile.getAbsolutePath());
for (int i = 0; i < getIteration(); i++) {
resetFlingTest();
sleep(TEST_DELAY_TIME_MS);
startTrace(mTestCaseName, i);
getSurfaceFlingerHelper().clearBuffer(AW_WINDOW_NAME);
flingForward();
sleep(DEFAULT_ANIMATION_TIME);
boolean result =
getSurfaceFlingerHelper().dumpFrameLatency(AW_WINDOW_NAME, true);
assertTrue("dump frame latency failed", result);
waitForTrace();
assertTrue(String.format("Sample size is less than expected: %d", MIN_DATA_SIZE),
validateResults(MIN_DATA_SIZE));
// record the result in an array
recordResults(mTestCaseName, i);
}
// calculate average and save the results
saveResults(mTestCaseName);
|
protected void | setUp(){@inheritDoc}
super.setUp();
getUiDevice().setOrientationNatural();
|
protected void | tearDown(){@inheritDoc}
getUiDevice().unfreezeRotation();
super.tearDown();
|
public void | testBrowserPageFling()
String url = mParams.getString("Url");
File webpage = new File(url);
assertNotNull("No test pages", webpage);
runBrowserPageFling(webpage);
|