michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: * http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: MARIONETTE_TIMEOUT = 10000; michael@0: michael@0: let Cc = SpecialPowers.Cc; michael@0: let Ci = SpecialPowers.Ci; michael@0: michael@0: let volumeService = Cc["@mozilla.org/telephony/volume-service;1"].getService(Ci.nsIVolumeService); michael@0: ok(volumeService, "Should have volume service"); michael@0: michael@0: let volName = "fake"; michael@0: let mountPoint = "/data/fake/storage"; michael@0: volumeService.createFakeVolume(volName, mountPoint); michael@0: michael@0: let vol = volumeService.getVolumeByName(volName); michael@0: ok(vol, "volume shouldn't be null"); michael@0: michael@0: is(volName, vol.name, "name"); michael@0: is(mountPoint, vol.mountPoint, "moutnPoint"); michael@0: is(Ci.nsIVolume.STATE_INIT, vol.state, "state"); michael@0: michael@0: michael@0: let oldMountGen = vol.mountGeneration; michael@0: volumeService.SetFakeVolumeState(volName, Ci.nsIVolume.STATE_MOUNTED); michael@0: is(Ci.nsIVolume.STATE_MOUNTED, vol.state, "state"); michael@0: ok(vol.mountGeneration > oldMountGen, "mount generation should be incremented"); michael@0: michael@0: finish();