Bug 966788 - Increase wait time for Gecko:Ready; r=mcomella
authorGeoff Brown <gbrown@mozilla.com>
Wed, 12 Mar 2014 17:44:54 -0600
changeset 191514 8ddc66a8d92975bc841b5225a7962fa8b1224f15
parent 191447 4647aa53d2868dda962cc86f82ea9614cdd32a96
child 191515 0d44ffa10368dcf7f8fd11c0b3d78e918066b119
push id474
push userasasaki@mozilla.com
push dateMon, 02 Jun 2014 21:01:02 +0000
treeherdermozilla-release@967f4cf1b31c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcomella
bugs966788
milestone30.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 966788 - Increase wait time for Gecko:Ready; r=mcomella
build/mobile/robocop/Actions.java
build/mobile/robocop/FennecNativeActions.java
mobile/android/base/tests/BaseTest.java
--- a/build/mobile/robocop/Actions.java
+++ b/build/mobile/robocop/Actions.java
@@ -10,16 +10,17 @@ public interface Actions {
     /** Special keys supported by sendSpecialKey() */
     public enum SpecialKey {
         DOWN, UP, LEFT, RIGHT, ENTER, MENU, BACK
     }
 
     public interface EventExpecter {
         /** Blocks until the event has been received. Subsequent calls will return immediately. */
         public void blockForEvent();
+        public void blockForEvent(long millis, boolean failOnTimeout);
 
         /** Blocks until the event has been received and returns data associated with the event. */
         public String blockForEventData();
 
         /**
          * Blocks until the event has been received, or until the timeout has been exceeded.
          * Returns the data associated with the event, if applicable.
          */
--- a/build/mobile/robocop/FennecNativeActions.java
+++ b/build/mobile/robocop/FennecNativeActions.java
@@ -75,17 +75,17 @@ public class FennecNativeActions impleme
             GeckoAppShell.registerEventListener(mGeckoEvent, mListener);
             mIsRegistered = true;
         }
 
         public void blockForEvent() {
             blockForEvent(MAX_WAIT_MS, true);
         }
 
-        private void blockForEvent(long millis, boolean failOnTimeout) {
+        public void blockForEvent(long millis, boolean failOnTimeout) {
             if (!mIsRegistered) {
                 throw new IllegalStateException("listener not registered");
             }
 
             try {
                 mEventData = mEventDataQueue.poll(millis, TimeUnit.MILLISECONDS);
             } catch (InterruptedException ie) {
                 FennecNativeDriver.log(LogLevel.ERROR, ie);
@@ -224,17 +224,17 @@ public class FennecNativeActions impleme
             mListening = true;
         }
 
         private synchronized void notifyOfEvent() {
             mPaintDone = true;
             this.notifyAll();
         }
 
-        private synchronized void blockForEvent(long millis, boolean failOnTimeout) {
+        public synchronized void blockForEvent(long millis, boolean failOnTimeout) {
             if (!mListening) {
                 throw new IllegalStateException("draw listener not registered");
             }
             long startTime = SystemClock.uptimeMillis();
             long endTime = 0;
             while (!mPaintDone) {
                 try {
                     this.wait(millis);
--- a/mobile/android/base/tests/BaseTest.java
+++ b/mobile/android/base/tests/BaseTest.java
@@ -53,16 +53,17 @@ abstract class BaseTest extends Activity
     private static final String TARGET_PACKAGE_ID = "org.mozilla.gecko";
     private static final String LAUNCH_ACTIVITY_FULL_CLASSNAME = TestConstants.ANDROID_PACKAGE_NAME + ".App";
     private static final int VERIFY_URL_TIMEOUT = 2000;
     private static final int MAX_LIST_ATTEMPTS = 3;
     private static final int MAX_WAIT_ENABLED_TEXT_MS = 10000;
     private static final int MAX_WAIT_HOME_PAGER_HIDDEN_MS = 15000;
     public static final int MAX_WAIT_MS = 4500;
     public static final int LONG_PRESS_TIME = 6000;
+    private static final int GECKO_READY_WAIT_MS = 180000;
 
     private static Class<Activity> mLauncherActivityClass;
     private Activity mActivity;
     protected Solo mSolo;
     protected Driver mDriver;
     protected Assert mAsserter;
     protected Actions mActions;
     protected String mBaseUrl;
@@ -72,17 +73,17 @@ abstract class BaseTest extends Activity
     public Device mDevice;
     protected DatabaseHelper mDatabaseHelper;
     protected StringHelper mStringHelper;
 
     protected void blockForGeckoReady() {
         try {
             Actions.EventExpecter geckoReadyExpector = mActions.expectGeckoEvent("Gecko:Ready");
             if (!GeckoThread.checkLaunchState(LaunchState.GeckoRunning)) {
-                geckoReadyExpector.blockForEvent();
+                geckoReadyExpector.blockForEvent(GECKO_READY_WAIT_MS, true);
             }
             geckoReadyExpector.unregisterListener();
         } catch (Exception e) {
             mAsserter.dumpLog("Exception in blockForGeckoReady", e);
         }
     }
 
     static {