mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 865347 - Add a test case to test new functions. r=dhylands
This commit is contained in:
parent
18bc5860c7
commit
6f3a9694c5
@ -6,3 +6,4 @@ qemu = true
|
||||
[test_geolocation.js]
|
||||
disabled = Bug 808783
|
||||
[test_get_voicemailInfo.js]
|
||||
[test_fakevolume.js]
|
||||
|
29
dom/system/gonk/tests/marionette/test_fakevolume.js
Normal file
29
dom/system/gonk/tests/marionette/test_fakevolume.js
Normal file
@ -0,0 +1,29 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
MARIONETTE_TIMEOUT = 10000;
|
||||
|
||||
let Cc = SpecialPowers.Cc;
|
||||
let Ci = SpecialPowers.Ci;
|
||||
|
||||
let volumeService = Cc["@mozilla.org/telephony/volume-service;1"].getService(Ci.nsIVolumeService);
|
||||
ok(volumeService, "Should have volume service");
|
||||
|
||||
let volName = "fake";
|
||||
let mountPoint = "/data/fake/storage";
|
||||
volumeService.createFakeVolume(volName, mountPoint);
|
||||
|
||||
let vol = volumeService.getVolumeByName(volName);
|
||||
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");
|
||||
|
||||
finish();
|
Loading…
Reference in New Issue
Block a user