From dd9399798b8be0df395e4da45daa035c6af1fa22 Mon Sep 17 00:00:00 2001 From: Geoff Brown Date: Thu, 2 Feb 2012 10:09:24 -0500 Subject: [PATCH] Bug 720930 - Robocop: update testBookmark to allow for zero bookmarks; r=jmaher --- mobile/android/base/tests/testBookmark.java.in | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mobile/android/base/tests/testBookmark.java.in b/mobile/android/base/tests/testBookmark.java.in index 2012c1ff1c3..ab890d083af 100644 --- a/mobile/android/base/tests/testBookmark.java.in +++ b/mobile/android/base/tests/testBookmark.java.in @@ -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 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); }