Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
1 /* Any copyright is dedicated to the Public Domain.
2 * http://creativecommons.org/publicdomain/zero/1.0/ */
4 MARIONETTE_TIMEOUT = 10000;
6 let Cc = SpecialPowers.Cc;
7 let Ci = SpecialPowers.Ci;
9 let volumeService = Cc["@mozilla.org/telephony/volume-service;1"].getService(Ci.nsIVolumeService);
10 ok(volumeService, "Should have volume service");
12 let volName = "fake";
13 let mountPoint = "/data/fake/storage";
14 volumeService.createFakeVolume(volName, mountPoint);
16 let vol = volumeService.getVolumeByName(volName);
17 ok(vol, "volume shouldn't be null");
19 is(volName, vol.name, "name");
20 is(mountPoint, vol.mountPoint, "moutnPoint");
21 is(Ci.nsIVolume.STATE_INIT, vol.state, "state");
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");
29 finish();