Bug 1162422 - Fix test cases, r=dhylands

This commit is contained in:
Kershaw Chang 2015-05-13 00:44:00 +08:00
parent a0c610bbd8
commit 0c7f9c974f
3 changed files with 4 additions and 9 deletions

View File

@ -52,8 +52,6 @@ add_test(function setup_sdcard() {
let vol = volumeService.getVolumeByName(volName);
ok(vol, "volume shouldn't be null");
equal(volName, vol.name, "name");
volumeService.SetFakeVolumeState(volName, Ci.nsIVolume.STATE_MOUNTED);
equal(Ci.nsIVolume.STATE_MOUNTED, vol.state, "state");
run_next_test();

View File

@ -439,7 +439,7 @@ NS_IMETHODIMP
nsVolumeService::CreateFakeVolume(const nsAString& name, const nsAString& path)
{
if (XRE_GetProcessType() == GeckoProcessType_Default) {
nsRefPtr<nsVolume> vol = new nsVolume(name, path, nsIVolume::STATE_MOUNTED,
nsRefPtr<nsVolume> vol = new nsVolume(name, path, nsIVolume::STATE_INIT,
-1 /* mountGeneration */,
true /* isMediaPresent */,
false /* isSharing */,
@ -448,6 +448,7 @@ nsVolumeService::CreateFakeVolume(const nsAString& name, const nsAString& path)
false /* isUnmounting */,
false /* isRemovable */,
false /* isHotSwappable */);
vol->SetState(nsIVolume::STATE_MOUNTED);
vol->LogState();
UpdateVolume(vol.get());
return NS_OK;

View File

@ -18,12 +18,8 @@ ok(vol, "volume shouldn't be null");
is(volName, vol.name, "name");
is(mountPoint, vol.mountPoint, "moutnPoint");
is(Ci.nsIVolume.STATE_INIT, vol.state, "state");
let oldMountGen = vol.mountGeneration;
volumeService.SetFakeVolumeState(volName, Ci.nsIVolume.STATE_MOUNTED);
is(Ci.nsIVolume.STATE_MOUNTED, vol.state, "state");
ok(vol.mountGeneration > oldMountGen, "mount generation should be incremented");
ok(vol.mountGeneration > 0, "mount generation should not be zero");
finish();