Bug 823165 - fix robocop tests to work on panda boards. r=gbrown
☠☠ backed out by 8a7b7f1ac53a ☠ ☠
authorJoel Maher <jmaher@mozilla.com>
Thu, 20 Dec 2012 09:25:38 -0500
changeset 116632 1e2283f6856c629369358bbbe4f9b6f53192ba0f
parent 116631 d26d1029180071fb03b59c7e2d16810ec6e33113
child 116633 91dae828764356a04eda7c4a41bef0c28d01944d
push idunknown
push userunknown
push dateunknown
reviewersgbrown
bugs823165
milestone20.0a1
Bug 823165 - fix robocop tests to work on panda boards. r=gbrown
mobile/android/base/tests/BaseTest.java.in
mobile/android/base/tests/testAwesomebarSwipes.java.in
--- 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