Backed out changesets 59c761f6c0eb and 132f861349a2 (bug 1075531) for robocop bustage.

This commit is contained in:
Ryan VanderMeulen 2014-10-10 17:14:20 -04:00
parent 733a4ca774
commit c0404ea95a
22 changed files with 77 additions and 146 deletions

View File

@ -25,7 +25,6 @@ import org.mozilla.gecko.GeckoEvent;
import org.mozilla.gecko.GeckoProfile;
import org.mozilla.gecko.GeckoThread;
import org.mozilla.gecko.GeckoThread.LaunchState;
import org.mozilla.gecko.NewTabletUI;
import org.mozilla.gecko.R;
import org.mozilla.gecko.RobocopUtils;
import org.mozilla.gecko.Tab;
@ -69,8 +68,6 @@ abstract class BaseTest extends BaseRobocopTest {
private static final int GECKO_READY_WAIT_MS = 180000;
public static final int MAX_WAIT_BLOCK_FOR_EVENT_DATA_MS = 90000;
private static final String URL_HTTP_PREFIX = "http://";
private Activity mActivity;
private int mPreferenceRequestID = 0;
protected Solo mSolo;
@ -449,7 +446,7 @@ abstract class BaseTest extends BaseRobocopTest {
}
/**
/**
* Select <item> from Menu > "Settings" > <section>.
*/
public void selectSettingsItem(String section, String item) {
@ -507,25 +504,7 @@ abstract class BaseTest extends BaseRobocopTest {
}
}
public final void verifyPageTitle(final String title, String url) {
// We are asserting visible state - we shouldn't know if the title is null.
mAsserter.isnot(title, null, "The title argument is not null");
mAsserter.isnot(url, null, "The url argument is not null");
// TODO: We should also check the title bar preference.
final String expected;
if (!NewTabletUI.isEnabled(mActivity)) {
expected = title;
} else {
if (StringHelper.ABOUT_HOME_URL.equals(url)) {
expected = StringHelper.ABOUT_HOME_TITLE;
} else if (url.startsWith(URL_HTTP_PREFIX)) {
expected = url.substring(URL_HTTP_PREFIX.length());
} else {
expected = url;
}
}
public final void verifyPageTitle(String title) {
final TextView urlBarTitle = (TextView) mSolo.getView(R.id.url_bar_title);
String pageTitle = null;
if (urlBarTitle != null) {
@ -534,7 +513,7 @@ abstract class BaseTest extends BaseRobocopTest {
waitForCondition(new VerifyTextViewText(urlBarTitle, title), MAX_WAIT_VERIFY_PAGE_TITLE_MS);
pageTitle = urlBarTitle.getText().toString();
}
mAsserter.is(pageTitle, expected, "Page title is correct");
mAsserter.is(pageTitle, title, "Page title is correct");
}
public final void verifyTabCount(int expectedTabCount) {
@ -956,7 +935,7 @@ abstract class BaseTest extends BaseRobocopTest {
public void setPreferenceAndWaitForChange(final JSONObject jsonPref) {
mActions.sendGeckoEvent("Preferences:Set", jsonPref.toString());
// Get the preference name from the json and store it in an array. This array
// Get the preference name from the json and store it in an array. This array
// will be used later while fetching the preference data.
String[] prefNames = new String[1];
try {

View File

@ -197,7 +197,7 @@ public abstract class SessionTest extends BaseTest {
verifyUrl(page.url);
} else {
waitForText(page.title);
verifyPageTitle(page.title, page.url);
verifyPageTitle(page.title);
}
}

View File

@ -9,12 +9,9 @@ import static org.mozilla.gecko.tests.helpers.AssertionHelper.fAssertFalse;
import static org.mozilla.gecko.tests.helpers.AssertionHelper.fAssertNotNull;
import static org.mozilla.gecko.tests.helpers.AssertionHelper.fAssertTrue;
import org.mozilla.gecko.NewTabletUI;
import org.mozilla.gecko.R;
import org.mozilla.gecko.tests.StringHelper;
import org.mozilla.gecko.tests.UITestContext;
import org.mozilla.gecko.tests.helpers.DeviceHelper;
import org.mozilla.gecko.tests.helpers.NavigationHelper;
import org.mozilla.gecko.tests.helpers.WaitHelper;
import android.view.View;
@ -29,9 +26,6 @@ import com.jayway.android.robotium.solo.Solo;
* A class representing any interactions that take place on the Toolbar.
*/
public class ToolbarComponent extends BaseComponent {
private static final String URL_HTTP_PREFIX = "http://";
public ToolbarComponent(final UITestContext testContext) {
super(testContext);
}
@ -46,26 +40,7 @@ public class ToolbarComponent extends BaseComponent {
return this;
}
public ToolbarComponent assertTitle(final String title, final String url) {
// We are asserting visible state - we shouldn't know if the title is null.
fAssertNotNull("The title argument is not null", title);
fAssertNotNull("The url argument is not null", url);
// TODO: We should also check the title bar preference.
final String expected;
if (!NewTabletUI.isEnabled(mActivity)) {
expected = title;
} else {
final String absoluteURL = NavigationHelper.adjustUrl(url);
if (StringHelper.ABOUT_HOME_URL.equals(absoluteURL)) {
expected = StringHelper.ABOUT_HOME_TITLE;
} else if (absoluteURL.startsWith(URL_HTTP_PREFIX)) {
expected = absoluteURL.substring(URL_HTTP_PREFIX.length());
} else {
expected = absoluteURL;
}
}
public ToolbarComponent assertTitle(final String expected) {
fAssertEquals("The Toolbar title is " + expected, expected, getTitle());
return this;
}
@ -116,7 +91,7 @@ public class ToolbarComponent extends BaseComponent {
return (ImageButton) getToolbarView().findViewById(R.id.edit_cancel);
}
private String getTitle() {
private CharSequence getTitle() {
return getTitleHelper(true);
}
@ -125,16 +100,16 @@ public class ToolbarComponent extends BaseComponent {
* may return a value that may never be visible to the user. Callers likely want to use
* {@link assertTitle} instead.
*/
public String getPotentiallyInconsistentTitle() {
public CharSequence getPotentiallyInconsistentTitle() {
return getTitleHelper(false);
}
private String getTitleHelper(final boolean shouldAssertNotEditing) {
private CharSequence getTitleHelper(final boolean shouldAssertNotEditing) {
if (shouldAssertNotEditing) {
assertIsNotEditing();
}
return getUrlTitleText().getText().toString();
return getUrlTitleText().getText();
}
private boolean isEditing() {

View File

@ -44,7 +44,7 @@ final public class NavigationHelper {
/**
* Returns a new URL with the docshell HTTP server host prefix.
*/
public static String adjustUrl(final String url) {
private static String adjustUrl(final String url) {
fAssertNotNull("url is not null", url);
if (url.startsWith("about:") || url.startsWith("chrome:")) {

View File

@ -13,20 +13,18 @@ public class testAboutHomeVisibility extends UITest {
GeckoHelper.blockForReady();
// Check initial state on about:home.
mToolbar.assertTitle(StringHelper.ABOUT_HOME_TITLE, StringHelper.ABOUT_HOME_URL);
mToolbar.assertTitle(StringHelper.ABOUT_HOME_TITLE);
mAboutHome.assertVisible()
.assertCurrentPanel(PanelType.TOP_SITES);
// Go to blank 01.
NavigationHelper.enterAndLoadUrl(StringHelper.ROBOCOP_BLANK_PAGE_01_URL);
mToolbar.assertTitle(StringHelper.ROBOCOP_BLANK_PAGE_01_TITLE,
StringHelper.ROBOCOP_BLANK_PAGE_01_URL);
mToolbar.assertTitle(StringHelper.ROBOCOP_BLANK_PAGE_01_TITLE);
mAboutHome.assertNotVisible();
// Go to blank 02.
NavigationHelper.enterAndLoadUrl(StringHelper.ROBOCOP_BLANK_PAGE_02_URL);
mToolbar.assertTitle(StringHelper.ROBOCOP_BLANK_PAGE_02_TITLE,
StringHelper.ROBOCOP_BLANK_PAGE_02_URL);
mToolbar.assertTitle(StringHelper.ROBOCOP_BLANK_PAGE_02_TITLE);
mAboutHome.assertNotVisible();
// Enter editing mode, where the about:home UI should be visible.
@ -40,7 +38,7 @@ public class testAboutHomeVisibility extends UITest {
// Loading about:home should show about:home again.
NavigationHelper.enterAndLoadUrl(StringHelper.ABOUT_HOME_URL);
mToolbar.assertTitle(StringHelper.ABOUT_HOME_TITLE, StringHelper.ABOUT_HOME_URL);
mToolbar.assertTitle(StringHelper.ABOUT_HOME_TITLE);
mAboutHome.assertVisible()
.assertCurrentPanel(PanelType.TOP_SITES);
@ -51,5 +49,7 @@ public class testAboutHomeVisibility extends UITest {
mAboutHome.navigateToBuiltinPanelType(PanelType.HISTORY)
.assertVisible()
.assertCurrentPanel(PanelType.HISTORY);
// TODO: Type in a url and assert the go button is visible.
}
}

View File

@ -2,41 +2,34 @@ package org.mozilla.gecko.tests;
import org.mozilla.gecko.Actions;
import org.mozilla.gecko.Element;
import org.mozilla.gecko.NewTabletUI;
import org.mozilla.gecko.R;
import android.app.Activity;
/* Tests related to the about: page:
* - check that about: loads from the URL bar
* - check that about: loads from Settings/About...
*/
public class testAboutPage extends PixelTest {
private void ensureTitleMatches(final String titleRegex, final String urlRegex) {
final Activity activity = getActivity();
final Element urlBarTitle = mDriver.findElement(activity, R.id.url_bar_title);
// TODO: We should also be testing what the page title preference value is.
final String expectedTitle = NewTabletUI.isEnabled(activity) ? urlRegex : titleRegex;
private void ensureTitleMatches(final String regex) {
Element urlBarTitle = mDriver.findElement(getActivity(), R.id.url_bar_title);
mAsserter.isnot(urlBarTitle, null, "Got the URL bar title");
assertMatches(urlBarTitle.getText(), expectedTitle, "page title match");
assertMatches(urlBarTitle.getText(), regex, "page title match");
}
public void testAboutPage() {
blockForGeckoReady();
// Load the about: page and verify its title.
String url = StringHelper.ABOUT_SCHEME;
String url = "about:";
loadAndPaint(url);
verifyPageTitle(StringHelper.ABOUT_LABEL, url);
ensureTitleMatches(StringHelper.ABOUT_LABEL);
// Open a new page to remove the about: page from the current tab.
url = getAbsoluteUrl(StringHelper.ROBOCOP_BLANK_PAGE_01_URL);
inputAndLoadUrl(url);
// At this point the page title should have been set.
verifyPageTitle(StringHelper.ROBOCOP_BLANK_PAGE_01_TITLE, url);
ensureTitleMatches(StringHelper.ROBOCOP_BLANK_PAGE_01_TITLE);
// Set up listeners to catch the page load we're about to do.
Actions.EventExpecter tabEventExpecter = mActions.expectGeckoEvent("Tab:Added");
@ -52,6 +45,6 @@ public class testAboutPage extends PixelTest {
contentEventExpecter.unregisterListener();
// Grab the title to make sure the about: page was loaded.
verifyPageTitle(StringHelper.ABOUT_LABEL, StringHelper.ABOUT_SCHEME);
ensureTitleMatches(StringHelper.ABOUT_LABEL);
}
}

View File

@ -61,7 +61,7 @@ public class testAddSearchEngine extends AboutHomeTest {
// Load the page for the search engine to add.
inputAndLoadUrl(searchEngineURL);
waitForText(StringHelper.ROBOCOP_SEARCH_TITLE);
verifyPageTitle(StringHelper.ROBOCOP_SEARCH_TITLE, searchEngineURL);
verifyPageTitle(StringHelper.ROBOCOP_SEARCH_TITLE);
// Used to long-tap on the search input box for the search engine to add.
getInstrumentation().waitForIdleSync();
@ -99,7 +99,7 @@ public class testAddSearchEngine extends AboutHomeTest {
mAsserter.dumpLog("Search Engines list = " + searchEngines.toString());
mAsserter.is(searchEngines.size(), initialNumSearchEngines + 1, "Checking the number of Search Engines has increased");
// Verify that the number of displayed searchengines is the same as the one received through the SearchEngines:Data event.
verifyDisplayedSearchEnginesCount(initialNumSearchEngines + 1);
searchEngineDataEventExpector.unregisterListener();
@ -151,7 +151,7 @@ public class testAddSearchEngine extends AboutHomeTest {
return (adapter.getCount() == expectedCount);
}
}, MAX_WAIT_TEST_MS);
// Exit about:home
mActions.sendSpecialKey(Actions.SpecialKey.BACK);
waitForText(StringHelper.ROBOCOP_BLANK_PAGE_01_TITLE);

View File

@ -17,7 +17,7 @@ public class testAddonManager extends PixelTest {
public void testAddonManager() {
Actions.EventExpecter tabEventExpecter;
Actions.EventExpecter contentEventExpecter;
final String aboutAddonsURL = StringHelper.ABOUT_ADDONS_URL;
String url = StringHelper.ABOUT_ADDONS_URL;
blockForGeckoReady();
@ -36,22 +36,21 @@ public class testAddonManager extends PixelTest {
contentEventExpecter.unregisterListener();
// Verify the url
verifyPageTitle(StringHelper.ADDONS_LABEL, aboutAddonsURL);
verifyPageTitle(StringHelper.ADDONS_LABEL);
// Close the Add-on Manager
mActions.sendSpecialKey(Actions.SpecialKey.BACK);
// Load the about:addons page and verify it was loaded
loadAndPaint(aboutAddonsURL);
verifyPageTitle(StringHelper.ADDONS_LABEL, aboutAddonsURL);
loadAndPaint(url);
verifyPageTitle(StringHelper.ADDONS_LABEL);
// Setup wait for tab to spawn and load
tabEventExpecter = mActions.expectGeckoEvent("Tab:Added");
contentEventExpecter = mActions.expectGeckoEvent("DOMContentLoaded");
// Open a new tab
final String blankURL = getAbsoluteUrl(StringHelper.ROBOCOP_BLANK_PAGE_01_URL);
addTab(blankURL);
addTab(getAbsoluteUrl(StringHelper.ROBOCOP_BLANK_PAGE_01_URL));
// Wait for the new tab and page to load
tabEventExpecter.blockForEvent();
@ -64,7 +63,7 @@ public class testAddonManager extends PixelTest {
verifyTabCount(2);
// Verify the page was opened
verifyPageTitle(StringHelper.ROBOCOP_BLANK_PAGE_01_TITLE, blankURL);
verifyPageTitle(StringHelper.ROBOCOP_BLANK_PAGE_01_TITLE);
// Addons Manager is not opened 2 separate times when opened from the menu
selectMenuItem(StringHelper.ADDONS_LABEL);

View File

@ -48,8 +48,7 @@ public class testAppMenuPathways extends UITest {
// The above mock video playback test changes Java state, but not the associated JS state.
// Navigate to a new page so that the Java state is cleared.
NavigationHelper.enterAndLoadUrl(StringHelper.ROBOCOP_BLANK_PAGE_01_URL);
mToolbar.assertTitle(StringHelper.ROBOCOP_BLANK_PAGE_01_TITLE,
StringHelper.ROBOCOP_BLANK_PAGE_01_URL);
mToolbar.assertTitle(StringHelper.ROBOCOP_BLANK_PAGE_01_TITLE);
// Test save as pdf functionality.
// The following call doesn't wait for the resulting pdf but checks that no exception are thrown.

View File

@ -32,8 +32,7 @@ public class testBookmark extends AboutHomeTest {
isBookmarkDisplayed(BOOKMARK_URL);
loadBookmark(BOOKMARK_URL);
waitForText(StringHelper.ROBOCOP_BLANK_PAGE_01_TITLE);
verifyPageTitle(StringHelper.ROBOCOP_BLANK_PAGE_01_TITLE,
StringHelper.ROBOCOP_BLANK_PAGE_01_URL);
verifyPageTitle(StringHelper.ROBOCOP_BLANK_PAGE_01_TITLE);
mDatabaseHelper.deleteBookmark(BOOKMARK_URL);
waitForBookmarked(false);

View File

@ -52,7 +52,7 @@ public class testBookmarkFolders extends AboutHomeTest {
// Open the bookmark from a bookmark folder hierarchy
loadBookmark(DESKTOP_BOOKMARK_URL);
waitForText(StringHelper.ROBOCOP_BLANK_PAGE_02_TITLE);
verifyPageTitle(StringHelper.ROBOCOP_BLANK_PAGE_02_TITLE, DESKTOP_BOOKMARK_URL);
verifyPageTitle(StringHelper.ROBOCOP_BLANK_PAGE_02_TITLE);
openAboutHomeTab(AboutHomeTabs.BOOKMARKS);
// Check that folders don't have a context menu

View File

@ -19,8 +19,7 @@ public class testBookmarkKeyword extends AboutHomeTest {
waitForText(StringHelper.ROBOCOP_BLANK_PAGE_01_TITLE);
// Make sure the title of the page appeared.
verifyPageTitle(StringHelper.ROBOCOP_BLANK_PAGE_01_TITLE,
StringHelper.ROBOCOP_BLANK_PAGE_01_URL);
verifyPageTitle(StringHelper.ROBOCOP_BLANK_PAGE_01_TITLE);
// Delete the bookmark to clean up.
mDatabaseHelper.deleteBookmark(url);

View File

@ -18,9 +18,7 @@ public class testBookmarklets extends AboutHomeTest {
// load a standard page so bookmarklets work
inputAndLoadUrl(url);
// Waiting for page title to ensure the page is loaded
verifyPageTitle(StringHelper.ROBOCOP_BLANK_PAGE_01_TITLE,
StringHelper.ROBOCOP_BLANK_PAGE_01_URL);
verifyPageTitle(StringHelper.ROBOCOP_BLANK_PAGE_01_TITLE); // Waiting for page title to ensure the page is loaded
// verify that user-entered bookmarklets do *not* work
enterUrl(js);

View File

@ -30,14 +30,14 @@ public class testClearPrivateData extends PixelTest {
String blank2 = getAbsoluteUrl(StringHelper.ROBOCOP_BLANK_PAGE_02_URL);
String title = StringHelper.ROBOCOP_BLANK_PAGE_01_TITLE;
inputAndLoadUrl(blank1);
verifyPageTitle(title, blank1);
verifyPageTitle(title);
mDatabaseHelper.addOrUpdateMobileBookmark(StringHelper.ROBOCOP_BLANK_PAGE_02_TITLE, blank2);
// Checking that the history list is not empty
verifyHistoryCount(1);
//clear and check for device
checkDevice(title, blank1);
checkDevice(title);
// Checking that history list is empty
verifyHistoryCount(0);
@ -64,7 +64,7 @@ public class testClearPrivateData extends PixelTest {
checkOption(shareStrings[3], "Cancel");
loadCheckDismiss(shareStrings[2], url, shareStrings[0]);
checkOption(shareStrings[2], "Cancel");
checkDevice(titleGeolocation, url);
checkDevice(titleGeolocation);
}
public void clearPassword(){
@ -74,20 +74,24 @@ public class testClearPrivateData extends PixelTest {
loadCheckDismiss(passwordStrings[1], loginUrl, passwordStrings[0]);
checkOption(passwordStrings[1], "Clear");
loadCheckDismiss(passwordStrings[2], loginUrl, passwordStrings[0]);
checkDevice(title, getAbsoluteUrl(StringHelper.ROBOCOP_BLANK_PAGE_01_URL));
checkDevice(title);
}
// clear private data and verify the device type because for phone there is an extra back action to exit the settings menu
public void checkDevice(final String title, final String url) {
public void checkDevice(String title) {
clearPrivateData();
if (mDevice.type.equals("phone")) {
mActions.sendSpecialKey(Actions.SpecialKey.BACK);
mAsserter.ok(waitForText(StringHelper.PRIVACY_SECTION_LABEL), "waiting to perform one back", "one back");
mActions.sendSpecialKey(Actions.SpecialKey.BACK);
verifyPageTitle(title);
}
else {
mActions.sendSpecialKey(Actions.SpecialKey.BACK);
verifyPageTitle(title);
}
mActions.sendSpecialKey(Actions.SpecialKey.BACK);
verifyPageTitle(title, url);
}
// Load a URL, verify that the doorhanger appears and dismiss it
public void loadCheckDismiss(String option, String url, String message) {
inputAndLoadUrl(url);

View File

@ -17,11 +17,11 @@ public class testHistory extends AboutHomeTest {
String url3 = getAbsoluteUrl(StringHelper.ROBOCOP_BLANK_PAGE_03_URL);
inputAndLoadUrl(url);
verifyPageTitle(StringHelper.ROBOCOP_BLANK_PAGE_01_URL, url);
verifyPageTitle(StringHelper.ROBOCOP_BLANK_PAGE_01_URL);
inputAndLoadUrl(url2);
verifyPageTitle(StringHelper.ROBOCOP_BLANK_PAGE_02_URL, url2);
verifyPageTitle(StringHelper.ROBOCOP_BLANK_PAGE_02_URL);
inputAndLoadUrl(url3);
verifyPageTitle(StringHelper.ROBOCOP_BLANK_PAGE_03_URL, url3);
verifyPageTitle(StringHelper.ROBOCOP_BLANK_PAGE_03_URL);
openAboutHomeTab(AboutHomeTabs.HISTORY);
@ -62,7 +62,7 @@ public class testHistory extends AboutHomeTest {
// The first item here (since it was just visited) should be a "Switch to tab" item
// i.e. don't expect a DOMCOntentLoaded event
verifyPageTitle(StringHelper.ROBOCOP_BLANK_PAGE_03_URL, StringHelper.ROBOCOP_BLANK_PAGE_03_URL);
verifyPageTitle(StringHelper.ROBOCOP_BLANK_PAGE_03_URL);
verifyUrl(url3);
}
}

View File

@ -24,9 +24,8 @@ public class testInputConnection extends UITest {
public void testInputConnection() throws InterruptedException {
GeckoHelper.blockForReady();
final String url = StringHelper.ROBOCOP_INPUT_URL + "#" + INITIAL_TEXT;
NavigationHelper.enterAndLoadUrl(url);
mToolbar.assertTitle(StringHelper.ROBOCOP_INPUT_TITLE, url);
NavigationHelper.enterAndLoadUrl(StringHelper.ROBOCOP_INPUT_URL + "#" + INITIAL_TEXT);
mToolbar.assertTitle(StringHelper.ROBOCOP_INPUT_TITLE);
mGeckoView.mTextInput
.waitForInputConnection()

View File

@ -18,7 +18,7 @@ public class testPictureLinkContextMenu extends ContentContextMenuTest {
PICTURE_PAGE_URL=getAbsoluteUrl(StringHelper.ROBOCOP_PICTURE_LINK_URL);
BLANK_PAGE_URL=getAbsoluteUrl(StringHelper.ROBOCOP_BLANK_PAGE_02_URL);
loadAndPaint(PICTURE_PAGE_URL);
verifyPageTitle(PICTURE_PAGE_TITLE, PICTURE_PAGE_URL);
verifyPageTitle(PICTURE_PAGE_TITLE);
switchTabs(imageTitle);
verifyContextMenuItems(photoMenuItems);

View File

@ -73,7 +73,7 @@ public class testReaderMode extends AboutHomeTest {
contentPageShowExpecter.unregisterListener();
paintExpecter.blockUntilClear(EVENT_CLEAR_DELAY_MS);
paintExpecter.unregisterListener();
verifyPageTitle(StringHelper.ROBOCOP_TEXT_PAGE_TITLE, StringHelper.ROBOCOP_TEXT_PAGE_URL);
verifyPageTitle(StringHelper.ROBOCOP_TEXT_PAGE_TITLE);
// Open the share menu for the reader toolbar
height = mDriver.getGeckoTop() + mDriver.getGeckoHeight() - 10;
@ -134,7 +134,7 @@ public class testReaderMode extends AboutHomeTest {
mSolo.clickOnView(child);
contentEventExpecter.blockForEvent();
contentEventExpecter.unregisterListener();
verifyPageTitle(StringHelper.ROBOCOP_TEXT_PAGE_TITLE, StringHelper.ROBOCOP_TEXT_PAGE_URL);
verifyPageTitle(StringHelper.ROBOCOP_TEXT_PAGE_TITLE);
// Verify that we are in reader mode and remove the page from Reading List
height = mDriver.getGeckoTop() + mDriver.getGeckoHeight() - 10;
@ -142,7 +142,7 @@ public class testReaderMode extends AboutHomeTest {
mAsserter.dumpLog("Long Clicking at width = " + String.valueOf(width) + " and height = " + String.valueOf(height));
mSolo.clickOnScreen(width,height);
mAsserter.ok(mSolo.waitForText("Page removed from your Reading List"), "Waiting for the page to removed from your Reading List", "The page is removed from your Reading List");
verifyPageTitle(StringHelper.ROBOCOP_TEXT_PAGE_TITLE, StringHelper.ROBOCOP_TEXT_PAGE_URL);
verifyPageTitle(StringHelper.ROBOCOP_TEXT_PAGE_TITLE);
//Check if the Reading List is empty
openAboutHomeTab(AboutHomeTabs.READING_LIST);

View File

@ -16,9 +16,8 @@ public class testSelectionHandler extends UITest {
GeckoHelper.blockForReady();
Actions.EventExpecter robocopTestExpecter = getActions().expectGeckoEvent("Robocop:testSelectionHandler");
final String url = "chrome://roboextender/content/testSelectionHandler.html";
NavigationHelper.enterAndLoadUrl(url);
mToolbar.assertTitle(StringHelper.ROBOCOP_SELECTION_HANDLER_TITLE, url);
NavigationHelper.enterAndLoadUrl("chrome://roboextender/content/testSelectionHandler.html");
mToolbar.assertTitle(StringHelper.ROBOCOP_SELECTION_HANDLER_TITLE);
while (!test(robocopTestExpecter)) {
// do nothing

View File

@ -10,32 +10,25 @@ public class testSessionHistory extends UITest {
public void testSessionHistory() {
GeckoHelper.blockForReady();
String url = StringHelper.ROBOCOP_BLANK_PAGE_01_URL;
NavigationHelper.enterAndLoadUrl(url);
mToolbar.assertTitle(StringHelper.ROBOCOP_BLANK_PAGE_01_TITLE, url);
NavigationHelper.enterAndLoadUrl(StringHelper.ROBOCOP_BLANK_PAGE_01_URL);
mToolbar.assertTitle(StringHelper.ROBOCOP_BLANK_PAGE_01_TITLE);
url = StringHelper.ROBOCOP_BLANK_PAGE_02_URL;
NavigationHelper.enterAndLoadUrl(url);
mToolbar.assertTitle(StringHelper.ROBOCOP_BLANK_PAGE_02_TITLE, url);
NavigationHelper.enterAndLoadUrl(StringHelper.ROBOCOP_BLANK_PAGE_02_URL);
mToolbar.assertTitle(StringHelper.ROBOCOP_BLANK_PAGE_02_TITLE);
url = StringHelper.ROBOCOP_BLANK_PAGE_03_URL;
NavigationHelper.enterAndLoadUrl(url);
mToolbar.assertTitle(StringHelper.ROBOCOP_BLANK_PAGE_03_TITLE, url);
NavigationHelper.enterAndLoadUrl(StringHelper.ROBOCOP_BLANK_PAGE_03_URL);
mToolbar.assertTitle(StringHelper.ROBOCOP_BLANK_PAGE_03_TITLE);
NavigationHelper.goBack();
mToolbar.assertTitle(StringHelper.ROBOCOP_BLANK_PAGE_02_TITLE,
StringHelper.ROBOCOP_BLANK_PAGE_02_URL);
mToolbar.assertTitle(StringHelper.ROBOCOP_BLANK_PAGE_02_TITLE);
NavigationHelper.goBack();
mToolbar.assertTitle(StringHelper.ROBOCOP_BLANK_PAGE_01_TITLE,
StringHelper.ROBOCOP_BLANK_PAGE_01_URL);
mToolbar.assertTitle(StringHelper.ROBOCOP_BLANK_PAGE_01_TITLE);
NavigationHelper.goForward();
mToolbar.assertTitle(StringHelper.ROBOCOP_BLANK_PAGE_02_TITLE,
StringHelper.ROBOCOP_BLANK_PAGE_02_URL);
mToolbar.assertTitle(StringHelper.ROBOCOP_BLANK_PAGE_02_TITLE);
NavigationHelper.reload();
mToolbar.assertTitle(StringHelper.ROBOCOP_BLANK_PAGE_02_TITLE,
StringHelper.ROBOCOP_BLANK_PAGE_02_URL);
mToolbar.assertTitle(StringHelper.ROBOCOP_BLANK_PAGE_02_TITLE);
}
}

View File

@ -37,7 +37,7 @@ public class testShareLink extends AboutHomeTest {
openAboutHomeTab(AboutHomeTabs.READING_LIST);
inputAndLoadUrl(url);
verifyPageTitle(urlTitle, url); // Waiting for page title to ensure the page is loaded
verifyPageTitle(urlTitle); // Waiting for page title to ensure the page is loaded
selectMenuItem(StringHelper.SHARE_LABEL);
if (Build.VERSION.SDK_INT >= 14) {
@ -248,7 +248,7 @@ public class testShareLink extends AboutHomeTest {
public boolean test() {
ArrayList<View> views = mSolo.getCurrentViews();
for (View view : views) {
// List may be displayed in different view formats.
// List may be displayed in different view formats.
// On JB, GridView is common; on ICS-, ListView is common.
if (view instanceof ListView ||
view instanceof GridView) {

View File

@ -1,6 +1,5 @@
package org.mozilla.gecko.tests;
import org.mozilla.gecko.Actions;
import org.mozilla.gecko.NewTabletUI;
/**
* This patch tests the option that shows the full URL and title in the URL Bar
@ -8,22 +7,18 @@ import org.mozilla.gecko.NewTabletUI;
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 (NewTabletUI.isEnabled(getActivity())) {
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);
verifyPageTitle(title, blank1);
verifyPageTitle(title);
// Verifing the full URL is displayed in the URL Bar
selectOption(StringHelper.SHOW_PAGE_ADDRESS_LABEL);
@ -33,7 +28,7 @@ public class testTitleBar extends PixelTest {
// Verifing the title is displayed in the URL Bar
selectOption(StringHelper.SHOW_PAGE_TITLE_LABEL);
inputAndLoadUrl(blank1);
verifyPageTitle(title, blank1);
verifyPageTitle(title);
}
// 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