Browse Source

Fix failing test.

pull/9677/head
Steven Kirk 3 years ago
parent
commit
a6423b258d
  1. 13
      tests/Avalonia.LeakTests/ControlTests.cs

13
tests/Avalonia.LeakTests/ControlTests.cs

@ -713,6 +713,10 @@ namespace Avalonia.LeakTests
{ {
using (Start()) using (Start())
{ {
// Height of ListBoxItem content + padding.
const double ListBoxItemHeight = 12;
const double TextBoxHeight = 25;
var items = new ObservableCollection<int>(Enumerable.Range(0, 10)); var items = new ObservableCollection<int>(Enumerable.Range(0, 10));
NameScope ns; NameScope ns;
TextBox tb; TextBox tb;
@ -721,8 +725,8 @@ namespace Avalonia.LeakTests
{ {
[NameScope.NameScopeProperty] = ns = new NameScope(), [NameScope.NameScopeProperty] = ns = new NameScope(),
Width = 100, Width = 100,
Height = 100, Height = (items.Count * ListBoxItemHeight) + TextBoxHeight,
Content = new StackPanel Content = new DockPanel
{ {
Children = Children =
{ {
@ -730,6 +734,8 @@ namespace Avalonia.LeakTests
{ {
Name = "tb", Name = "tb",
Text = "foo", Text = "foo",
Height = TextBoxHeight,
[DockPanel.DockProperty] = Dock.Top,
}), }),
(lb = new ListBox (lb = new ListBox
{ {
@ -745,7 +751,8 @@ namespace Avalonia.LeakTests
Path = "Text", Path = "Text",
NameScope = new WeakReference<INameScope>(ns), NameScope = new WeakReference<INameScope>(ns),
} }
}) }),
Padding = new Thickness(0),
}), }),
} }
} }

Loading…
Cancel
Save