mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
42 lines
1.3 KiB
Java
42 lines
1.3 KiB
Java
#filter substitution
|
|
package @ANDROID_PACKAGE_NAME@.tests;
|
|
|
|
import @ANDROID_PACKAGE_NAME@.*;
|
|
import android.widget.TextView;
|
|
import android.os.SystemClock;
|
|
import java.util.ArrayList;
|
|
|
|
public class testBookmark extends BaseTest {
|
|
private static final long MAX_WAIT_MS = 10 * 1000;
|
|
|
|
public void testBookmark() {
|
|
setTestType("mochitest");
|
|
String url = getAbsoluteUrl("/robocop/robocop_blank_02.html");
|
|
enterUrl(url);
|
|
|
|
//Click the top item in the awesome list.
|
|
mActions.sendSpecialKey(Actions.SpecialKey.DOWN);
|
|
hitEnterAndWait();
|
|
|
|
//Click the top item in the bookmark list.
|
|
clickOnAwesomeBar();
|
|
mActions.sendSpecialKey(Actions.SpecialKey.RIGHT);
|
|
|
|
Actions.EventExpecter contentEventExpecter = mActions.expectGeckoEvent("DOMContentLoaded");
|
|
|
|
long waitStart = SystemClock.uptimeMillis();
|
|
ArrayList<TextView> l = null;
|
|
while (l == null || l.size() < 1) {
|
|
if (SystemClock.uptimeMillis() - waitStart > MAX_WAIT_MS) {
|
|
mAsserter.dumpLog("testBookmark: timed out waiting for bookmark list -- no bookmarks defined?");
|
|
return;
|
|
}
|
|
l = mSolo.clickInList(1);
|
|
}
|
|
|
|
contentEventExpecter.blockForEvent();
|
|
|
|
//Items in bookmarks aren't constant so URL can't be tested.
|
|
}
|
|
}
|