Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 0 additions & 50 deletions src/Controls/tests/DeviceTests/Elements/Window/WindowTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,56 +175,6 @@ await CreateHandlerAndAddToWindow<WindowHandlerStub>(window, async (handler) =>
});
}

#if ANDROID
[Fact(DisplayName = "Replaced FlyoutPage Root Clears Old ContainerView")]
public async Task ReplacedFlyoutPageRootClearsOldContainerView()
{
SetupBuilder();

var rootPage = CreateFlyoutRoot();
var window = new Window(rootPage);

await CreateHandlerAndAddToWindow<WindowHandlerStub>(window, async handler =>
{
var rootManager = handler.MauiContext.GetNavigationRootManager();
var oldRootView = Assert.IsType<ContainerView>(rootManager.RootView);

Assert.Same(rootPage, oldRootView.CurrentView);
Assert.NotNull(oldRootView.MainView);

var replacementPage = new ContentPage
{
Content = new Label { Text = "Replacement page" }
};

window.Page = replacementPage;
await OnLoadedAsync(replacementPage);

Assert.Null(oldRootView.CurrentView);
Assert.Null(oldRootView.MainView);
Assert.NotSame(oldRootView, rootManager.RootView);
});
}

static FlyoutPage CreateFlyoutRoot()
{
var flyoutPage = new ContentPage { Title = "Flyout" };
var detailPage = new ContentPage
{
Title = "Detail",
Content = new Label { Text = "Detail page" }
};
var detailNavigationPage = new NavigationPage(detailPage) { Title = "Detail" };
var rootPage = new FlyoutPage
{
Flyout = flyoutPage,
Detail = detailNavigationPage
};

return rootPage;
}
#endif

#if !IOS && !MACCATALYST
// Automated Shell tests are currently broken via xharness
[Fact(DisplayName = "Toolbar Items Update when swapping out Main Page on Handler")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,6 @@ void ClearPlatformParts()
{
_pendingFragment?.Dispose();
_pendingFragment = null;
if (_rootView is ContainerView containerView)
containerView.CurrentView = null;

DrawerLayout = null;
_rootView = null;
_toolbarElement = null;
Expand Down
Loading