2013-11-07 16:18:51 +00:00
|
|
|
package org.mozilla.gecko.tests;
|
2012-02-02 09:03:37 +00:00
|
|
|
|
2012-02-08 14:32:44 +00:00
|
|
|
public class testCheck extends PixelTest {
|
2012-02-09 11:37:17 +00:00
|
|
|
private void pause(int length) {
|
|
|
|
try {
|
|
|
|
Thread.sleep(length);
|
|
|
|
} catch (InterruptedException e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-06-27 23:56:49 +00:00
|
|
|
@Override
|
|
|
|
protected int getTestType() {
|
|
|
|
return TEST_TALOS;
|
|
|
|
}
|
|
|
|
|
2012-02-02 09:03:37 +00:00
|
|
|
public void testCheck() {
|
2012-03-23 15:58:06 +00:00
|
|
|
String url = getAbsoluteUrl("/startup_test/fennecmark/timecube.html");
|
2012-02-10 14:44:06 +00:00
|
|
|
|
2012-10-25 19:37:39 +00:00
|
|
|
blockForGeckoReady();
|
2012-02-10 14:44:06 +00:00
|
|
|
|
2012-02-08 14:32:44 +00:00
|
|
|
loadAndPaint(url);
|
2012-02-02 09:03:37 +00:00
|
|
|
|
|
|
|
mDriver.setupScrollHandling();
|
|
|
|
|
|
|
|
// Setup scrolling coordinates.
|
2012-03-23 15:58:06 +00:00
|
|
|
MotionEventHelper meh = new MotionEventHelper(getInstrumentation(), mDriver.getGeckoLeft(), mDriver.getGeckoTop());
|
|
|
|
int midX = mDriver.getGeckoWidth() / 2;
|
|
|
|
int height = mDriver.getGeckoHeight();
|
|
|
|
int topY = height / 8;
|
2012-02-02 09:03:37 +00:00
|
|
|
|
|
|
|
mDriver.startCheckerboardRecording();
|
|
|
|
|
2012-03-23 15:58:06 +00:00
|
|
|
// 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);
|
2012-02-09 11:37:17 +00:00
|
|
|
for (int j = 0; j < 3; j++) {
|
2012-03-23 15:58:06 +00:00
|
|
|
meh.dragSync(midX, botY, midX, topY, 200);
|
|
|
|
pause(1000);
|
2012-02-09 11:37:17 +00:00
|
|
|
}
|
|
|
|
for (int j = 0; j < 3; j++) {
|
2012-03-23 15:58:06 +00:00
|
|
|
meh.dragSync(midX, topY, midX, botY, 200);
|
|
|
|
pause(1000);
|
2012-02-02 09:03:37 +00:00
|
|
|
}
|
2012-03-23 15:58:06 +00:00
|
|
|
}
|
2012-02-02 09:03:37 +00:00
|
|
|
|
2012-02-09 11:37:17 +00:00
|
|
|
float completeness = mDriver.stopCheckerboardRecording();
|
|
|
|
mAsserter.dumpLog("__start_report" + completeness + "__end_report");
|
2012-02-02 09:03:37 +00:00
|
|
|
long msecs = System.currentTimeMillis();
|
|
|
|
mAsserter.dumpLog("__startTimestamp" + msecs + "__endTimestamp");
|
2012-02-09 11:37:17 +00:00
|
|
|
}
|
2012-02-02 09:03:37 +00:00
|
|
|
}
|