Bug 895816 - (Part 3) Update BaseTest.addTab to use loadUrl. r=gbrown
authorMargaret Leibovic <margaret.leibovic@gmail.com>
Tue, 23 Jul 2013 17:52:39 -0700
changeset 143439 a9f98a5f888fcca520241c13394ff04c427f05a9
parent 143438 77efbb48885d080af1a3618999ed005ae7bfdb75
child 143440 3c3c32abc33de134f2d08d1bb0e77420ed354a61
push id25130
push userlrocha@mozilla.com
push dateWed, 21 Aug 2013 09:41:27 +0000
treeherdermozilla-central@b2486721572e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
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 895816 - (Part 3) Update BaseTest.addTab to use loadUrl. r=gbrown
--- a/mobile/android/base/tests/BaseTest.java.in
+++ b/mobile/android/base/tests/BaseTest.java.in
@@ -60,20 +60,16 @@ abstract class BaseTest extends Activity
     protected static final int DEFAULT_BOOKMARKS_COUNT = DEFAULT_BOOKMARKS_TITLES.length;
     // IDs for UI views
     private static final String BROWSER_TOOLBAR_ID = "browser_toolbar";
     protected static final String URL_EDIT_TEXT_ID = "url_edit_text";
     protected static final String URL_BAR_TITLE_ID = "url_bar_title";
-    // Strings for about:home
-    private static final String TITLE_PLACEHOLDER_TEXT = "Enter Search or Address";
-    private static final String ABOUT_HOME_BOOKMARKS_TAB_TITLE = "BOOKMARKS";
     private static Class<Activity> mLauncherActivityClass;
     private Activity mActivity;
     protected Solo mSolo;
     protected Driver mDriver;
     protected Assert mAsserter;
     protected Actions mActions;
     protected String mBaseUrl;
     protected String mRawBaseUrl;
@@ -633,24 +629,19 @@ abstract class BaseTest extends Activity
                 if (addTabView == null) {
                     return false;
                 return true;
         }, MAX_WAIT_MS);
         mAsserter.ok(success, "waiting for add tab view", "add tab view available");
         mAsserter.ok(addTab.click(), "checking that add_tab clicked", "add_tab element clicked");
-        waitForText(ABOUT_HOME_BOOKMARKS_TAB_TITLE); // Make sure about:home is loaded
-        // The new tab will have a blank title, so click on the urlbar placeholder text
-        mSolo.clickOnText(TITLE_PLACEHOLDER_TEXT);
-        // cannot use loadUrl(): getText fails because we are using a different urlbar
-        mActions.sendKeys(url);
-        hitEnterAndWait();
+        // Adding a new tab opens about:home, so now we just need to load the url in it.
+        loadUrl(url);
     * This method parses the string received as event data from blockForEventData()
     * blockForEventData returns the data from a Gecko event as a string. 
     * The data contains tuples structured like this: "property":"value" separated by "," in most cases but this may vary
     * The method takes as input the event data string and a string of delimiters to parse after.
     * @return an ArrayList<String> with the 2*k (even) index the property and the 2k+1 (odd) index the value, 0<=k<=ArrayList.size()/2