dom/system/gonk/tests/marionette/test_fakevolume.js

branch
TOR_BUG_9701
changeset 15
b8a032363ba2
equal deleted inserted replaced
-1:000000000000 0:45beb50e742c
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();

mercurial