T3-11/14/15 + M2 잔여: 권한 정책 UI(PermissionGate/PermissionRequested 다이얼로그+SavesInProfile), 추적 방지(TrackerBlocklist/WebResourceRequested 차단+실드 배지·팝업), 주소창 진행 바+파라미터 제거 복사(UrlCleaner/NavProgressTracker), U5 완료 알림(Mobile.Core 감지기+Plugin.LocalNotification), 재생중 ongoing 미디어 알림, 썸네일/해상도 API(Thumbnailer 사이드카 캐시+/thumb)+라이브러리 그리드, 외부망 안내(ConnectionTroubleshoot). 147 tests GREEN

This commit is contained in:
Yun Chan 2026-08-15 18:11:49 +09:00
parent 27c91c04dd
commit 46c6c321f2
26 changed files with 1058 additions and 30 deletions

View file

@ -0,0 +1,80 @@
using VideoDownloader.Browser;
namespace VideoDownloader.Tests.Browser;
/// <summary>T3-15: 파라미터 제거 복사 + 주소창 진행 상태.</summary>
public class UrlCleanerTests
{
[Theory]
[InlineData("https://x.com/a?utm_source=1&b=2", "https://x.com/a")] // 쿼리 제거
[InlineData("https://x.com/a#frag", "https://x.com/a")] // 프래그먼트 제거
[InlineData("https://x.com/a?b=1#f", "https://x.com/a")] // 둘 다
[InlineData("https://x.com/a/", "https://x.com/a/")] // 없으면 무변경
[InlineData("https://x.com/a?q=한글", "https://x.com/a")] // 유니코드 쿼리
[InlineData("x.com/a?b=1", "x.com/a")] // 스킴 없어도 동작
public void StripQuery_파라미터와_프래그먼트를_제거(string input, string expected)
=> Assert.Equal(expected, UrlCleaner.StripQuery(input));
[Fact]
public void StripQuery_빈값_null_안전()
{
Assert.Equal("", UrlCleaner.StripQuery(""));
Assert.Null(UrlCleaner.StripQuery(null));
}
}
/// <summary>T3-15: 탭 전체 네비게이션 진행 집계 — 주소창 진행 바 표시 상태.</summary>
public class NavProgressTrackerTests
{
[Fact]
public void 초기값은_비진행()
=> Assert.False(new NavProgressTracker().IsNavigating);
[Fact]
public void 시작하면_진행()
{
var t = new NavProgressTracker();
t.Started();
Assert.True(t.IsNavigating);
}
[Fact]
public void 완료되면_비진행()
{
var t = new NavProgressTracker();
t.Started();
t.Completed();
Assert.False(t.IsNavigating);
}
[Fact]
public void 동시_내비게이션은_마지막_완료까지_진행() // 프레임 리다이렉트·중복 시작
{
var t = new NavProgressTracker();
t.Started(); t.Started();
t.Completed();
Assert.True(t.IsNavigating);
t.Completed();
Assert.False(t.IsNavigating);
}
[Fact]
public void 과잉_완료로_음수_되지_않음()
{
var t = new NavProgressTracker();
t.Completed();
Assert.False(t.IsNavigating);
}
[Fact]
public void IsNavigating_변경_시_INPC_발화()
{
var t = new NavProgressTracker();
var fired = new List<string?>();
t.PropertyChanged += (_, e) => fired.Add(e.PropertyName);
t.Started();
t.Completed();
t.Completed(); // false→false → 이벤트 없음
Assert.Equal(new[] { nameof(NavProgressTracker.IsNavigating), nameof(NavProgressTracker.IsNavigating) }, fired);
}
}