Bug 925521 - Part 3: follow-up to fix browser tests. r=trivial, a=bajaj
authorRichard Newman <rnewman@mozilla.com>
Fri, 18 Oct 2013 17:43:42 -0700
changeset 167349 a018b84126922d020263fc8adeb418ad9cd70d7d
parent 167348 d2a2cfcd70fed195efce12318ba3da44dba00e7c
child 167350 d1d7b9c9fa2ec639e4f131b8d425e31ed7a5e6f5
push id428
push userbbajaj@mozilla.com
push dateTue, 28 Jan 2014 00:16:25 +0000
treeherdermozilla-release@cd72a7ff3a75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstrivial, bajaj
bugs925521
milestone27.0a2
Bug 925521 - Part 3: follow-up to fix browser tests. r=trivial, a=bajaj
browser/base/content/test/general/browser_aboutHome.js
browser/components/search/test/browser_healthreport.js
--- a/browser/base/content/test/general/browser_aboutHome.js
+++ b/browser/base/content/test/general/browser_aboutHome.js
@@ -481,17 +481,17 @@ function getNumberOfSearches(aEngineName
                                    .wrappedJSObject
                                    .healthReporter;
   ok(reporter, "Health Reporter instance available.");
 
   return reporter.onInit().then(function onInit() {
     let provider = reporter.getProvider("org.mozilla.searches");
     ok(provider, "Searches provider is available.");
 
-    let m = provider.getMeasurement("counts", 2);
+    let m = provider.getMeasurement("counts", 3);
     return m.getValues().then(data => {
       let now = new Date();
       let yday = new Date(now);
       yday.setDate(yday.getDate() - 1);
 
       // Add the number of searches recorded yesterday to the number of searches
       // recorded today. This makes the test not fail intermittently when it is
       // run at midnight and we accidentally compare the number of searches from
--- a/browser/components/search/test/browser_healthreport.js
+++ b/browser/components/search/test/browser_healthreport.js
@@ -22,24 +22,25 @@ function test() {
   function testFHR() {
     let reporter = Components.classes["@mozilla.org/datareporting/service;1"]
                                      .getService()
                                      .wrappedJSObject
                                      .healthReporter;
     ok(reporter, "Health Reporter available.");
     reporter.onInit().then(function onInit() {
       let provider = reporter.getProvider("org.mozilla.searches");
-      let m = provider.getMeasurement("counts", 2);
+      let m = provider.getMeasurement("counts", 3);
 
       m.getValues().then(function onData(data) {
         let now = new Date();
         let oldCount = 0;
 
-        // Foo engine goes into "other" bucket.
-        let field = "other.searchbar";
+        // Find the right bucket for the "Foo" engine.
+        let engine = Services.search.getEngineByName("Foo");
+        let field = (engine.identifier || "other-Foo") + ".searchbar";
 
         if (data.days.hasDay(now)) {
           let day = data.days.getDay(now);
           if (day.has(field)) {
             oldCount = day.get(field);
           }
         }