Skip to content

Commit

Permalink
WIP: tests that pass
Browse files Browse the repository at this point in the history
Somehow these pass, but the sample here has an issue:

* dotnet#23199

Past links related to `RadioButton`:

* dotnet#18365
* dotnet#21151
  • Loading branch information
jonathanpeppers committed Jun 26, 2024
1 parent 45a8686 commit d8d899f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,11 @@ public async Task ChildPagesDoNotLeak()
new ContentView(),
new Label(),
new ScrollView(),
new RadioButton(),
new RadioButton
{
ControlTemplate = new ControlTemplate(() =>
new Border { Content = new Grid { Children = { new ContentPresenter() } } })
}
}
};
NavigationPage.SetTitleView(page, new Label() { Text = "Title View" });
Expand Down
9 changes: 9 additions & 0 deletions src/Controls/tests/DeviceTests/Memory/MemoryTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ void SetupBuilder()
handlers.AddHandler<GraphicsView, GraphicsViewHandler>();
handlers.AddHandler<Label, LabelHandler>();
handlers.AddHandler<ListView, ListViewRenderer>();
handlers.AddHandler<Layout, LayoutHandler>();
handlers.AddHandler<Picker, PickerHandler>();
handlers.AddHandler<Polygon, PolygonHandler>();
handlers.AddHandler<Polyline, PolylineHandler>();
Expand All @@ -45,6 +46,7 @@ void SetupBuilder()
handlers.AddHandler<ImageButton, ImageButtonHandler>();
handlers.AddHandler<ImageCell, ImageCellRenderer>();
handlers.AddHandler<IndicatorView, IndicatorViewHandler>();
handlers.AddHandler<RadioButton, RadioButtonHandler>();
handlers.AddHandler<RefreshView, RefreshViewHandler>();
handlers.AddHandler<IScrollView, ScrollViewHandler>();
handlers.AddHandler<SearchBar, SearchBarHandler>();
Expand Down Expand Up @@ -135,6 +137,7 @@ public async Task PagesDoNotLeak(Type type)
[InlineData(typeof(Editor))]
[InlineData(typeof(Frame))]
[InlineData(typeof(GraphicsView))]
[InlineData(typeof(Grid))]
[InlineData(typeof(Image))]
[InlineData(typeof(ImageButton))]
[InlineData(typeof(IndicatorView))]
Expand All @@ -143,6 +146,7 @@ public async Task PagesDoNotLeak(Type type)
[InlineData(typeof(Picker))]
[InlineData(typeof(Polygon))]
[InlineData(typeof(Polyline))]
[InlineData(typeof(RadioButton))]
[InlineData(typeof(RefreshView))]
[InlineData(typeof(ScrollView))]
[InlineData(typeof(SearchBar))]
Expand Down Expand Up @@ -214,6 +218,11 @@ public async Task HandlerDoesNotLeak(Type type)
webView.Source = new HtmlWebViewSource { Html = "<p>hi</p>" };
await Task.Delay(1000);
}
else if (view is TemplatedView templated)
{
templated.ControlTemplate = new ControlTemplate(() =>
new Border { Content = new Grid { Children = { new ContentPresenter() } } });
}
var handler = CreateHandler<LayoutHandler>(layout);
viewReference = new WeakReference(view);
handlerReference = new WeakReference(view.Handler);
Expand Down

0 comments on commit d8d899f

Please sign in to comment.