Backed out changeset 7034533091e8 (bug 998303) for mochitest-bc failures.
authorRyan VanderMeulen <ryanvm@gmail.com>
Tue, 20 May 2014 20:57:22 -0400
changeset 157133 0f17079044942af4880daac21eca6969e5d86a5b
parent 157132 a399ae7c942562a66edb1e0667100dd93dff468e
child 157134 b12b92450b2ba67c92d25421c3005e580afa32e0
push id507
push userryanvm@gmail.com
push dateWed, 21 May 2014 00:57:28 +0000
bugs998303
milestone26.0
backs out7034533091e8379e887dcf2e3da3d6fc3a663f28
Backed out changeset 7034533091e8 (bug 998303) for mochitest-bc failures.
browser/base/content/test/browser_urlbar_search_healthreport.js
--- a/browser/base/content/test/browser_urlbar_search_healthreport.js
+++ b/browser/base/content/test/browser_urlbar_search_healthreport.js
@@ -37,55 +37,29 @@ function test() {
         if (day.has(field)) {
           oldCount = day.get(field);
         }
       }
 
       let tab = gBrowser.addTab();
       gBrowser.selectedTab = tab;
 
-      let searchStr = "firefox health report";
-      let expectedURL = Services.search.currentEngine.
-                        getSubmission(searchStr, "", "keyword").uri.spec;
-
-      // Expect the search URL to load but stop it as soon as it starts.
-      let loadPromise = waitForDocLoadAndStopIt(expectedURL);
-
-      // Meanwhile, poll for the new measurement.
-      let count = 0;
-      let measurementDeferred = Promise.defer();
-      function getNewMeasurement() {
-        if (count++ >= 10) {
-          ok(false, "Timed out waiting for new measurement");
-          measurementDeferred.resolve();
-          return;
-        }
-        m.getValues().then(function onData(data) {
-          if (data.days.hasDay(now)) {
-            let day = data.days.getDay(now);
-            if (day.has(field)) {
-              let newCount = day.get(field);
-              if (newCount > oldCount) {
-                is(newCount, oldCount + 1,
-                   "Exactly one search has been recorded.");
-                measurementDeferred.resolve();
-                return;
-              }
-            }
-          }
-          executeSoon(getNewMeasurement);
-        });
-      }
-      executeSoon(getNewMeasurement);
-
-      // Trigger the search.
-      gURLBar.value = searchStr;
+      gURLBar.value = "firefox health report";
       gURLBar.handleCommand();
 
-      // Wait for the page load and new measurement.
-      Promise.all([loadPromise, measurementDeferred.promise]).then(() => {
+      executeSoon(() => executeSoon(() => {
         gBrowser.removeTab(tab);
-        finish();
-      });
+
+        m.getValues().then(function onData(data) {
+          ok(data.days.hasDay(now), "FHR has data for today.");
+          let day = data.days.getDay(now);
+          ok(day.has(field), "FHR has url bar count for today.");
+
+          let newCount = day.get(field);
+
+          is(newCount, oldCount + 1, "Exactly one search has been recorded.");
+          finish();
+        });
+      }));
     });
   });
 }