mobile/android/base/tests/testAboutHomeVisibility.java

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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