mobile/android/base/tests/testAboutHomeVisibility.java

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 package org.mozilla.gecko.tests;
     3 import org.mozilla.gecko.tests.components.AboutHomeComponent.PanelType;
     4 import org.mozilla.gecko.tests.helpers.GeckoHelper;
     5 import org.mozilla.gecko.tests.helpers.NavigationHelper;
     7 /**
     8  * Tests the visibility of about:home after various interactions with the browser.
     9  */
    10 public class testAboutHomeVisibility extends UITest {
    11     public void testAboutHomeVisibility() {
    12         GeckoHelper.blockForReady();
    14         // Check initial state on about:home.
    15         mToolbar.assertTitle(StringHelper.ABOUT_HOME_TITLE);
    16         mAboutHome.assertVisible()
    17                   .assertCurrentPanel(PanelType.TOP_SITES);
    19         // Go to blank 01.
    20         NavigationHelper.enterAndLoadUrl(StringHelper.ROBOCOP_BLANK_PAGE_01_URL);
    21         mToolbar.assertTitle(StringHelper.ROBOCOP_BLANK_PAGE_01_TITLE);
    22         mAboutHome.assertNotVisible();
    24         // Go to blank 02.
    25         NavigationHelper.enterAndLoadUrl(StringHelper.ROBOCOP_BLANK_PAGE_02_URL);
    26         mToolbar.assertTitle(StringHelper.ROBOCOP_BLANK_PAGE_02_TITLE);
    27         mAboutHome.assertNotVisible();
    29         // Enter editing mode, where the about:home UI should be visible.
    30         mToolbar.enterEditingMode();
    31         mAboutHome.assertVisible()
    32                   .assertCurrentPanel(PanelType.TOP_SITES);
    34         // Dismiss editing mode, where the about:home UI should be gone.
    35         mToolbar.dismissEditingMode();
    36         mAboutHome.assertNotVisible();
    38         // Loading about:home should show about:home again.
    39         NavigationHelper.enterAndLoadUrl(StringHelper.ABOUT_HOME_URL);
    40         mToolbar.assertTitle(StringHelper.ABOUT_HOME_TITLE);
    41         mAboutHome.assertVisible()
    42                   .assertCurrentPanel(PanelType.TOP_SITES);
    44         // TODO: Type in a url and assert the go button is visible.
    45     }
    46 }

mercurial