Phase 0 (T1-3/4/7/9/11): find bar w/ native Find API + search engine + site zoom + force reload + F11, wired into MainWindow, E2E smoke (39 tests)
This commit is contained in:
parent
470c9267f2
commit
00a822eaeb
11 changed files with 584 additions and 18 deletions
33
VideoDownloader.Tests/Infrastructure/WpfTestApp.cs
Normal file
33
VideoDownloader.Tests/Infrastructure/WpfTestApp.cs
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
using System.Windows;
|
||||
using VideoDownloader.App;
|
||||
|
||||
namespace VideoDownloader.Tests.Infrastructure;
|
||||
|
||||
/// <summary>
|
||||
/// 테스트 프로세스에는 App.xaml 의 리소스가 없으므로, App 어셈블리의 테마 사전을
|
||||
/// 테스트 전용 Application 에 로드한다(앱의 App.ApplyTheme 과 동일 순서: 색 → 스타일).
|
||||
/// </summary>
|
||||
public static class WpfTestApp
|
||||
{
|
||||
private static bool _initialized;
|
||||
|
||||
public static void Ensure(System.Windows.Threading.Dispatcher dispatcher)
|
||||
{
|
||||
dispatcher.Invoke(() =>
|
||||
{
|
||||
if (_initialized) return;
|
||||
if (Application.Current == null)
|
||||
new Application { ShutdownMode = ShutdownMode.OnExplicitShutdown };
|
||||
var md = Application.Current.Resources.MergedDictionaries;
|
||||
if (md.Count == 0)
|
||||
{
|
||||
const string asm = "/VideoDownloader;component";
|
||||
md.Add(new ResourceDictionary { Source = new Uri(asm + "/Themes/Dark.xaml", UriKind.Relative) });
|
||||
md.Add(new ResourceDictionary { Source = new Uri(asm + "/Themes/Shared.xaml", UriKind.Relative) });
|
||||
}
|
||||
if (!Application.Current.Resources.Contains("InverseCountToVisibility"))
|
||||
Application.Current.Resources["InverseCountToVisibility"] = new InverseCountToVisibilityConverter();
|
||||
_initialized = true;
|
||||
});
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue