mobile/android/base/tests/testSessionHistory.java

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/mobile/android/base/tests/testSessionHistory.java	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,37 @@
     1.4 +package org.mozilla.gecko.tests;
     1.5 +
     1.6 +import org.mozilla.gecko.tests.helpers.GeckoHelper;
     1.7 +import org.mozilla.gecko.tests.helpers.NavigationHelper;
     1.8 +
     1.9 +/**
    1.10 + * Tests that navigating through session history (ex: forward, back) sets the correct UI state.
    1.11 + */
    1.12 +public class testSessionHistory extends UITest {
    1.13 +    public void testSessionHistory() {
    1.14 +        GeckoHelper.blockForReady();
    1.15 +
    1.16 +        NavigationHelper.enterAndLoadUrl(StringHelper.ROBOCOP_BLANK_PAGE_01_URL);
    1.17 +        mToolbar.assertTitle(StringHelper.ROBOCOP_BLANK_PAGE_01_TITLE);
    1.18 +
    1.19 +        NavigationHelper.enterAndLoadUrl(StringHelper.ROBOCOP_BLANK_PAGE_02_URL);
    1.20 +        mToolbar.assertTitle(StringHelper.ROBOCOP_BLANK_PAGE_02_TITLE);
    1.21 +
    1.22 +        NavigationHelper.enterAndLoadUrl(StringHelper.ROBOCOP_BLANK_PAGE_03_URL);
    1.23 +        mToolbar.assertTitle(StringHelper.ROBOCOP_BLANK_PAGE_03_TITLE);
    1.24 +
    1.25 +        NavigationHelper.goBack();
    1.26 +        mToolbar.assertTitle(StringHelper.ROBOCOP_BLANK_PAGE_02_TITLE);
    1.27 +
    1.28 +        NavigationHelper.goBack();
    1.29 +        mToolbar.assertTitle(StringHelper.ROBOCOP_BLANK_PAGE_01_TITLE);
    1.30 +
    1.31 +        NavigationHelper.goForward();
    1.32 +        mToolbar.assertTitle(StringHelper.ROBOCOP_BLANK_PAGE_02_TITLE);
    1.33 +
    1.34 +        // TODO: Implement this functionality and uncomment.
    1.35 +        /*
    1.36 +        NavigationHelper.reload();
    1.37 +        mToolbar.assertTitle(StringHelper.ROBOCOP_BLANK_PAGE_02_TITLE);
    1.38 +        */
    1.39 +    }
    1.40 +}

mercurial