mobile/android/base/tests/testTitleBar.java

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 package org.mozilla.gecko.tests;
     2 import org.mozilla.gecko.Actions;
     4 /**
     5  * This patch tests the option that shows the full URL and title in the URL Bar
     6  */
     8 public class testTitleBar extends PixelTest {
     9     public void testTitleBar() {
    10         blockForGeckoReady();
    11         checkOption();
    12     }
    14     public void checkOption() {
    16         String blank1 = getAbsoluteUrl(StringHelper.ROBOCOP_BLANK_PAGE_01_URL);
    17         String title = StringHelper.ROBOCOP_BLANK_PAGE_01_TITLE;
    19         // Loading a page
    20         inputAndLoadUrl(blank1);
    21         verifyPageTitle(title);
    23         // Verifing the full URL is displayed in the URL Bar
    24         selectOption(StringHelper.SHOW_PAGE_ADDRESS_LABEL);
    25         inputAndLoadUrl(blank1);
    26         verifyUrl(blank1);
    28         // Verifing the title is displayed in the URL Bar
    29         selectOption(StringHelper.SHOW_PAGE_TITLE_LABEL);
    30         inputAndLoadUrl(blank1);
    31         verifyPageTitle(title);
    32     }
    34     // Entering settings, changing the options: show title/page address option and verifing the device type because for phone there is an extra back action to exit the settings menu
    35     public void selectOption(String option) {
    36         selectSettingsItem(StringHelper.DISPLAY_SECTION_LABEL, StringHelper.TITLE_BAR_LABEL);
    37         mAsserter.ok(waitForText(StringHelper.SHOW_PAGE_TITLE_LABEL), "Waiting for the pop-up to open", "Pop up with the options was openend");
    38         mSolo.clickOnText(option);
    39         mAsserter.ok(waitForText(StringHelper.CHARACTER_ENCODING_LABEL), "Waiting to press the option", "The pop-up is dismissed once clicked");
    40         if (mDevice.type.equals("phone")) {
    41             mActions.sendSpecialKey(Actions.SpecialKey.BACK);
    42             mAsserter.ok(waitForText(StringHelper.CUSTOMIZE_SECTION_LABEL), "Waiting to perform one back", "One back performed");
    43             mActions.sendSpecialKey(Actions.SpecialKey.BACK);
    44             mAsserter.ok(waitForText(StringHelper.ROBOCOP_BLANK_PAGE_01_URL), "Waiting to exit settings", "Exit settings done");
    45         }
    46         else {
    47             mActions.sendSpecialKey(Actions.SpecialKey.BACK);
    48             mAsserter.ok(waitForText(StringHelper.ROBOCOP_BLANK_PAGE_01_URL), "Waiting to exit settings", "Exit settings done");
    49         }
    50     }
    51 }

mercurial