Bug 948387 - Avoid intermittent NPE in testAddSearchEngine; r=wesj

This commit is contained in:
Geoff Brown 2014-02-04 23:47:00 -07:00
parent 8548aba581
commit bdae0d2fc6

View File

@ -136,7 +136,15 @@ public class testAddSearchEngine extends AboutHomeTest {
boolean correctNumSearchEnginesDisplayed = waitForTest(new BooleanTest() {
@Override
public boolean test() {
return (findListViewWithTag("browser_search").getAdapter().getCount() == expectedCount);
ListView list = findListViewWithTag("browser_search");
if (list == null) {
return false;
}
ListAdapter adapter = list.getAdapter();
if (adapter == null) {
return false;
}
return (adapter.getCount() == expectedCount);
}
}, MAX_WAIT_TEST_MS);