mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 19:35:51 +00:00
Bug 785124 - Pt 6 - Fix JS code that was failing xpcshell tests. r=marshall_law
This commit is contained in:
parent
4eafc2a88b
commit
9139c75270
@ -18,6 +18,10 @@ XPCOMUtils.defineLazyServiceGetter(Services, "env",
|
||||
"@mozilla.org/process/environment;1",
|
||||
"nsIEnvironment");
|
||||
|
||||
XPCOMUtils.defineLazyServiceGetter(Services, "um",
|
||||
"@mozilla.org/updates/update-manager;1",
|
||||
"nsIUpdateManager");
|
||||
|
||||
XPCOMUtils.defineLazyServiceGetter(Services, "volumeService",
|
||||
"@mozilla.org/telephony/volume-service;1",
|
||||
"nsIVolumeService");
|
||||
@ -26,6 +30,9 @@ XPCOMUtils.defineLazyGetter(this, "gExtStorage", function dp_gExtStorage() {
|
||||
return Services.env.get("EXTERNAL_STORAGE");
|
||||
});
|
||||
|
||||
// This exists to mark the affected code for bug 828858.
|
||||
const gUseSDCard = true;
|
||||
|
||||
const VERBOSE = 1;
|
||||
let log =
|
||||
VERBOSE ?
|
||||
@ -90,13 +97,15 @@ DirectoryProvider.prototype = {
|
||||
return this.createUpdatesDir(LOCAL_DIR);
|
||||
}
|
||||
let activeUpdate = Services.um.activeUpdate;
|
||||
if (this.volumeHasFreeSpace(gExtStorage, requiredSpace)) {
|
||||
let extUpdateDir = this.createUpdatesDir(gExtStorage);
|
||||
if (extUpdateDir !== null) {
|
||||
return extUpdateDir;
|
||||
if (gUseSDCard) {
|
||||
if (this.volumeHasFreeSpace(gExtStorage, requiredSpace)) {
|
||||
let extUpdateDir = this.createUpdatesDir(gExtStorage);
|
||||
if (extUpdateDir !== null) {
|
||||
return extUpdateDir;
|
||||
}
|
||||
log("Warning: " + gExtStorage + " has enough free space for update " +
|
||||
activeUpdate.name + ", but is not writable");
|
||||
}
|
||||
log("Warning: " + gExtStorage + " has enough free space for update " +
|
||||
activeUpdate.name + ", but is not writable");
|
||||
}
|
||||
|
||||
if (this.volumeHasFreeSpace(LOCAL_DIR, requiredSpace)) {
|
||||
|
@ -189,6 +189,8 @@ var gVolumeMountLock = null;
|
||||
XPCOMUtils.defineLazyGetter(this, "gExtStorage", function aus_gExtStorage() {
|
||||
return Services.env.get("EXTERNAL_STORAGE");
|
||||
});
|
||||
|
||||
var gSDCardMountLock = null;
|
||||
#endif
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "UpdateChannel",
|
||||
|
Loading…
Reference in New Issue
Block a user