$report=[Native41]::Top([uint32]$l.pid,'Changes since opening');Click $report 'Close';Start-Sleep -Milliseconds 300
Click $main 'Undo';Start-Sleep -Milliseconds 700
Click $main 'Review changes';Start-Sleep -Milliseconds 900
$report=[Native41]::Top([uint32]$l.pid,'Changes since opening')
$summary=@([Native41]::Children($report)|ForEach-Object{[Native41]::Title($_)}|Where-Object{$_ -match '^0 changes'})
if($summary.Count -ne 1){throw 'Undo did not restore the opened revision'}
Click $report 'Close';Start-Sleep -Milliseconds 300
$null=[Native41]::PostMessage($main,16,[IntPtr]::Zero,[IntPtr]::Zero)
$null=$p.WaitForExit(2500)
if(!$p.HasExited){throw 'Owned editor did not close normally'}
@{pid=$l.pid;utc=[DateTime]::UtcNow.ToString('o');reviewAfterUndo=$summary;closedNormally=$true;sourceSha256=(Get-FileHash "$r\roster-editor41e\Studio.ROS").Hash;companionSha256=(Get-FileHash "$r\roster-editor41e\Studio.ROS.openhoops.json").Hash}|ConvertTo-Json -Depth 4|Set-Content "$o\ui-close.json"
