Bug 929816 - Allow devicestorage testing mode to work on travis. r=mikeh

--HG--
extra : amend_source : 6eeed813c1634a5c6113455c8b4319f3e8d0d5a9
This commit is contained in:
Dave Hylands 2013-10-23 15:03:03 -07:00
parent 2dc721ecf7
commit ea4f46740c

View File

@ -762,10 +762,16 @@ DeviceStorageFile::GetRootDirectoryForType(const nsAString& aStorageType,
// crash reports directory.
else if (aStorageType.EqualsLiteral(DEVICESTORAGE_CRASHES)) {
f = sDirs->crashes;
} else {
// Not a storage type that we recognize. Return null
return;
}
// in testing, we default all device storage types to a temp directory
if (f && sDirs->temp) {
// In testing, we default all device storage types to a temp directory.
// sDirs->temp will only have been initialized (in InitDirs) if the
// preference device.storage.testing was set to true. We can't test the
// preference directly here, since we may not be on the main thread.
if (sDirs->temp) {
f = sDirs->temp;
}