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