Bug 823165 - fix robocop tests to work on panda boards. r=gbrown
--- a/mobile/android/base/tests/BaseTest.java.in
+++ b/mobile/android/base/tests/BaseTest.java.in
@@ -70,16 +70,21 @@ abstract class BaseTest extends Activity
public BaseTest() {
super(TARGET_PACKAGE_ID, mLauncherActivityClass);
}
protected abstract int getTestType();
@Override
protected void setUp() throws Exception {
+
+ // This is required for us to pass testBookmarklets, otherwise we fail either with
+ // StrictMode or something related to sending the ENTER key
+ int applicationFlags = getActivity().getApplicationInfo().flags;
+
// Load config file from root path (setup by python script)
String rootPath = FennecInstrumentationTestRunner.getArguments().getString("deviceroot");
String configFile = FennecNativeDriver.getFile(rootPath + "/robotium.config");
HashMap config = FennecNativeDriver.convertTextToTable(configFile);
// Create the intent to be used with all the important arguments.
Intent i = new Intent(Intent.ACTION_MAIN);
mProfile = (String)config.get("profile");
--- a/mobile/android/base/tests/testAwesomebarSwipes.java.in
+++ b/mobile/android/base/tests/testAwesomebarSwipes.java.in
@@ -29,20 +29,22 @@ public class testAwesomebarSwipes extend
mActions.expectGeckoEvent("Gecko:Ready").blockForEvent();
ListView list = getAllPagesList("about:firefox");
// Test normal sliding of the list left and right
ViewPager pager = (ViewPager)mSolo.getView(ViewPager.class, 0);
mAsserter.is(pager.getCurrentItem(), 0, "All pages is selected");
- mSolo.scrollToSide(Solo.RIGHT);
+ int midx = mDriver.getGeckoWidth() / 2;
+ int midy = mDriver.getGeckoHeight() / 2;
+ mActions.drag(midx, 0, midy, midy);
mAsserter.is(pager.getCurrentItem(), 1, "Bookmarks page is selected");
- mSolo.scrollToSide(Solo.LEFT);
+ mActions.drag(0, midx, midy, midy);
mAsserter.is(pager.getCurrentItem(), 0, "All pages is selected");
// Test tapping on the tab strip changes tabs
TabWidget tabwidget = (TabWidget)mSolo.getView(TabWidget.class, 0);
mSolo.clickOnView(tabwidget.getChildAt(1));
mAsserter.is(pager.getCurrentItem(), 1, "Clicking on tab selected bookmarks page");
// Test typing in the awesomebar changes tabs and prevents panning