gecko/mobile/android/base/tests/testAboutHomeVisibility.java
Nick Alexander 6f48237bf6 Bug 1063750 - Part 4: Test navigating to about:home?panel= URLs. r=mcomella
There are no consumers of this (that I can see) in the tree, so we need
to test that it doesn't go away.
2014-10-07 16:53:30 -07:00

56 lines
2.2 KiB
Java

package org.mozilla.gecko.tests;
import org.mozilla.gecko.home.HomeConfig;
import org.mozilla.gecko.home.HomeConfig.PanelType;
import org.mozilla.gecko.tests.helpers.GeckoHelper;
import org.mozilla.gecko.tests.helpers.NavigationHelper;
/**
* Tests the visibility of about:home after various interactions with the browser.
*/
public class testAboutHomeVisibility extends UITest {
public void testAboutHomeVisibility() {
GeckoHelper.blockForReady();
// Check initial state on about:home.
mToolbar.assertTitle(StringHelper.ABOUT_HOME_TITLE);
mAboutHome.assertVisible()
.assertCurrentPanel(PanelType.TOP_SITES);
// Go to blank 01.
NavigationHelper.enterAndLoadUrl(StringHelper.ROBOCOP_BLANK_PAGE_01_URL);
mToolbar.assertTitle(StringHelper.ROBOCOP_BLANK_PAGE_01_TITLE);
mAboutHome.assertNotVisible();
// Go to blank 02.
NavigationHelper.enterAndLoadUrl(StringHelper.ROBOCOP_BLANK_PAGE_02_URL);
mToolbar.assertTitle(StringHelper.ROBOCOP_BLANK_PAGE_02_TITLE);
mAboutHome.assertNotVisible();
// Enter editing mode, where the about:home UI should be visible.
mToolbar.enterEditingMode();
mAboutHome.assertVisible()
.assertCurrentPanel(PanelType.TOP_SITES);
// Dismiss editing mode, where the about:home UI should be gone.
mToolbar.dismissEditingMode();
mAboutHome.assertNotVisible();
// Loading about:home should show about:home again.
NavigationHelper.enterAndLoadUrl(StringHelper.ABOUT_HOME_URL);
mToolbar.assertTitle(StringHelper.ABOUT_HOME_TITLE);
mAboutHome.assertVisible()
.assertCurrentPanel(PanelType.TOP_SITES);
// We can navigate to about:home panels by panel UUID.
mAboutHome.navigateToBuiltinPanelType(PanelType.BOOKMARKS)
.assertVisible()
.assertCurrentPanel(PanelType.BOOKMARKS);
mAboutHome.navigateToBuiltinPanelType(PanelType.HISTORY)
.assertVisible()
.assertCurrentPanel(PanelType.HISTORY);
// TODO: Type in a url and assert the go button is visible.
}
}