Bug 1306699 - Only invoke attribution code functionality in desktop Firefox; r=gfritzsche

MozReview-Commit-ID: JMGuP9kI6gD

--HG--
extra : source : a16efcbc34a9a619147a290caeaa90435197407f
This commit is contained in:
Matt Howell 2016-10-02 10:48:47 -07:00
Родитель a43663902d
Коммит 47663a3eb6
2 изменённых файлов: 12 добавлений и 4 удалений

Просмотреть файл

@ -769,7 +769,9 @@ function EnvironmentCache() {
this._currentEnvironment.profile = {};
p.push(this._updateProfile());
p.push(this._updateAttribution());
if (AppConstants.MOZ_BUILD_APP == "browser") {
p.push(this._updateAttribution());
}
let setup = () => {
this._initTask = null;

Просмотреть файл

@ -2,7 +2,6 @@
* http://creativecommons.org/publicdomain/zero/1.0/ */
Cu.import("resource://gre/modules/AddonManager.jsm");
Cu.import("resource:///modules/AttributionCode.jsm");
Cu.import("resource://gre/modules/TelemetryEnvironment.jsm", this);
Cu.import("resource://gre/modules/Preferences.jsm", this);
Cu.import("resource://gre/modules/PromiseUtils.jsm", this);
@ -12,6 +11,10 @@ Cu.import("resource://testing-common/httpd.js");
Cu.import("resource://testing-common/MockRegistrar.jsm", this);
Cu.import("resource://gre/modules/FileUtils.jsm");
// AttributionCode is only needed for Firefox
XPCOMUtils.defineLazyModuleGetter(this, "AttributionCode",
"resource:///modules/AttributionCode.jsm");
// Lazy load |LightweightThemeManager|, we won't be using it on Gonk.
XPCOMUtils.defineLazyModuleGetter(this, "LightweightThemeManager",
"resource://gre/modules/LightweightThemeManager.jsm");
@ -802,8 +805,11 @@ function run_test() {
Preferences.set("extensions.hotfix.lastVersion", APP_HOTFIX_VERSION);
// Create the attribution data file, so that settings.attribution will exist.
spoofAttributionData();
do_register_cleanup(cleanupAttributionData);
// The attribution functionality only exists in Firefox.
if (AppConstants.MOZ_BUILD_APP == "browser") {
spoofAttributionData();
do_register_cleanup(cleanupAttributionData);
}
run_next_test();
}