Bug 770461 - Robocop: improve diagnostics in testHistoryTab; r=jmaher
authorGeoff Brown <gbrown@mozilla.com>
Mon, 13 Aug 2012 12:11:12 -0600
changeset 102216 538c9b7000378e398ad36e49ef0aecff9aae359f
parent 102215 25949bac4b82e2425413c8b365816820c6931302
child 102225 743d539a61e385f08d967b3370b8c14baab7b2e8
push id13370
push usergbrown@mozilla.com
push dateMon, 13 Aug 2012 18:11:42 +0000
treeherdermozilla-inbound@538c9b700037 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher
bugs770461
milestone17.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 770461 - Robocop: improve diagnostics in testHistoryTab; r=jmaher
mobile/android/base/tests/testHistoryTab.java.in
--- a/mobile/android/base/tests/testHistoryTab.java.in
+++ b/mobile/android/base/tests/testHistoryTab.java.in
@@ -1,14 +1,15 @@
 #filter substitution
 package @ANDROID_PACKAGE_NAME@.tests;
 
 import @ANDROID_PACKAGE_NAME@.*;
 
 import android.app.Activity;
+import android.view.ViewGroup;
 import android.view.View;
 import android.widget.ListView;
 import android.widget.ExpandableListView;
 import android.widget.LinearLayout;
 import android.widget.TextView;
 import android.widget.ImageView;
 import android.widget.TabHost;
 import android.text.TextUtils;
@@ -123,21 +124,35 @@ public class testHistoryTab extends Base
         // clear VKB
         mActions.sendSpecialKey(Actions.SpecialKey.BACK);
         mSolo.waitForText(url);
 
         View child = list.getChildAt(0);
         mSolo.clickLongOnView(child);
         mAsserter.is(false, mSolo.waitForText("Open in New Tab"), "Header rows should not show a context menu");
 
+        // wait for the history list to be populated
         waitForTest(new BooleanTest() {
             public boolean test() {
                 if (list.getChildAt(1) == null) {
                     return false;
                 }
+                View firstChild = list.getChildAt(1);
+                if (firstChild instanceof android.view.ViewGroup) {
+                    ViewGroup group = (ViewGroup)firstChild;
+                    if (group.getChildCount() < 1) {
+                        return false;
+                    }
+                    for (int i = 0; i < group.getChildCount(); i++) {
+                        View grandChild = group.getChildAt(i);
+                        if (grandChild instanceof android.widget.TextView) {
+                            mAsserter.ok(true, "found TextView:", ((android.widget.TextView)grandChild).getText().toString());
+                        }
+                    }
+                }
                 return true;
             }
         }, WAIT_FOR_CHILD_TIMEOUT);
         child = list.getChildAt(1);
 
         mSolo.clickLongOnView(child);
 
         // TODO: Test clicking these does the right thing