gecko-dev/mobile/android/base/tests/testAwesomebar.java.in

35 lines
1010 B
Java

#filter substitution
package @ANDROID_PACKAGE_NAME@.tests;
import @ANDROID_PACKAGE_NAME@.*;
public class testAwesomebar extends BaseTest {
@Override
protected int getTestType() {
return TEST_MOCHITEST;
}
public void testAwesomebar() {
mActions.expectGeckoEvent("Gecko:Ready").blockForEvent();
String url = getAbsoluteUrl("/robocop/robocop_blank_01.html");
loadUrl(url);
mDriver.setupScrollHandling();
// Calculate where we should be dragging.
int midX = mDriver.getGeckoLeft() + mDriver.getGeckoWidth()/2;
int midY = mDriver.getGeckoTop() + mDriver.getGeckoHeight()/2;
int endY = mDriver.getGeckoTop() + mDriver.getGeckoHeight()/10;
for (int i = 0; i < 10; i++) {
mActions.drag(midX, midX, midY, endY);
try {
Thread.sleep(200);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
verifyUrl(url);
}
}