Browse Source

Fix compile errors.

pull/1014/head
Steven Kirk 9 years ago
parent
commit
188a0ce442
  1. 14
      tests/Avalonia.Benchmarks/Layout/Measure.cs
  2. 2
      tests/Avalonia.Layout.UnitTests/LayoutManagerTests.cs

14
tests/Avalonia.Benchmarks/Layout/Measure.cs

@ -8,26 +8,18 @@ using BenchmarkDotNet.Attributes;
namespace Avalonia.Benchmarks.Layout namespace Avalonia.Benchmarks.Layout
{ {
[MemoryDiagnoser] [MemoryDiagnoser]
public class Measure : IDisposable public class Measure
{ {
private IDisposable _app;
private TestRoot root; private TestRoot root;
private List<Control> controls = new List<Control>(); private List<Control> controls = new List<Control>();
public Measure() public Measure()
{ {
_app = UnitTestApplication.Start(TestServices.RealLayoutManager);
var panel = new StackPanel(); var panel = new StackPanel();
root = new TestRoot { Child = panel }; root = new TestRoot { Child = panel };
controls.Add(panel); controls.Add(panel);
CreateChildren(panel, 3, 5); CreateChildren(panel, 3, 5);
LayoutManager.Instance.ExecuteInitialLayoutPass(root); root.LayoutManager.ExecuteInitialLayoutPass(root);
}
public void Dispose()
{
_app.Dispose();
} }
[Benchmark] [Benchmark]
@ -43,7 +35,7 @@ namespace Avalonia.Benchmarks.Layout
} }
} }
LayoutManager.Instance.ExecuteLayoutPass(); root.LayoutManager.ExecuteLayoutPass();
} }
private void CreateChildren(IPanel parent, int childCount, int iterations) private void CreateChildren(IPanel parent, int childCount, int iterations)

2
tests/Avalonia.Layout.UnitTests/LayoutManagerTests.cs

@ -264,8 +264,6 @@ namespace Avalonia.Layout.UnitTests
{ {
using (AvaloniaLocator.EnterScope()) using (AvaloniaLocator.EnterScope())
{ {
AvaloniaLocator.CurrentMutable.Bind<ILayoutManager>().ToConstant(layoutManager);
Border border; Border border;
StackPanel panel; StackPanel panel;

Loading…
Cancel
Save