Bug 870056 - Use BaseTest.mDevice and selectSettingsItem in robocop tests; r=jmaher

This commit is contained in:
Geoff Brown 2013-05-15 13:47:26 -06:00
parent d7a446f1c4
commit f3b514f3c9
6 changed files with 9 additions and 34 deletions

View File

@ -28,29 +28,11 @@ public class testAboutPage extends PixelTest {
url = getAbsoluteUrl("/robocop/robocop_blank_01.html");
loadUrl(url);
// Use the menu to open the Settings
mActions.sendSpecialKey(Actions.SpecialKey.MENU);
// Look for the 'More' menu if this device/OS uses it
if (mSolo.waitForText("^More$")) {
mAsserter.dumpLog("found More item in menu");
mSolo.clickOnText("^More$");
}
if (mSolo.waitForText("^Settings$")) {
mAsserter.dumpLog("found Settings item in menu");
}
mSolo.clickOnText("^Settings$");
// Set up listeners to catch the page load we're about to do
Actions.EventExpecter tabEventExpecter = mActions.expectGeckoEvent("Tab:Added");
Actions.EventExpecter contentEventExpecter = mActions.expectGeckoEvent("DOMContentLoaded");
// Tap on the "About Xxxx" setting
if (mSolo.waitForText("About (Fennec|Nightly|Aurora|Firefox|Firefox Beta)")) {
mAsserter.dumpLog("found About... title text");
}
mSolo.clickOnText("About (Fennec|Nightly|Aurora|Firefox|Firefox Beta)");
selectSettingsItem("General", "About (Fennec|Nightly|Aurora|Firefox|Firefox Beta)");
// Wait for the new tab and page to load
tabEventExpecter.blockForEvent();

View File

@ -51,8 +51,7 @@ public class testAddSearchEngine extends BaseTest {
// Add the search engine
mSolo.clickOnText("Add Search Engine");
waitForText("Cancel");
Device device = new Device();
if (device.version.equals("4.x")) {
if (mDevice.version.equals("4.x")) {
// If the OS is ICS the vkb is opened when the popup is triggered so we need to close it in order to click the OK button
mActions.sendSpecialKey(Actions.SpecialKey.BACK);
waitForText("OK"); // Make sure the OK button is visible

View File

@ -80,11 +80,8 @@ public class testSystemPages extends PixelTest {
verifyUrl(expectedUrls[i]);
} else {
// Make sure the about: page was loaded without opening a new tab and verify the page Url
selectMenuItem(item);
waitForText("About");
paintExpecter = mActions.expectPaint(); // Set up listener to catch the page load
mSolo.clickOnText("About");
selectSettingsItem("General", "About (Fennec|Nightly|Aurora|Firefox|Firefox Beta)");
waitForPaint(paintExpecter); // Waiting for the page to load
paintExpecter.unregisterListener();

View File

@ -26,12 +26,11 @@ public class testTabHistory extends PixelTest {
loadAndPaint(url3);
// Get the device information and create the navigation for it
Device device = new Device();
Navigation nav = new Navigation(device);
mAsserter.dumpLog("device type: "+device.type);
mAsserter.dumpLog("device version: "+device.version);
mAsserter.dumpLog("device width: "+device.width);
mAsserter.dumpLog("device height: "+device.height);
Navigation nav = new Navigation(mDevice);
mAsserter.dumpLog("device type: "+mDevice.type);
mAsserter.dumpLog("device version: "+mDevice.version);
mAsserter.dumpLog("device width: "+mDevice.width);
mAsserter.dumpLog("device height: "+mDevice.height);
// Go to the 2nd page
nav.back();

View File

@ -22,11 +22,10 @@ public class testVkbOverlap extends PixelTest {
}
public void testVkbOverlap() {
Device device = new Device();
blockForGeckoReady();
testSetup("initial-scale=1.0, user-scalable=no", false);
testSetup("initial-scale=1.0", false);
testSetup("", "phone".equals(device.type));
testSetup("", "phone".equals(mDevice.type));
}
private void testSetup(String viewport, boolean shouldZoom) {

View File

@ -107,7 +107,6 @@ public class testWebContentContextMenu extends PixelTest {
}
else {
if (opt.equals("Bookmark Link")) {
Device mDevice = new Device();
Navigation nav = new Navigation(mDevice);
accessSection(0, opt, urls);