Backed out changeset bab1f360bf44 (bug 1128287) for rc2 failures a=me
authorWes Kocher <wkocher@mozilla.com>
Fri, 13 Feb 2015 13:41:46 -0800
changeset 256121 992cf3981ca81ea65fb13cfca3f1906b7857b922
parent 256120 fd12875a8a48eba1591c0a70e17a142953161218
child 256137 a7c177546ca0e33d20622208993c42398707b1a0
child 256149 0f829e7ccd2ff21fa02a9feb521ab5b61fef0ef1
child 256173 bcfb6f783eb391c372689411964a3bb3dc19f5b9
child 256304 157678ffd0a988089454565f0eb86fe2c62bb348
push id4610
push userjlund@mozilla.com
push dateMon, 30 Mar 2015 18:32:55 +0000
treeherdermozilla-beta@4df54044d9ef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs1128287
milestone38.0a1
backs outbab1f360bf44141f3f1d6e710f3606e11e53e851
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
Backed out changeset bab1f360bf44 (bug 1128287) for rc2 failures a=me
mobile/android/base/tests/testFindInPage.java
mobile/android/base/tests/testFindInPage.js
--- a/mobile/android/base/tests/testFindInPage.java
+++ b/mobile/android/base/tests/testFindInPage.java
@@ -6,51 +6,47 @@ package org.mozilla.gecko.tests;
 
 import static org.mozilla.gecko.tests.helpers.AssertionHelper.fFail;
 
 import org.mozilla.gecko.Actions;
 import org.mozilla.gecko.Element;
 import org.mozilla.gecko.R;
 
 import org.mozilla.gecko.EventDispatcher;
+import org.mozilla.gecko.util.GeckoEventListener;
 
-import org.mozilla.gecko.util.EventCallback;
-import org.mozilla.gecko.util.NativeEventListener;
-import org.mozilla.gecko.util.NativeJSObject;
+import org.json.JSONObject;
 
-public class testFindInPage extends JavascriptTest implements NativeEventListener {
+public class testFindInPage extends JavascriptTest implements GeckoEventListener {
     private static final int WAIT_FOR_TEST = 3000;
     protected Element next, close;
 
     public testFindInPage() {
         super("testFindInPage.js");
     }
 
     @Override
-    public void handleMessage(final String event, final NativeJSObject message,
-                              final EventCallback callback) {
+    public void handleMessage(String event, final JSONObject message) {
         if (event.equals("Test:FindInPage")) {
             try {
                 final String text = message.getString("text");
-                final int nrOfMatches = message.getInt("nrOfMatches");
+                final int nrOfMatches = Integer.parseInt(message.getString("nrOfMatches"));
                 findText(text, nrOfMatches);
             } catch (Exception e) {
-                callback.sendError("Can't extract find query from JSON :" + e.toString());
+                fFail("Can't extract find query from JSON");
             }
         }
 
         if (event.equals("Test:CloseFindInPage")) {
             try {
                 close.click();
             } catch (Exception e) {
-                callback.sendError("FindInPage prompt not opened");
+                fFail("FindInPage prompt not opened");
             }
         }
-
-        callback.sendSuccess("done");
     }
 
     @Override
     public void setUp() throws Exception {
         super.setUp();
 
         EventDispatcher.getInstance().registerGeckoThreadListener(this,
             "Test:FindInPage",
--- a/mobile/android/base/tests/testFindInPage.js
+++ b/mobile/android/base/tests/testFindInPage.js
@@ -30,31 +30,27 @@ function openTabWithUrl(url) {
   let browserApp = Services.wm.getMostRecentWindow("navigator:browser").BrowserApp;
   let browser = browserApp.addTab(url, { selected: true, parentId: browserApp.selectedTab.id }).browser;
 
   return promiseBrowserEvent(browser, "load")
     .then(() => { return browser; });
 }
 
 function findInPage(browser, text, nrOfMatches) {
+  let repaintPromise = promiseBrowserEvent(browser, "MozAfterPaint");
   do_print("Send findInPageMessage: " + text + " nth: " + nrOfMatches);
-  let messagePromise = Messaging.sendRequestForResult({
-    type: "Test:FindInPage",
-    text: text,
-    nrOfMatches: nrOfMatches
-  });
-  let repaintPromise = promiseBrowserEvent(browser, "MozAfterPaint");
-  return Promise.all([messagePromise, repaintPromise]);
+  Messaging.sendRequest({ type: "Test:FindInPage", text: text, nrOfMatches: nrOfMatches });
+  return repaintPromise;
 }
 
 function closeFindInPage(browser) {
+  let repaintPromise = promiseBrowserEvent(browser, "MozAfterPaint");
   do_print("Send closeFindInPageMessage");
-  let messagePromise = Messaging.sendRequestForResult({ type: "Test:CloseFindInPage" });
-  let repaintPromise = promiseBrowserEvent(browser, "MozAfterPaint");
-  return Promise.all([messagePromise, repaintPromise]);
+  Messaging.sendRequest({ type: "Test:CloseFindInPage" });
+  return repaintPromise;
 }
 
 function assertSelection(document, expectedSelection = false, expectedAnchorText = false) {
   let sel = document.getSelection();
   if (!expectedSelection) {
     do_print("Assert empty selection");
     do_check_eq(sel.toString(), "");
   } else {