Closed Bug 929816 Opened 8 years ago Closed 8 years ago
Storage: navigator .get Device Storages returns null storage objects when running on travis
When running under b2g-desktop on travis, navigator.getDeviceStorages returns an array of length 1, where the one entry returned is null. When running on travis, the tests are setting the preference device.storage.testing which is supposed to make b2g-desktop use /tmp/device-storage-testing as its directory for everything, but navigator.getDeviceStorages is returning null. Upon investigation, it appears that when b2g-desktop runs on travis, the standard requests to the directory service to return NS_UNIX_XDG_VIDEOS_DIR, etc is returning null, and this is in turn causing the temporary directory to not be used.
It isn't clear to me why the code was testing for f being non-null. This change should have no imapact when the device.storage.testing preference is set to false. I've submitted a try run to make sure non of the existing tests are broken: https://tbpl.mozilla.org/?tree=Try&rev=c9a1558a40d0 This travis run: https://travis-ci.org/mozilla-b2g/gaia/builds/12906811 comes back green with this patch.
Comment on attachment 821129 [details] [diff] [review] Allow device storage testing override to work on travis Review of attachment 821129 [details] [diff] [review]: ----------------------------------------------------------------- Spoke to dhylands offline and this looks good to me.
Attachment #821129 - Flags: review+
Including IRC conversation 10:36 <mikeh> dhylands: yes, if you give me the $0.05 on why the change works. :-) 10:39 <dhylands> mikeh: I'm assuming that the travis server is running some variant of linux which isn't ubuntu, and the calls to retrieve your picture/videos/music directories are returning null. But since we're setting the device.storage.testing preference, we're saying ignore the default directory and use /tmp/device-storage-testing. However the way it was coded before if would only override the the tmp dir if the default dir actually existed
Assignee: nobody → dhylands
Added an early return so that unrecognized storage types get a proper null return.
The previous try run fails, so I tweaked the patch and this is the new try run (which is much greener so far :) https://tbpl.mozilla.org/?tree=Try&rev=00fa058183f1
Attachment #821274 - Flags: review?(mhabicher) → review+
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla27
You need to log in before you can comment on or make changes to this bug.