Bug 1118835 - Add back (and update) testTitleBar. r=mfinkle
authorMargaret Leibovic <margaret.leibovic@gmail.com>
Wed, 07 Jan 2015 12:13:48 -0800
changeset 248437 6c10a8ad2e7b1cb518b8821fa721d539a126add3
parent 248436 cce47fbfe2fc2da35bae34f5def3cd1f08fc7768
child 248438 4b1ab47fec937d83893a14de5097e9cb728cea2d
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs1118835
milestone37.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1118835 - Add back (and update) testTitleBar. r=mfinkle
mobile/android/base/tests/robocop.ini
mobile/android/base/tests/testTitleBar.java
--- a/mobile/android/base/tests/robocop.ini
+++ b/mobile/android/base/tests/robocop.ini
@@ -88,16 +88,19 @@ skip-if = android_version == "10"
 [testSettingsMenuItems]
 # disabled on Android 2.3; bug 979552
 skip-if = android_version == "10"
 # [testShareLink] # see bug 915897
 [testSystemPages]
 # disabled on x86 and 2.3; bug 907383, 979603
 skip-if = android_version == "10" || processor == "x86"
 # [testThumbnails] # see bug 813107
+[testTitleBar]
+# disabled on Android 2.3; bug 979552
+skip-if = android_version == "10"
 # [testVkbOverlap] # see bug 907274
 
 # Using JavascriptTest
 [testAccounts]
 [testAndroidLog]
 [testBrowserDiscovery]
 [testDebuggerServer]
 [testDeviceSearchEngine]
new file mode 100644
--- /dev/null
+++ b/mobile/android/base/tests/testTitleBar.java
@@ -0,0 +1,58 @@
+package org.mozilla.gecko.tests;
+
+import org.mozilla.gecko.Actions;
+import org.mozilla.gecko.util.HardwareUtils;
+
+/**
+ * This patch tests the option that shows the full URL and title in the URL Bar
+ */
+
+public class testTitleBar extends PixelTest {
+    public void testTitleBar() {
+        // Because there is no title bar option on new tablet, we don't need to run this test.
+        if (HardwareUtils.isTablet()) {
+            return;
+        }
+
+        blockForGeckoReady();
+        checkOption();
+    }
+
+    public void checkOption() {
+
+        String blank1 = getAbsoluteUrl(StringHelper.ROBOCOP_BLANK_PAGE_01_URL);
+        String title = StringHelper.ROBOCOP_BLANK_PAGE_01_TITLE;
+
+        // Loading a page
+        inputAndLoadUrl(blank1);
+        verifyUrlBarTitle(blank1);
+
+        // Ensure the title is displayed in the URL Bar
+        selectOption(StringHelper.SHOW_PAGE_TITLE_LABEL);
+        inputAndLoadUrl(blank1);
+        verifyUrlBarTitle(title);
+
+        // Ensure the full URL is displayed in the URL Bar
+        selectOption(StringHelper.SHOW_PAGE_ADDRESS_LABEL);
+        inputAndLoadUrl(blank1);
+        verifyUrlBarTitle(blank1);
+    }
+
+    // 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
+    public void selectOption(String option) {
+        selectSettingsItem(StringHelper.DISPLAY_SECTION_LABEL, StringHelper.TITLE_BAR_LABEL);
+        mAsserter.ok(waitForText(StringHelper.SHOW_PAGE_TITLE_LABEL), "Waiting for the pop-up to open", "Pop up with the options was openend");
+        mSolo.clickOnText(option);
+        mAsserter.ok(waitForText(StringHelper.CHARACTER_ENCODING_LABEL), "Waiting to press the option", "The pop-up is dismissed once clicked");
+        if (mDevice.type.equals("phone")) {
+            mActions.sendSpecialKey(Actions.SpecialKey.BACK);
+            mAsserter.ok(waitForText(StringHelper.CUSTOMIZE_SECTION_LABEL), "Waiting to perform one back", "One back performed");
+            mActions.sendSpecialKey(Actions.SpecialKey.BACK);
+            mAsserter.ok(waitForText(StringHelper.ROBOCOP_BLANK_PAGE_01_URL), "Waiting to exit settings", "Exit settings done");
+        }
+        else {
+            mActions.sendSpecialKey(Actions.SpecialKey.BACK);
+            mAsserter.ok(waitForText(StringHelper.ROBOCOP_BLANK_PAGE_01_URL), "Waiting to exit settings", "Exit settings done");
+        }
+    }
+}