mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 874985 - Part 1: Robustify existing test methods. r=gbrown
This commit is contained in:
parent
1bcc3feb09
commit
7b3c098ad0
@ -674,15 +674,22 @@ abstract class BaseTest extends ActivityInstrumentationTestCase2<Activity> {
|
||||
}
|
||||
|
||||
public void back() {
|
||||
Actions.EventExpecter pageShowExpecter = mActions.expectGeckoEvent("Content:PageShow");
|
||||
|
||||
if (devType.equals("tablet")) {
|
||||
Element backBtn = mDriver.findElement(getActivity(), "back");
|
||||
backBtn.click();
|
||||
} else {
|
||||
mActions.sendSpecialKey(Actions.SpecialKey.BACK);
|
||||
}
|
||||
|
||||
pageShowExpecter.blockForEvent();
|
||||
pageShowExpecter.unregisterListener();
|
||||
}
|
||||
|
||||
public void forward() {
|
||||
Actions.EventExpecter pageShowExpecter = mActions.expectGeckoEvent("Content:PageShow");
|
||||
|
||||
if (devType.equals("tablet")) {
|
||||
Element fwdBtn = mDriver.findElement(getActivity(), "forward");
|
||||
fwdBtn.click();
|
||||
@ -695,7 +702,11 @@ abstract class BaseTest extends ActivityInstrumentationTestCase2<Activity> {
|
||||
} else {
|
||||
mSolo.clickOnText("^Forward$");
|
||||
}
|
||||
ensureMenuClosed();
|
||||
}
|
||||
|
||||
pageShowExpecter.blockForEvent();
|
||||
pageShowExpecter.unregisterListener();
|
||||
}
|
||||
|
||||
public void reload() {
|
||||
@ -711,6 +722,7 @@ abstract class BaseTest extends ActivityInstrumentationTestCase2<Activity> {
|
||||
} else {
|
||||
mSolo.clickOnText("^Reload$");
|
||||
}
|
||||
ensureMenuClosed();
|
||||
}
|
||||
}
|
||||
|
||||
@ -729,6 +741,15 @@ abstract class BaseTest extends ActivityInstrumentationTestCase2<Activity> {
|
||||
bookmarkBtn.click();
|
||||
}
|
||||
}
|
||||
ensureMenuClosed();
|
||||
}
|
||||
|
||||
// On some devices, the menu may not be dismissed after clicking on an
|
||||
// item. Close it here.
|
||||
private void ensureMenuClosed() {
|
||||
if (mSolo.searchText("^New Tab$")) {
|
||||
mActions.sendSpecialKey(Actions.SpecialKey.BACK);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user