Bug 1065525 - Determine user's Firefox version from UITour. r=MattN
authorAlex Bardas <alex.bardas@gmail.com>
Wed, 17 Sep 2014 23:05:00 +0200
changeset 206037 60881e5c48b33d2768b69b7c3e74e9116961f87e
parent 206036 79bf6ebacb09d14111055dddc445330da32e1517
child 206038 e34214539e10f2c77dd8c75a0e422218d8c29d59
push id49338
push userkwierso@gmail.com
push dateThu, 18 Sep 2014 23:10:09 +0000
treeherdermozilla-inbound@245051c6a7ed [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMattN
bugs1065525
milestone35.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 1065525 - Determine user's Firefox version from UITour. r=MattN
browser/modules/UITour.jsm
browser/modules/test/browser_UITour.js
--- a/browser/modules/UITour.jsm
+++ b/browser/modules/UITour.jsm
@@ -1129,16 +1129,23 @@ this.UITour = {
       case "availableTargets":
         this.getAvailableTargets(aContentDocument, aCallbackID);
         break;
       case "sync":
         this.sendPageCallback(aContentDocument, aCallbackID, {
           setup: Services.prefs.prefHasUserValue("services.sync.username"),
         });
         break;
+      case "appinfo":
+        let props = ["defaultUpdateChannel", "distributionID", "isOfficialBranding",
+                     "isReleaseBuild", "name", "vendor", "version"];
+        let appinfo = {};
+        props.forEach(property => appinfo[property] = Services.appinfo[property]);
+        this.sendPageCallback(aContentDocument, aCallbackID, appinfo);
+        break;
       default:
         Cu.reportError("getConfiguration: Unknown configuration requested: " + aConfiguration);
         break;
     }
   },
 
   getAvailableTargets: function(aContentDocument, aCallbackID) {
     let window = this.getChromeWindow(aContentDocument);
--- a/browser/modules/test/browser_UITour.js
+++ b/browser/modules/test/browser_UITour.js
@@ -260,15 +260,28 @@ let tests = [
         is(desc.textContent, "search text", "Popup should have correct description text");
 
         done();
       });
     });
 
     gContentAPI.showInfo("urlbar", "urlbar title", "urlbar text");
   },
+  function test_getConfigurationVersion(done) {
+    function callback(result) {
+      let props = ["defaultUpdateChannel", "distributionID", "isOfficialBranding",
+                   "isReleaseBuild", "name", "vendor", "version"];
+      for (let property of props) {
+        ok(typeof(result[property]) !== undefined, "Check " + property + " isn't undefined.");
+        is(result[property], Services.appinfo[property], "Should have the same " + property + " property.");
+      }
+      done();
+    }
+
+    gContentAPI.getConfiguration("appinfo", callback);
+  },
 
   // Make sure this test is last in the file so the appMenu gets left open and done will confirm it got tore down.
   function cleanupMenus(done) {
     gContentAPI.showMenu("appMenu");
     done();
   },
 ];