Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | package org.mozilla.gecko.tests; |
michael@0 | 2 | |
michael@0 | 3 | import org.mozilla.gecko.tests.components.AboutHomeComponent.PanelType; |
michael@0 | 4 | import org.mozilla.gecko.tests.helpers.GeckoHelper; |
michael@0 | 5 | import org.mozilla.gecko.tests.helpers.NavigationHelper; |
michael@0 | 6 | |
michael@0 | 7 | /** |
michael@0 | 8 | * Tests the visibility of about:home after various interactions with the browser. |
michael@0 | 9 | */ |
michael@0 | 10 | public class testAboutHomeVisibility extends UITest { |
michael@0 | 11 | public void testAboutHomeVisibility() { |
michael@0 | 12 | GeckoHelper.blockForReady(); |
michael@0 | 13 | |
michael@0 | 14 | // Check initial state on about:home. |
michael@0 | 15 | mToolbar.assertTitle(StringHelper.ABOUT_HOME_TITLE); |
michael@0 | 16 | mAboutHome.assertVisible() |
michael@0 | 17 | .assertCurrentPanel(PanelType.TOP_SITES); |
michael@0 | 18 | |
michael@0 | 19 | // Go to blank 01. |
michael@0 | 20 | NavigationHelper.enterAndLoadUrl(StringHelper.ROBOCOP_BLANK_PAGE_01_URL); |
michael@0 | 21 | mToolbar.assertTitle(StringHelper.ROBOCOP_BLANK_PAGE_01_TITLE); |
michael@0 | 22 | mAboutHome.assertNotVisible(); |
michael@0 | 23 | |
michael@0 | 24 | // Go to blank 02. |
michael@0 | 25 | NavigationHelper.enterAndLoadUrl(StringHelper.ROBOCOP_BLANK_PAGE_02_URL); |
michael@0 | 26 | mToolbar.assertTitle(StringHelper.ROBOCOP_BLANK_PAGE_02_TITLE); |
michael@0 | 27 | mAboutHome.assertNotVisible(); |
michael@0 | 28 | |
michael@0 | 29 | // Enter editing mode, where the about:home UI should be visible. |
michael@0 | 30 | mToolbar.enterEditingMode(); |
michael@0 | 31 | mAboutHome.assertVisible() |
michael@0 | 32 | .assertCurrentPanel(PanelType.TOP_SITES); |
michael@0 | 33 | |
michael@0 | 34 | // Dismiss editing mode, where the about:home UI should be gone. |
michael@0 | 35 | mToolbar.dismissEditingMode(); |
michael@0 | 36 | mAboutHome.assertNotVisible(); |
michael@0 | 37 | |
michael@0 | 38 | // Loading about:home should show about:home again. |
michael@0 | 39 | NavigationHelper.enterAndLoadUrl(StringHelper.ABOUT_HOME_URL); |
michael@0 | 40 | mToolbar.assertTitle(StringHelper.ABOUT_HOME_TITLE); |
michael@0 | 41 | mAboutHome.assertVisible() |
michael@0 | 42 | .assertCurrentPanel(PanelType.TOP_SITES); |
michael@0 | 43 | |
michael@0 | 44 | // TODO: Type in a url and assert the go button is visible. |
michael@0 | 45 | } |
michael@0 | 46 | } |