mobile/android/base/tests/testAboutPage.java

Wed, 31 Dec 2014 07:22:50 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:22:50 +0100
branch
TOR_BUG_3246
changeset 4
fc2d59ddac77
permissions
-rw-r--r--

Correct previous dual key logic pending first delivery installment.

     1 package org.mozilla.gecko.tests;
     3 import org.mozilla.gecko.Actions;
     4 import org.mozilla.gecko.Element;
     5 import org.mozilla.gecko.R;
     7 /* Tests related to the about: page:
     8  *  - check that about: loads from the URL bar
     9  *  - check that about: loads from Settings/About...
    10  */
    11 public class testAboutPage extends PixelTest {
    12     private void ensureTitleMatches(final String regex) {
    13         Element urlBarTitle = mDriver.findElement(getActivity(), R.id.url_bar_title);
    14         mAsserter.isnot(urlBarTitle, null, "Got the URL bar title");
    15         assertMatches(urlBarTitle.getText(), regex, "page title match");
    16     }
    18     public void testAboutPage() {
    19         blockForGeckoReady();
    21         // Load the about: page and verify its title.
    22         String url = "about:";
    23         loadAndPaint(url);
    25         ensureTitleMatches("About (Fennec|Nightly|Aurora|Firefox|Firefox Beta)");
    27         // Open a new page to remove the about: page from the current tab.
    28         url = getAbsoluteUrl("/robocop/robocop_blank_01.html");
    29         inputAndLoadUrl(url);
    31         // At this point the page title should have been set.
    32         ensureTitleMatches("Browser Blank Page 01");
    34         // Set up listeners to catch the page load we're about to do.
    35         Actions.EventExpecter tabEventExpecter = mActions.expectGeckoEvent("Tab:Added");
    36         Actions.EventExpecter contentEventExpecter = mActions.expectGeckoEvent("DOMContentLoaded");
    38         selectSettingsItem("Mozilla", "About (Fennec|Nightly|Aurora|Firefox|Firefox Beta)");
    40         // Wait for the new tab and page to load
    41         tabEventExpecter.blockForEvent();
    42         contentEventExpecter.blockForEvent();
    44         tabEventExpecter.unregisterListener();
    45         contentEventExpecter.unregisterListener();
    47         // Grab the title to make sure the about: page was loaded.
    48         ensureTitleMatches("About (Fennec|Nightly|Aurora|Firefox|Firefox Beta)");
    49     }
    50 }

mercurial