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:
parent
27c91c04dd
commit
46c6c321f2
26 changed files with 1058 additions and 30 deletions
|
|
@ -155,6 +155,44 @@ public class RemoteServerE2ETests : IDisposable
|
|||
Assert.Equal(93.5, persisted!.PositionSec);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task 썸네일_API_E2E_생성_캐시_404()
|
||||
{
|
||||
Directory.CreateDirectory(_libDir);
|
||||
var mediaPath = Path.Combine(_libDir, "clip.mp4");
|
||||
File.WriteAllBytes(mediaPath, new byte[2048]);
|
||||
|
||||
// 가짜 ffmpeg: 출력 경로에 JPEG 생성
|
||||
var fake = new Tests.Platform.FakeProcessRunner
|
||||
{
|
||||
Behavior = (spec, _, _) =>
|
||||
{
|
||||
File.WriteAllBytes(spec.Args[^1], new byte[] { 0xFF, 0xD8, 0xFF, 0xE0, 0x01 });
|
||||
return Task.FromResult(new VideoDownloader.Core.Platform.ProcessResult(0, "", ""));
|
||||
},
|
||||
};
|
||||
|
||||
await using var server = await ServerHost.StartAsync(new ServerOptions
|
||||
{
|
||||
Port = 0, Token = "thumb-token", LibraryFolder = _libDir,
|
||||
Queue = new FakeQueue(),
|
||||
Thumbnailer = new Thumbnailer(fake),
|
||||
});
|
||||
using var http = new HttpClient { BaseAddress = new Uri($"http://127.0.0.1:{server.Port}") };
|
||||
|
||||
// 1) 익명 401
|
||||
Assert.Equal(System.Net.HttpStatusCode.Unauthorized, (await http.GetAsync("/api/library/xyz/thumb")).StatusCode);
|
||||
|
||||
// 2) 없는 항목 404
|
||||
http.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "thumb-token");
|
||||
Assert.Equal(System.Net.HttpStatusCode.NotFound, (await http.GetAsync("/api/library/xyz/thumb")).StatusCode);
|
||||
|
||||
// 3) 실제 항목 → 200 + JPEG 매직
|
||||
var lib = (await http.GetFromJsonAsync<List<LibraryItemDto>>("/api/library"))!;
|
||||
var thumb = await http.GetByteArrayAsync($"/api/library/{lib[0].Id}/thumb");
|
||||
Assert.True(thumb.Length >= 2 && thumb[0] == 0xFF && thumb[1] == 0xD8, "JPEG 매직 바이트");
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
try { Directory.Delete(_libDir, true); } catch { }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue