Bug 738556 - Improve testCheck to use a variety of scroll amounts and more reliable dragging code. r=Cwiiis

This commit is contained in:
Kartikaya Gupta 2012-03-23 11:58:06 -04:00
parent ce173a94c6
commit afd6aa338a

View File

@ -14,7 +14,7 @@ public class testCheck extends PixelTest {
public void testCheck() {
setTestType("talos");
String url = getAbsoluteUrl("/startup_test/fennecmark/wikipedia.html");
String url = getAbsoluteUrl("/startup_test/fennecmark/timecube.html");
mActions.expectGeckoEvent("Gecko:Ready").blockForEvent();
@ -23,26 +23,26 @@ public class testCheck extends PixelTest {
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()/6;
MotionEventHelper meh = new MotionEventHelper(getInstrumentation(), mDriver.getGeckoLeft(), mDriver.getGeckoTop());
int midX = mDriver.getGeckoWidth() / 2;
int height = mDriver.getGeckoHeight();
int topY = height / 8;
mDriver.startCheckerboardRecording();
int i = 0;
// Scroll repeatedly downwards, then upwards. This test should take
// approximately 15 seconds.
do {
// Scroll repeatedly downwards, then upwards. On each iteration of i,
// increase the scroll distance to test different scroll amounts.
for (int i = 2; i < 7; i++) {
int botY = (height * i / 8);
for (int j = 0; j < 3; j++) {
mActions.drag(midX, midX, midY, endY);
pause(500);
meh.dragSync(midX, botY, midX, topY, 200);
pause(1000);
}
for (int j = 0; j < 3; j++) {
mActions.drag(midX, midX, endY, midY);
pause(500);
meh.dragSync(midX, topY, midX, botY, 200);
pause(1000);
}
i++;
} while (i < 5);
}
float completeness = mDriver.stopCheckerboardRecording();
mAsserter.dumpLog("__start_report" + completeness + "__end_report");