Skip to content

Commit

Permalink
Merge pull request #634 from Osmose/sync-total-count
Browse files Browse the repository at this point in the history
Bug 1349576: Remove use of services.sync.numClients preference.
  • Loading branch information
Osmose committed Mar 27, 2017
2 parents 334d902 + fd5200e commit 6e96cac
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion recipe-client-addon/lib/ClientEnvironment.jsm
Expand Up @@ -149,7 +149,7 @@ this.ClientEnvironment = {
});

XPCOMUtils.defineLazyGetter(environment, "syncTotalDevices", () => {
return Preferences.get("services.sync.numClients", 0);
return environment.syncDesktopDevices + environment.syncMobileDevices;
});

XPCOMUtils.defineLazyGetter(environment, "plugins", async function() {
Expand Down
3 changes: 2 additions & 1 deletion recipe-client-addon/lib/NormandyDriver.jsm
Expand Up @@ -78,11 +78,12 @@ this.NormandyDriver = function(sandboxManager) {
syncSetup: Preferences.isSet("services.sync.username"),
syncDesktopDevices: Preferences.get("services.sync.clients.devices.desktop", 0),
syncMobileDevices: Preferences.get("services.sync.clients.devices.mobile", 0),
syncTotalDevices: Preferences.get("services.sync.numClients", 0),
syncTotalDevices: null,
plugins: {},
doNotTrack: Preferences.get("privacy.donottrackheader.enabled", false),
distribution: Preferences.get("distribution.id", "default"),
};
appinfo.syncTotalDevices = appinfo.syncDesktopDevices + appinfo.syncMobileDevices;

const searchEnginePromise = new Promise(resolve => {
Services.search.init(rv => {
Expand Down
Expand Up @@ -64,7 +64,6 @@ add_task(async function testSync() {
is(environment.syncTotalDevices, 0, "syncTotalDevices defaults to zero");
await SpecialPowers.pushPrefEnv({
set: [
["services.sync.numClients", 9],
["services.sync.clients.devices.mobile", 5],
["services.sync.clients.devices.desktop", 4],
],
Expand Down
1 change: 0 additions & 1 deletion recipe-client-addon/test/browser/browser_NormandyDriver.js
Expand Up @@ -23,7 +23,6 @@ add_task(withDriver(Assert, async function syncDeviceCounts(driver) {

await SpecialPowers.pushPrefEnv({
set: [
["services.sync.numClients", 9],
["services.sync.clients.devices.mobile", 5],
["services.sync.clients.devices.desktop", 4],
],
Expand Down

0 comments on commit 6e96cac

Please sign in to comment.