michael@0: package org.mozilla.gecko.tests; michael@0: import org.mozilla.gecko.Actions; michael@0: michael@0: /** michael@0: * This patch tests the option that shows the full URL and title in the URL Bar michael@0: */ michael@0: michael@0: public class testTitleBar extends PixelTest { michael@0: public void testTitleBar() { michael@0: blockForGeckoReady(); michael@0: checkOption(); michael@0: } michael@0: michael@0: public void checkOption() { michael@0: michael@0: String blank1 = getAbsoluteUrl(StringHelper.ROBOCOP_BLANK_PAGE_01_URL); michael@0: String title = StringHelper.ROBOCOP_BLANK_PAGE_01_TITLE; michael@0: michael@0: // Loading a page michael@0: inputAndLoadUrl(blank1); michael@0: verifyPageTitle(title); michael@0: michael@0: // Verifing the full URL is displayed in the URL Bar michael@0: selectOption(StringHelper.SHOW_PAGE_ADDRESS_LABEL); michael@0: inputAndLoadUrl(blank1); michael@0: verifyUrl(blank1); michael@0: michael@0: // Verifing the title is displayed in the URL Bar michael@0: selectOption(StringHelper.SHOW_PAGE_TITLE_LABEL); michael@0: inputAndLoadUrl(blank1); michael@0: verifyPageTitle(title); michael@0: } michael@0: michael@0: // 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 michael@0: public void selectOption(String option) { michael@0: selectSettingsItem(StringHelper.DISPLAY_SECTION_LABEL, StringHelper.TITLE_BAR_LABEL); michael@0: mAsserter.ok(waitForText(StringHelper.SHOW_PAGE_TITLE_LABEL), "Waiting for the pop-up to open", "Pop up with the options was openend"); michael@0: mSolo.clickOnText(option); michael@0: mAsserter.ok(waitForText(StringHelper.CHARACTER_ENCODING_LABEL), "Waiting to press the option", "The pop-up is dismissed once clicked"); michael@0: if (mDevice.type.equals("phone")) { michael@0: mActions.sendSpecialKey(Actions.SpecialKey.BACK); michael@0: mAsserter.ok(waitForText(StringHelper.CUSTOMIZE_SECTION_LABEL), "Waiting to perform one back", "One back performed"); michael@0: mActions.sendSpecialKey(Actions.SpecialKey.BACK); michael@0: mAsserter.ok(waitForText(StringHelper.ROBOCOP_BLANK_PAGE_01_URL), "Waiting to exit settings", "Exit settings done"); michael@0: } michael@0: else { michael@0: mActions.sendSpecialKey(Actions.SpecialKey.BACK); michael@0: mAsserter.ok(waitForText(StringHelper.ROBOCOP_BLANK_PAGE_01_URL), "Waiting to exit settings", "Exit settings done"); michael@0: } michael@0: } michael@0: }