Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
1 Components.utils.import("resource://gre/modules/Services.jsm");
3 // Test steps chain from pref observers on *_reason,
4 // so always set that last
5 function install(data, reason) {
6 Components.utils.import(data.resourceURI.spec + "version.jsm");
7 Services.prefs.setIntPref("bootstraptest.installed_version", VERSION);
8 Services.prefs.setIntPref("bootstraptest.install_oldversion", data.oldVersion);
9 Components.utils.unload(data.resourceURI.spec + "version.jsm");
10 Services.prefs.setIntPref("bootstraptest.install_reason", reason);
11 }
13 function startup(data, reason) {
14 Components.utils.import(data.resourceURI.spec + "version.jsm");
15 Services.prefs.setIntPref("bootstraptest.active_version", VERSION);
16 Services.prefs.setIntPref("bootstraptest.startup_oldversion", data.oldVersion);
17 Components.utils.unload(data.resourceURI.spec + "version.jsm");
18 Services.prefs.setIntPref("bootstraptest.startup_reason", reason);
19 }
21 function shutdown(data, reason) {
22 Services.prefs.setIntPref("bootstraptest.active_version", 0);
23 Services.prefs.setIntPref("bootstraptest.shutdown_newversion", data.newVersion);
24 Services.prefs.setIntPref("bootstraptest.shutdown_reason", reason);
25 }
27 function uninstall(data, reason) {
28 Services.prefs.setIntPref("bootstraptest.installed_version", 0);
29 Services.prefs.setIntPref("bootstraptest.uninstall_newversion", data.newVersion);
30 Services.prefs.setIntPref("bootstraptest.uninstall_reason", reason);
31 }