Closed Bug 929816 Opened 11 years ago Closed 11 years ago

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

Categories

(Core :: DOM: Device Interfaces, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla27

People

(Reporter: dhylands, Assigned: dhylands)

References

Details

Attachments

(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 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
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 :)
https://tbpl.mozilla.org/?tree=Try&rev=00fa058183f1
Attachment #821274 - Flags: review?(mhabicher) → review+
https://hg.mozilla.org/mozilla-central/rev/354e00efe670
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla27
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: