MEDIABROWSER 개명·업데이트 채널 전환·아이콘 tofu 근본 수정 (BACKLOG 13차) — ①개명: installer.iss AppName/출력 MediaBrowser-Setup-*(AppId·exe·데이터 경로 유지로 업그레이드 호환), 워크플로 산출물명(mediabrowser-*.tar.gz, MediaBrowser-<ver>-arm64.apk), 창 타이틀·모바일 표시명·obtainium.json·README. ②UpdateChecker: apiBase 주입(기본=자체 Forgejo /api/v1, GitHub 는 apiBase 로 호환), osx 자산 tar.gz 허용(기존 dmg 만 → mac 영원히 자산 없음 결함 수정), AppConfig 기본 UpdateRepo=Video-Downloader/releases+UpdateApiBase — 테스트 4건. ③아이콘 tofu(사용자 보고 "절대 안고쳐지네") 근본 원인: Shared.xaml 암시적 TextBlock 스타일의 FontFamily=UiFont 강제가 버튼 ContentPresenter 자동 TextBlock 의 IconFont 상속을 덮어 모든 PUA 글리프가 notdef — 폰트 설치/글리프 존재/HW·SW 렌더/RTB/DPI/런타임 8·10/자체포함·공유 전부 배제 후 실창 픽셀 비교로 격리, 콘텐츠 TextBlock 의 실폰트가 Pretendard 체인임을 테스트로 실증. 수정: 암시 스타일 FontFamily 제거(창 루트 상속으로 통일, PairingWindow/PlayerWindow 는 SetResourceReference), PUA+텍스트 혼합 콘텐츠 7곳+코드 1곳 정리, 순수 글리프 2곳 IconFont 명시. 회귀 방어: IconGlyphXamlTests(정적 스캔)·IconContentFontTests(실창 폰트 단정)·IconGlyphRenderTests(픽셀 비교) — 462/462 GREEN, 수정 전후 실창 캡처로 글리프 렌더 확인
This commit is contained in:
parent
c8b061959b
commit
02995f4153
24 changed files with 451 additions and 64 deletions
71
VideoDownloader.Tests/E2E/IconContentFontTests.cs
Normal file
71
VideoDownloader.Tests/E2E/IconContentFontTests.cs
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media;
|
||||
using VideoDownloader.App;
|
||||
using VideoDownloader.Tests.Infrastructure;
|
||||
|
||||
namespace VideoDownloader.Tests.E2E;
|
||||
|
||||
/// <summary>
|
||||
/// 아이콘 tofu 실결함(사용자 보고 "아이콘은 절대 안고쳐지네") 회귀 테스트 —
|
||||
/// 근본 원인: Shared.xaml 의 암시적 TextBlock 스타일이 FontFamily 를 UiFont 로 강제해,
|
||||
/// 버튼 ContentPresenter 가 만드는 자동 TextBlock 이 IconFont 상속을 잃고 PUA 글리프가 notdef 가 됐다.
|
||||
/// 아이콘 버튼의 실제 콘텐츠 TextBlock 이 아이콘 폰트로 해석되는지 실창에서 검증한다.
|
||||
/// </summary>
|
||||
[Collection("E2E")]
|
||||
public class IconContentFontTests
|
||||
{
|
||||
private static TextBlock? FindTextBlock(DependencyObject root)
|
||||
{
|
||||
if (root is TextBlock tb) return tb;
|
||||
for (var i = 0; i < VisualTreeHelper.GetChildrenCount(root); i++)
|
||||
{
|
||||
if (FindTextBlock(VisualTreeHelper.GetChild(root, i)) is { } found) return found;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task 아이콘_버튼의_콘텐츠_TextBlock_은_아이콘폰트로_렌더된다()
|
||||
{
|
||||
var dataDir = Path.Combine(Path.GetTempPath(), $"vd_iconfont_{Guid.NewGuid():N}");
|
||||
Environment.SetEnvironmentVariable("VD_DATA_DIR", dataDir);
|
||||
try
|
||||
{
|
||||
using var sta = StaDispatcher.Start();
|
||||
WpfTestApp.Ensure(sta.Dispatcher);
|
||||
var (navFamily, captionFamily, bodyFamily) = await sta.Dispatcher.InvokeAsync(() =>
|
||||
{
|
||||
// 앱과 동일 조건: 절대 pack URI 테마 재로드 후 실창
|
||||
VideoDownloader.App.App.ApplyTheme("dark");
|
||||
var win = new MainWindow { Left = 20, Top = 700, WindowStartupLocation = WindowStartupLocation.Manual };
|
||||
win.Show();
|
||||
win.UpdateLayout();
|
||||
|
||||
var nav = (Button)win.FindName("NavBack")!;
|
||||
var navText = FindTextBlock(nav)!;
|
||||
|
||||
// 캡션(최대화/복원) 버튼 — CaptionButton 스타일 경유
|
||||
var caption = win.FindName("MaxRestoreBtn") as Button;
|
||||
var captionText = caption != null ? FindTextBlock(caption) : null;
|
||||
|
||||
// 일반 본문 TextBlock 은 여전히 UI 폰트를 따라야 한다(암시 스타일의 원래 목적)
|
||||
var status = (TextBlock)win.FindName("StatusText")!;
|
||||
|
||||
var result = (navText.FontFamily.Source, captionText?.FontFamily.Source ?? "(캡션 버튼 없음)", status.FontFamily.Source);
|
||||
win.Close();
|
||||
return result;
|
||||
});
|
||||
|
||||
Assert.Equal("Segoe Fluent Icons", navFamily);
|
||||
if (captionFamily != "(캡션 버튼 없음)")
|
||||
Assert.Equal("Segoe Fluent Icons", captionFamily);
|
||||
Assert.Contains("Pretendard", bodyFamily); // 본문은 UI 폰트 유지
|
||||
}
|
||||
finally
|
||||
{
|
||||
Environment.SetEnvironmentVariable("VD_DATA_DIR", null);
|
||||
try { Directory.Delete(dataDir, true); } catch { }
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue