Bug 720930 - Robocop: update testBookmark to allow for zero bookmarks; r=jmaher

This commit is contained in:
Geoff Brown 2012-02-02 10:09:24 -05:00
Родитель 74ace84ded
Коммит 44443b0495
1 изменённых файлов: 7 добавлений и 0 удалений

Просмотреть файл

@ -3,10 +3,12 @@ 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 String URL = "http://mochi.test:8888/tests/robocop/robocop_blank_02.html";
private static final long MAX_WAIT_MS = 10 * 1000;
public void testBookmark() {
enterUrl(URL);
@ -21,8 +23,13 @@ public class testBookmark extends BaseTest {
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);
}