Closed Bug 929816 Opened 10 years ago Closed 10 years ago

DeviceStorage: navigator.getDeviceStorages returns null storage objects when running on travis


(Core :: DOM: Device Interfaces, defect)

Not set





(Reporter: dhylands, Assigned: dhylands)




(1 file, 1 obsolete file)

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 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 preference is set to false.

I've submitted a try run to make sure non of the existing tests are broken:

This travis run: 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 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
Blocks: 924170
Added an early return so that unrecognized storage types get a proper null return.
Attachment #821129 - Attachment is obsolete: true
Attachment #821274 - Flags: review?(mhabicher)
The previous try run fails, so I tweaked the patch and this is the new try run (which is much greener so far :)
Attachment #821274 - Flags: review?(mhabicher) → review+
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla27
You need to log in before you can comment on or make changes to this bug.