2013-11-07 08:18:51 -08:00
|
|
|
package org.mozilla.gecko.tests;
|
2012-02-11 21:52:59 -08:00
|
|
|
|
2013-11-07 08:18:51 -08:00
|
|
|
import org.mozilla.gecko.*;
|
2012-02-11 21:52:59 -08:00
|
|
|
|
2012-09-18 09:36:40 -07:00
|
|
|
/* Tests related to the about: page:
|
2013-07-18 16:02:48 -07:00
|
|
|
* - check that about: loads from the URL bar
|
2012-09-18 09:36:40 -07:00
|
|
|
* - check that about: loads from Settings/About...
|
|
|
|
*/
|
2012-08-23 08:20:42 -07:00
|
|
|
public class testAboutPage extends PixelTest {
|
2012-06-27 16:56:49 -07:00
|
|
|
@Override
|
|
|
|
protected int getTestType() {
|
|
|
|
return TEST_MOCHITEST;
|
|
|
|
}
|
|
|
|
|
2013-12-03 20:21:33 -08:00
|
|
|
private void ensureTitleMatches(final String regex) {
|
|
|
|
Element urlBarTitle = mDriver.findElement(getActivity(), URL_BAR_TITLE_ID);
|
|
|
|
mAsserter.isnot(urlBarTitle, null, "Got the URL bar title");
|
|
|
|
assertMatches(urlBarTitle.getText(), regex, "page title match");
|
|
|
|
}
|
|
|
|
|
2012-02-11 21:52:59 -08:00
|
|
|
public void testAboutPage() {
|
2012-10-25 12:37:39 -07:00
|
|
|
blockForGeckoReady();
|
2012-02-11 21:52:59 -08:00
|
|
|
|
2013-12-03 20:21:33 -08:00
|
|
|
// Load the about: page and verify its title.
|
2012-02-11 21:52:59 -08:00
|
|
|
String url = "about:";
|
2012-08-23 08:20:42 -07:00
|
|
|
loadAndPaint(url);
|
2012-02-11 21:52:59 -08:00
|
|
|
|
2013-12-03 20:21:33 -08:00
|
|
|
ensureTitleMatches("About (Fennec|Nightly|Aurora|Firefox|Firefox Beta)");
|
2012-02-11 21:52:59 -08:00
|
|
|
|
2013-12-03 20:21:33 -08:00
|
|
|
// Open a new page to remove the about: page from the current tab.
|
2012-02-11 21:52:59 -08:00
|
|
|
url = getAbsoluteUrl("/robocop/robocop_blank_01.html");
|
2013-08-19 13:33:49 -07:00
|
|
|
inputAndLoadUrl(url);
|
2012-02-11 21:52:59 -08:00
|
|
|
|
2013-12-03 20:21:33 -08:00
|
|
|
// At this point the page title should have been set.
|
|
|
|
ensureTitleMatches("Browser Blank Page 01");
|
|
|
|
|
|
|
|
// Set up listeners to catch the page load we're about to do.
|
2012-03-23 08:43:10 -07:00
|
|
|
Actions.EventExpecter tabEventExpecter = mActions.expectGeckoEvent("Tab:Added");
|
|
|
|
Actions.EventExpecter contentEventExpecter = mActions.expectGeckoEvent("DOMContentLoaded");
|
|
|
|
|
2013-06-26 10:57:52 -07:00
|
|
|
selectSettingsItem("Mozilla", "About (Fennec|Nightly|Aurora|Firefox|Firefox Beta)");
|
2012-02-11 21:52:59 -08:00
|
|
|
|
|
|
|
// Wait for the new tab and page to load
|
2012-03-23 08:43:10 -07:00
|
|
|
tabEventExpecter.blockForEvent();
|
|
|
|
contentEventExpecter.blockForEvent();
|
2012-02-11 21:52:59 -08:00
|
|
|
|
2013-04-18 20:18:09 -07:00
|
|
|
tabEventExpecter.unregisterListener();
|
|
|
|
contentEventExpecter.unregisterListener();
|
|
|
|
|
2013-12-03 20:21:33 -08:00
|
|
|
// Grab the title to make sure the about: page was loaded.
|
|
|
|
ensureTitleMatches("About (Fennec|Nightly|Aurora|Firefox|Firefox Beta)");
|
2012-02-11 21:52:59 -08:00
|
|
|
}
|
|
|
|
}
|