Browse Source

Fix tests

pull/8651/head
Max Katz 4 years ago
parent
commit
a9910501ec
  1. 16
      samples/VirtualizationDemo/App.xaml
  2. 29
      tests/Avalonia.Benchmarks/Themes/ThemeBenchmark.cs
  3. 15
      tests/Avalonia.DesignerSupport.TestApp/App.xaml

16
samples/VirtualizationDemo/App.xaml

@ -1,9 +1,7 @@
<Application
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="VirtualizationDemo.App">
<Application.Styles>
<StyleInclude Source="avares://Avalonia.Themes.Simple/DefaultTheme.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Simple/Accents/BaseLight.xaml"/>
</Application.Styles>
</Application>
<Application xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="VirtualizationDemo.App">
<Application.Styles>
<SimpleTheme />
</Application.Styles>
</Application>

29
tests/Avalonia.Benchmarks/Themes/ThemeBenchmark.cs

@ -4,6 +4,8 @@ using Avalonia.Controls;
using Avalonia.Markup.Xaml.Styling;
using Avalonia.Platform;
using Avalonia.Styling;
using Avalonia.Themes.Fluent;
using Avalonia.Themes.Simple;
using Avalonia.UnitTests;
using BenchmarkDotNet.Attributes;
@ -25,32 +27,25 @@ namespace Avalonia.Benchmarks.Themes
}
[Benchmark]
[Arguments("avares://Avalonia.Themes.Fluent/FluentDark.xaml")]
[Arguments("avares://Avalonia.Themes.Fluent/FluentLight.xaml")]
public bool InitFluentTheme(string themeUri)
[Arguments(FluentThemeMode.Dark)]
[Arguments(FluentThemeMode.Light)]
public bool InitFluentTheme(FluentThemeMode mode)
{
UnitTestApplication.Current.Styles[0] = new StyleInclude(new Uri("resm:Styles?assembly=Avalonia.Benchmarks"))
UnitTestApplication.Current.Styles[0] = new FluentTheme(new Uri("resm:Styles?assembly=Avalonia.Benchmarks"))
{
Source = new Uri(themeUri)
Mode = mode
};
return ((IResourceHost)UnitTestApplication.Current).TryGetResource("SystemAccentColor", out _);
}
[Benchmark]
[Arguments("avares://Avalonia.Themes.Simple/Accents/BaseLight.xaml")]
[Arguments("avares://Avalonia.Themes.Simple/Accents/BaseDark.xaml")]
public bool InitDefaultTheme(string themeUri)
[Arguments(SimpleThemeMode.Dark)]
[Arguments(SimpleThemeMode.Light)]
public bool InitDefaultTheme(SimpleThemeMode mode)
{
UnitTestApplication.Current.Styles[0] = new Styles
UnitTestApplication.Current.Styles[0] = new SimpleTheme(new Uri("resm:Styles?assembly=Avalonia.Benchmarks"))
{
new StyleInclude(new Uri("resm:Styles?assembly=Avalonia.Benchmarks"))
{
Source = new Uri(themeUri)
},
new StyleInclude(new Uri("resm:Styles?assembly=Avalonia.Benchmarks"))
{
Source = new Uri("avares://Avalonia.Themes.Simple/DefaultTheme.xaml")
}
Mode = mode
};
return ((IResourceHost)UnitTestApplication.Current).TryGetResource("ThemeAccentColor", out _);
}

15
tests/Avalonia.DesignerSupport.TestApp/App.xaml

@ -1,10 +1,7 @@
<Application
x:Class="Avalonia.DesignerSupport.TestApp.App"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Application.Styles>
<StyleInclude Source="avares://Avalonia.Themes.Simple/DefaultTheme.xaml" />
<StyleInclude Source="avares://Avalonia.Themes.Simple/Accents/Base.xaml" />
<StyleInclude Source="avares://Avalonia.Themes.Simple/Accents/BaseLight.xaml" />
</Application.Styles>
<Application x:Class="Avalonia.DesignerSupport.TestApp.App"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Application.Styles>
<SimpleTheme />
</Application.Styles>
</Application>

Loading…
Cancel
Save