Fix tests not working if main or audio volume is zero

This commit is contained in:
Dean Herbert 2019-11-21 10:35:10 +09:00
parent 7637e680d7
commit be62e48296
1 changed files with 11 additions and 0 deletions

View File

@ -143,6 +143,17 @@ public void TestEnsureMutingCorrectly(bool stopAnyPlaying)
PreviewTrack track = null;
TestTrackOwner owner = null;
AddStep("ensure volume not zero", () =>
{
if (audio.Volume.Value == 0)
audio.Volume.Value = 1;
if (audio.VolumeTrack.Value == 0)
audio.VolumeTrack.Value = 1;
});
AddAssert("game not muted", () => audio.Tracks.AggregateVolume.Value != 0);
AddStep("get track", () => Add(owner = new TestTrackOwner(track = getTrack())));
AddUntilStep("wait loaded", () => track.IsLoaded);
AddStep("start track", () => track.Start());