Skip to content

Commit

Permalink
Ensure test runner never outputs sound
Browse files Browse the repository at this point in the history
  • Loading branch information
peppy committed Jul 11, 2017
1 parent 768a775 commit 81c699b
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion osu.Framework.Testing/TestRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System;
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Configuration;
using osu.Framework.Platform;
using osu.Framework.Screens;

Expand All @@ -13,15 +14,28 @@ public class TestRunner : Screen
{
private const double time_between_tests = 200;

private Bindable<double> volume;
private double volumeAtStartup;

public TestRunner(TestBrowser browser)
{
this.browser = browser;
}

[BackgroundDependencyLoader]
private void load(GameHost host)
private void load(GameHost host, FrameworkConfigManager config)
{
this.host = host;

volume = config.GetBindable<double>(FrameworkSetting.VolumeUniversal);
volumeAtStartup = volume.Value;
volume.Value = 0;
}

protected override void Dispose(bool isDisposing)
{
volume.Value = volumeAtStartup;
base.Dispose(isDisposing);
}

protected override void LoadComplete()
Expand Down

0 comments on commit 81c699b

Please sign in to comment.