Unione di funzione/decoder-hevc in funzione/senza-terzi (catena della 0.3.0)

Porta in senza-terzi tutta la catena: documenti ed esportazione, S4b,
codec delle immagini, H.264 e HEVC. Conflitti risolti tenendo le due parti:
CI e Dockerfile di senza-terzi (solo comandi, Febe processo 1, un carattere)
senza ffmpeg, che il ramo dei video ha tolto; categoria «da fare» di
riepilogo-prove.sh tenuta; decisioni.md con tutte le righe, prima quelle
della catena e poi quelle di C6; CLAUDE.md con le righe della CI di C6
senza ffmpeg; prove della pipeline con tutti e due i controlli.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Alby96andClaude Opus 5.5 committed 2026-11-25 11:57:34 +01:00
commit e4dbc5ad68
919 files changed
+65484 -1299

No files matched your search

+10 -1
View File
@@ -2,6 +2,7 @@ using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Interop;
using Febe.App;
using Febe.Browser.Cdp;
using Febe.Desktop.Browser;
using Febe.SitoDiProva;
@@ -162,7 +163,14 @@ public sealed class BrowserWindowTests
public async Task AMinimisedWindowKeepsAlbertoAtTheWheelUntilItIsMinimisedTooLong()
{
var ct = TestContext.CancellationToken;
await using var bed = await BrowserBed.CreateAsync("finestra-ridotta");
// What the window tells the connection when it lets go (S4b): the log must not say «chiusa» for this.
var letGo = new System.Collections.Concurrent.ConcurrentQueue<BrowserWindowLetGo>();
await using var bed = await BrowserBed.CreateAsync("finestra-ridotta", copyOnWindowClosed: (how, _) =>
{
letGo.Enqueue(how);
return Task.CompletedTask;
});
await bed.StartAsync(ct);
var window = await bed.OnUiAsync(() => bed.Browser.Host.Window) ?? throw new AssertFailedException("nessuna finestra");
await bed.OnUiAsync(() => window.MinimizedLimit = TimeSpan.FromSeconds(1));
@@ -174,6 +182,7 @@ public sealed class BrowserWindowTests
// Left there: restored and put out of view, as if closed (S2: never minimised for long).
await bed.WaitUntilAsync(() => !bed.Browser.UserIsDriving, TimeSpan.FromSeconds(15), "la fine della guida dopo la finestra ridotta a icona", ct);
CollectionAssert.AreEqual(new[] { BrowserWindowLetGo.MinimizedTooLong }, letGo.ToArray());
Assert.AreEqual(WindowState.Normal, await bed.OnUiAsync(() => window.WindowState));
Assert.IsFalse(await bed.OnUiAsync(() => window.IsOnScreen));
Assert.IsFalse(await bed.OnUiAsync(() => window.ShowInTaskbar));
@@ -50,7 +50,8 @@ internal sealed class BrowserBed : IAsyncDisposable
/// does nothing (never the default login page of the options, which is Instagram's).
/// </param>
/// <param name="openStartPage">What «Pagina iniziale» does instead (it wins over <paramref name="startPage"/>).</param>
public static async Task<BrowserBed> CreateAsync(string name, BrowserHosting hosting = BrowserHosting.Window, Func<string>? startPage = null, Func<CancellationToken, Task>? openStartPage = null)
/// <param name="copyOnWindowClosed">What closing the window, or leaving it minimised too long, does (S4b); null: nothing.</param>
public static async Task<BrowserBed> CreateAsync(string name, BrowserHosting hosting = BrowserHosting.Window, Func<string>? startPage = null, Func<CancellationToken, Task>? openStartPage = null, Func<BrowserWindowLetGo, CancellationToken, Task>? copyOnWindowClosed = null)
{
var folder = new TestFolder(name);
var ui = await UiThread.StartAsync();
@@ -63,7 +64,7 @@ internal sealed class BrowserBed : IAsyncDisposable
var tracker = new BrowserUseTracker();
WebView2Browser? built = null;
openStartPage ??= startPage is null ? null : async ct => await built!.Cdp.NavigateAsync(startPage(), ct);
var context = new FebePlatformContext(options, data, database, clock, log, tracker, openStartPage);
var context = new FebePlatformContext(options, data, database, clock, log, tracker, openStartPage, copyOnWindowClosed);
var settings = new WebView2BrowserSettings(data.BrowserProfile, 1280, 900, hosting, BrowserArguments.ForWebView2());
// Built off the UI thread, as DesktopPlatform.CreateBrowserAsync does after its awaits.
@@ -58,7 +58,9 @@ internal sealed class DesktopBed : IAsyncDisposable
/// <param name="name">Prefix of the temporary folder.</param>
/// <param name="autoLogin"><c>--accesso-di-prova</c>: the composition opens the test site once at start-up.</param>
public static async Task<DesktopBed> StartAsync(string name, bool autoLogin, CancellationToken ct)
/// <param name="ct">Cancels the start.</param>
/// <param name="extra">More options of Febe.exe (<c>--raccolta richieste</c>).</param>
public static async Task<DesktopBed> StartAsync(string name, bool autoLogin, CancellationToken ct, string[]? extra = null)
{
var site = await TestSite.StartAsync(new TestSiteOptions(), ct);
var folder = new TestFolder(name);
@@ -77,6 +79,8 @@ internal sealed class DesktopBed : IAsyncDisposable
arguments.Add("--accesso-di-prova");
}
arguments.AddRange(extra ?? []);
if (!DesktopCommandLine.TryParse([.. arguments], out var options, out var problem))
{
throw new ArgumentException(problem);
@@ -1,3 +1,4 @@
using Febe.Browser.Cdp;
using Febe.Core.Storage;
using Febe.Tests.Windows.Support;
using Febe.Web.Connection;
@@ -64,4 +65,43 @@ public sealed class WebView2ConnectionTests
Assert.IsFalse(bed.Lines.Any("non parte"), bed.Lines.Text);
Assert.IsFalse(bed.Lines.Any("ERRORE"), bed.Lines.Text);
}
[TestMethod]
[Timeout(240_000, CooperativeCancellation = true)]
public async Task WithRichiesteClosingTheWindowCopiesTheSessionBeforeThePageGoesBack()
{
// Issue #36, S4b (answer 5 of 18 November 2026): the window «Browser di Febe» closed with its X, without
// «Ho finito», copies the session from the site's page into the saved session, under Alberto's lease.
var ct = TestContext.CancellationToken;
await using var bed = await DesktopBed.StartAsync("finestra-copia", autoLogin: false, ct, ["--raccolta", "richieste"]);
var app = bed.App;
await app.Running.WaitAsync(TimeSpan.FromSeconds(120), ct);
var connection = app.Connection!;
var browser = bed.Browser;
var savedSession = app.SavedSession ?? throw new AssertFailedException("the test site's catalog has configured operations");
var window = await bed.Ui.InvokeAsync(() => browser.Host.Window) ?? throw new AssertFailedException("nessuna finestra");
// «Accedi» (the welcome page starts the test site's session), then Alberto goes to the home of the site.
await connection.BeginUserDrivingAsync(openLogin: true, ct);
await browser.Cdp.NavigateAsync(bed.Site.Url("/"), ct);
await connection.RefreshAsync(ct);
Assert.AreEqual(ConnectionState.SessionCopyMissing, (await connection.GetStatusAsync(ct)).State, "the cookie alone is not «Collegato» with «richieste»");
await bed.Ui.InvokeAsync(() =>
{
window.Close();
return true;
});
// The saved session is readable before it is written to disk and before the log lines: wait for the last of them.
await bed.WaitUntilAsync(() => Task.FromResult(savedSession.Read() is not null && bed.Lines.Any("Finestra del browser chiusa: sessione copiata")), TimeSpan.FromSeconds(30), "la copia alla chiusura della finestra", ct);
var saved = savedSession.Read()!;
Assert.AreEqual(Febe.SitoDiProva.TestSite.SpinBranch, saved.Fields["spin_b"]);
Assert.AreEqual(Febe.SitoDiProva.TestSite.EntryNonce, saved.Fields["entry_nonce"]);
Assert.IsFalse(await bed.Ui.InvokeAsync(() => window.IsOnScreen));
Assert.AreEqual(ConnectionState.Connected, (await connection.GetStatusAsync(ct)).State);
Assert.IsTrue(bed.Lines.Any("Finestra del browser chiusa: sessione copiata"), bed.Lines.Text);
Assert.IsFalse(bed.Lines.Any(Febe.SitoDiProva.TestSite.Lsd), "no value in the log");
Assert.IsFalse(bed.Lines.Any("ERRORE"), bed.Lines.Text);
await connection.CancelAsync(ct);
}
}