2011-12-16 19:27:52 +00:00
|
|
|
#filter substitution
|
|
|
|
package @ANDROID_PACKAGE_NAME@.tests;
|
|
|
|
|
|
|
|
import @ANDROID_PACKAGE_NAME@.*;
|
|
|
|
|
2012-01-05 15:20:22 +00:00
|
|
|
public class testPan extends BaseTest {
|
2012-01-05 15:20:22 +00:00
|
|
|
private static final String URL = "http://mochi.test:8888/startup_test/fenncmark/wikipedia.html";
|
|
|
|
|
2012-01-05 15:20:22 +00:00
|
|
|
public void testPan() {
|
2012-01-05 15:20:22 +00:00
|
|
|
loadUrl(URL);
|
|
|
|
|
2012-01-05 15:20:22 +00:00
|
|
|
mDriver.setupScrollHandling();
|
|
|
|
|
|
|
|
// Setup scrolling coordinates.
|
|
|
|
int midX = mDriver.getGeckoLeft() + mDriver.getGeckoWidth()/2;
|
|
|
|
int midY = mDriver.getGeckoTop() + mDriver.getGeckoHeight()/2;
|
|
|
|
int endY = mDriver.getGeckoTop() + mDriver.getGeckoHeight()/10;
|
|
|
|
|
|
|
|
mDriver.startFrameRecording();
|
|
|
|
|
|
|
|
int i = 0;
|
|
|
|
// Scroll a thousand times or until the end of the page.
|
|
|
|
do {
|
|
|
|
mActions.drag(midX, midX, midY, endY);
|
|
|
|
try {
|
|
|
|
Thread.sleep(200);
|
|
|
|
} catch (InterruptedException e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
}
|
|
|
|
i++;
|
|
|
|
} while (i < 1000 && mDriver.getScrollHeight() + 2 * mDriver.getHeight() < mDriver.getPageHeight());
|
|
|
|
// asserter.ok(i < 1000, "Less than 1000", "Should take less than 1000 drags to get to bottom of the page.");
|
|
|
|
|
|
|
|
int frames = mDriver.stopFrameRecording();
|
|
|
|
mDriver.dumpLog("__start_report" + Integer.toString(frames) + "__end_report");
|
2012-01-05 15:20:22 +00:00
|
|
|
long msecs = System.currentTimeMillis();
|
|
|
|
mDriver.dumpLog("__startTimestamp" + msecs + "__endTimestamp");
|
2011-12-16 19:27:52 +00:00
|
|
|
}
|
|
|
|
}
|