Skip to content

Commit

Permalink
Ensure image in stream test actually loads before checking color
Browse files Browse the repository at this point in the history
  • Loading branch information
hartez committed Dec 20, 2023
1 parent 388088b commit c0478f4
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using Microsoft.Maui.Graphics;
using Microsoft.Maui.Handlers;
using Xunit;
using static Microsoft.Maui.DeviceTests.AssertHelpers;

namespace Microsoft.Maui.DeviceTests
{
Expand Down Expand Up @@ -58,8 +59,13 @@ public async Task ImageSetFromStreamRenders()
await InvokeOnMainThreadAsync(async () =>
{
var handler = CreateHandler<LayoutHandler>(layout);
await image.WaitUntilLoaded();
await handler.ToPlatform().AssertContainsColor(Colors.Red, MauiContext);
var rootView = handler.ToPlatform();

await rootView.AttachAndRun(async () =>
{
await image.WaitUntilLoaded();
await rootView.AssertContainsColor(Colors.Red, MauiContext);
});
});
}
}
Expand Down

0 comments on commit c0478f4

Please sign in to comment.