Skip to content

Commit

Permalink
fix: fix tests and build failures and incorrect padding
Browse files Browse the repository at this point in the history
  • Loading branch information
kazo0 committed Nov 1, 2023
1 parent 31028b2 commit ede93f7
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 29 deletions.
20 changes: 10 additions & 10 deletions samples/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<PackageVersion Include="Microsoft.UI.Xaml" Version="2.8.5" />
<PackageVersion Include="Microsoft.Windows.Compatibility" Version="5.0.1" />
<PackageVersion Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.755" />
<PackageVersion Include="Microsoft.WindowsAppSDK" Version="1.2.0" />
<PackageVersion Include="Microsoft.WindowsAppSDK" Version="1.2.221109.1" />
<PackageVersion Include="SkiaSharp.Skottie" Version="2.88.6" />
<PackageVersion Include="SkiaSharp.Views" Version="2.88.5" />
<PackageVersion Include="SkiaSharp.Views.Uno" Version="2.88.6" />
Expand All @@ -30,19 +30,19 @@
<PackageVersion Include="Uno.Extensions.Logging.WebAssembly.Console" Version="1.4.0" />
<PackageVersion Include="Uno.Material" Version="3.0.0-dev.352" />
<PackageVersion Include="Uno.Material.WinUI" Version="3.0.0-dev.352" />
<PackageVersion Include="Uno.UI" Version="5.0.0-dev.1728" />
<PackageVersion Include="Uno.UI" Version="5.1.0-dev.156" />
<PackageVersion Include="Uno.UI.Adapter.Microsoft.Extensions.Logging" Version="4.5.9" />
<PackageVersion Include="Uno.UI.RemoteControl" Version="5.0.0-dev.1728" />
<PackageVersion Include="Uno.UI.Skia.Gtk" Version="5.0.0-dev.1728" />
<PackageVersion Include="Uno.UI.Skia.Wpf" Version="5.0.0-dev.1728" />
<PackageVersion Include="Uno.UI.WebAssembly" Version="5.0.0-dev.1728" />
<PackageVersion Include="Uno.UI.RemoteControl" Version="5.1.0-dev.156" />
<PackageVersion Include="Uno.UI.Skia.Gtk" Version="5.1.0-dev.156" />
<PackageVersion Include="Uno.UI.Skia.Wpf" Version="5.1.0-dev.156" />
<PackageVersion Include="Uno.UI.WebAssembly" Version="5.1.0-dev.156" />
<PackageVersion Include="Uno.UniversalImageLoader" Version="1.9.36" />
<PackageVersion Include="Uno.Wasm.Bootstrap" Version="7.0.20" />
<PackageVersion Include="Uno.Wasm.Bootstrap.DevServer" Version="7.0.20" />
<PackageVersion Include="Uno.WinUI" Version="5.0.0-dev.1728" />
<PackageVersion Include="Uno.WinUI.RemoteControl" Version="5.0.0-dev.1728" />
<PackageVersion Include="Uno.WinUI.Skia.Gtk" Version="5.0.0-dev.1728" />
<PackageVersion Include="Uno.WinUI.WebAssembly" Version="5.0.0-dev.1728" />
<PackageVersion Include="Uno.WinUI" Version="5.1.0-dev.156" />
<PackageVersion Include="Uno.WinUI.RemoteControl" Version="5.1.0-dev.156" />
<PackageVersion Include="Uno.WinUI.Skia.Gtk" Version="5.1.0-dev.156" />
<PackageVersion Include="Uno.WinUI.WebAssembly" Version="5.1.0-dev.156" />
<PackageVersion Include="Xamarin.Android.Support.CustomTabs" Version="28.0.0.3" />
<!-- Required to avoid warnings in 1.9.0.1 of Android.Material - https://github.com/xamarin/AndroidX/issues/727 -->
<PackageVersion Include="Xamarin.AndroidX.Annotation" Version="1.6.0.3" />
Expand Down
2 changes: 1 addition & 1 deletion src/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<ItemGroup>
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.0.0" />
<PackageVersion Include="Microsoft.UI.Xaml" Version="2.7.1" />
<PackageVersion Include="Microsoft.WindowsAppSDK" Version="1.1.5" />
<PackageVersion Include="Microsoft.WindowsAppSDK" Version="1.2.221109.1" />
<PackageVersion Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.755" />
<PackageVersion Include="SkiaSharp" Version="2.88.6" />
<PackageVersion Include="SkiaSharp.NativeAssets.Linux" Version="2.88.6" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System.Text;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Windows.UI.Xaml;
using Uno.Toolkit.RuntimeTests.Helpers;
using Uno.Toolkit.UI;
using Uno.UI.RuntimeTests;
Expand Down
22 changes: 13 additions & 9 deletions src/Uno.Toolkit.RuntimeTests/Tests/NavigationBarTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
using Microsoft.UI.Xaml.Navigation;
using Microsoft.UI.Xaml;
using Microsoft.UI;
using Windows.Networking.Connectivity;
#else
using Windows.UI.Xaml.Controls;
using Windows.UI;
Expand All @@ -49,24 +50,27 @@ public async Task MainCommand_In_Popup_Without_Page(MainCommandMode mainCommandM
var navigationBar = new NavigationBar { Content = "Title", MainCommandMode = mainCommandMode };
var popup = new Popup { Width = 100, Height = 100, HorizontalOffset = 100, VerticalOffset = 100, Child = new StackPanel { Children = { navigationBar } } };
var content = new StackPanel { Children = { popup } };

try

var openedTask = new TaskCompletionSource<object>();
EventHandler<object> popupOpened = async (s, e) =>
{
await UnitTestUIContentHelperEx.SetContentAndWait(content);

popup.IsOpen = true;

await UnitTestsUIContentHelper.WaitForIdle();
await UnitTestsUIContentHelper.WaitForLoaded(popup);

Assert.IsTrue(navigationBar.TryPerformMainCommand() == shouldGoBack, "Unexpected result from TryPerformMainCommand");
await UnitTestsUIContentHelper.WaitForIdle();
Assert.IsTrue(popup.IsOpen == !shouldGoBack, "Popup is in an incorrect state");
};

try
{
await UnitTestUIContentHelperEx.SetContentAndWait(content);

popup.Opened += popupOpened;
popup.IsOpen = true;
}
finally
{
popup.Opened -= popupOpened;
popup.IsOpen = false;
}
}
Expand Down
9 changes: 4 additions & 5 deletions src/Uno.Toolkit.RuntimeTests/Tests/TabBarTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -229,18 +229,17 @@ public async Task Verify_Indicator_Transitions(Orientation orientation, Indicato

var rootGrid = XamlHelper.LoadXaml<Grid>(@$"
<Grid>
<utu:TabBar xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml"" x:Name=""MyTabBar"" Style=""{{StaticResource {styleName}}}"">
<utu:TabBar xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml"" Padding=""{padding[0]},{padding[1]},{padding[2]},{padding[3]}"" Background=""Red"" x:Name=""MyTabBar"" Style=""{{StaticResource {styleName}}}"">
<utu:TabBar.Items>
<utu:TabBarItem Content=""1"" />
<utu:TabBarItem Content=""2"" />
<utu:TabBarItem Content=""3"" />
<utu:TabBarItem Content=""1"" Background=""Blue"" />
<utu:TabBarItem Content=""2"" Background=""Blue"" />
<utu:TabBarItem Content=""3"" Background=""Blue"" />
</utu:TabBar.Items>
</utu:TabBar>
</Grid>
");

var tabBar = (TabBar)rootGrid.FindName("MyTabBar");
tabBar.Padding = new Thickness(padding[0], padding[1], padding[2], padding[3]);

await UnitTestUIContentHelperEx.SetContentAndWait(rootGrid);

Expand Down
2 changes: 1 addition & 1 deletion src/Uno.Toolkit.UI/Controls/TabBar/TabBar.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
AutomationProperties.AutomationId="BelowSelectionIndicatorPresenter"
Opacity="0"
Visibility="Collapsed" />
<ItemsPresenter x:Name="TabBarItemsPresenter" Padding="{TemplateBinding Padding}" />
<ItemsPresenter x:Name="TabBarItemsPresenter" Margin="{TemplateBinding Padding}" />
<utu:TabBarSelectionIndicatorPresenter x:Name="AboveSelectionIndicatorPresenter"
Content="{TemplateBinding SelectionIndicatorContent}"
ContentTemplate="{TemplateBinding SelectionIndicatorContentTemplate}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,8 @@
x:Name="TabBarGrid"
Background="{Binding Path=(um:ControlExtensions.TintedBackground), RelativeSource={RelativeSource TemplatedParent}}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}">
<utu:TabBarSelectionIndicatorPresenter
x:Name="BelowSelectionIndicatorPresenter"
AutomationProperties.AutomationId="BelowSelectionIndicatorPresenter"
Expand All @@ -440,7 +441,7 @@
Owner="{Binding RelativeSource={RelativeSource TemplatedParent}}"
Style="{TemplateBinding SelectionIndicatorPresenterStyle}"
Visibility="Collapsed" />
<ItemsPresenter x:Name="TabBarItemsPresenter" Padding="{TemplateBinding Padding}" />
<ItemsPresenter x:Name="TabBarItemsPresenter" Margin="{TemplateBinding Padding}"/>
<utu:TabBarSelectionIndicatorPresenter
x:Name="AboveSelectionIndicatorPresenter"
AutomationProperties.AutomationId="AboveSelectionIndicatorPresenter"
Expand Down

0 comments on commit ede93f7

Please sign in to comment.