|
1 /* Any copyright is dedicated to the Public Domain. |
|
2 * http://creativecommons.org/publicdomain/zero/1.0/ */ |
|
3 |
|
4 MARIONETTE_TIMEOUT = 10000; |
|
5 |
|
6 let Cc = SpecialPowers.Cc; |
|
7 let Ci = SpecialPowers.Ci; |
|
8 |
|
9 let volumeService = Cc["@mozilla.org/telephony/volume-service;1"].getService(Ci.nsIVolumeService); |
|
10 ok(volumeService, "Should have volume service"); |
|
11 |
|
12 let volName = "fake"; |
|
13 let mountPoint = "/data/fake/storage"; |
|
14 volumeService.createFakeVolume(volName, mountPoint); |
|
15 |
|
16 let vol = volumeService.getVolumeByName(volName); |
|
17 ok(vol, "volume shouldn't be null"); |
|
18 |
|
19 is(volName, vol.name, "name"); |
|
20 is(mountPoint, vol.mountPoint, "moutnPoint"); |
|
21 is(Ci.nsIVolume.STATE_INIT, vol.state, "state"); |
|
22 |
|
23 |
|
24 let oldMountGen = vol.mountGeneration; |
|
25 volumeService.SetFakeVolumeState(volName, Ci.nsIVolume.STATE_MOUNTED); |
|
26 is(Ci.nsIVolume.STATE_MOUNTED, vol.state, "state"); |
|
27 ok(vol.mountGeneration > oldMountGen, "mount generation should be incremented"); |
|
28 |
|
29 finish(); |