feat: add configurable operator appearance and layout
This commit is contained in:
@@ -257,8 +257,10 @@ public static class LegacyLocalStateNative
|
||||
|
||||
$ExpectedSourceSha256 =
|
||||
'1EE76BC464FB1C44C8B6546E99CDC21C726C0E2C24AD344F5C19AE41BFC0D2F2'
|
||||
$ExpectedInitialDestinationSha256 =
|
||||
$ExpectedFreshDestinationSha256 =
|
||||
'13C07BA64587549EDA9C1A694F3DFA19875CB1F888F02C9E071F17C47739E087'
|
||||
$ExpectedImportedDestinationSha256 =
|
||||
'2575C2420800670B0022EBEE819BA3D9640DB14E9552426DF46075D079F1F697'
|
||||
$ExpectedInitialPairLine = $Utf8.GetString([Convert]::FromBase64String(
|
||||
'MV5LUlgxMDDsp4DsiJgs7L2U7Iqk7ZS8IOyngOyImF5eXl5eXl4='))
|
||||
$ComparisonFileName = $Utf8.GetString([Convert]::FromBase64String(
|
||||
@@ -304,6 +306,7 @@ $ExpectedExchangePlan = @(
|
||||
$script:LocalInputRequestCalls = 0
|
||||
$script:LocalInputAcknowledgementCalls = 0
|
||||
$script:BaselineSettingsState = $null
|
||||
$script:DestinationBaselineMode = $null
|
||||
$script:InitialDestinationState = $null
|
||||
$script:FirstImportedDestinationState = $null
|
||||
$script:LastObservedFileState = $null
|
||||
@@ -399,19 +402,30 @@ function Assert-LocalFilePreflight {
|
||||
$state = Get-LocalFileState
|
||||
if ([string]$state.source.sha256 -cne $ExpectedSourceSha256 -or
|
||||
[int]$state.source.rowCount -ne 8 -or
|
||||
[string]$state.destination.sha256 -cne $ExpectedInitialDestinationSha256 -or
|
||||
[int]$state.destination.rowCount -ne 1 -or
|
||||
[string]$state.destination.firstPair -cne $ExpectedInitialPairIdentity) {
|
||||
Throw-SafeFailure `
|
||||
('The original 8-row source or exact current one-row baseline changed; ' +
|
||||
('The original 8-row source or known comparison baseline changed; ' +
|
||||
'no import was started.')
|
||||
}
|
||||
$initialBytes = [IO.File]::ReadAllBytes($DestinationComparisonPath)
|
||||
if ($Cp949.GetString($initialBytes).TrimEnd("`r", "`n") -cne
|
||||
$ExpectedInitialPairLine) {
|
||||
Throw-SafeFailure 'The current one-row comparison baseline is not the expected known pair.'
|
||||
$isFresh =
|
||||
[string]$state.destination.sha256 -ceq $ExpectedFreshDestinationSha256 -and
|
||||
[int]$state.destination.rowCount -eq 1
|
||||
$isAlreadyImported =
|
||||
[string]$state.destination.sha256 -ceq $ExpectedImportedDestinationSha256 -and
|
||||
[int]$state.destination.rowCount -eq 9
|
||||
if (-not $isFresh -and -not $isAlreadyImported) {
|
||||
Throw-SafeFailure `
|
||||
'The comparison destination is neither the known fresh nor imported baseline.'
|
||||
}
|
||||
if ($isFresh) {
|
||||
$initialBytes = [IO.File]::ReadAllBytes($DestinationComparisonPath)
|
||||
if ($Cp949.GetString($initialBytes).TrimEnd("`r", "`n") -cne
|
||||
$ExpectedInitialPairLine) {
|
||||
Throw-SafeFailure 'The current one-row comparison baseline is not the expected known pair.'
|
||||
}
|
||||
}
|
||||
$script:BaselineSettingsState = $state.settings
|
||||
$script:DestinationBaselineMode = if ($isFresh) { 'fresh' } else { 'alreadyImported' }
|
||||
$script:InitialDestinationState = $state.destination
|
||||
$script:LastObservedFileState = $state
|
||||
return $state
|
||||
@@ -755,14 +769,14 @@ function Invoke-LocalStateExchange(
|
||||
Throw-SafeFailure 'The original read-only comparison source changed during the smoke.'
|
||||
}
|
||||
if ($Sequence -lt 9 -and
|
||||
[string]$files.destination.sha256 -cne $ExpectedInitialDestinationSha256) {
|
||||
(-not (Test-JsonEquivalent $files.destination $script:InitialDestinationState))) {
|
||||
Throw-SafeFailure 'The comparison destination changed before the authorized Yes input.'
|
||||
}
|
||||
if ($Sequence -eq 10) {
|
||||
if ([int]$files.destination.rowCount -ne 9 -or
|
||||
[string]$files.destination.firstPair -cne $ExpectedInitialPairIdentity -or
|
||||
[string]$files.destination.sha256 -ceq $ExpectedInitialDestinationSha256) {
|
||||
Throw-SafeFailure 'The first authorized import is not an appended nine-row file.'
|
||||
[string]$files.destination.sha256 -cne $ExpectedImportedDestinationSha256) {
|
||||
Throw-SafeFailure 'The first authorized import did not retain the known nine-row result.'
|
||||
}
|
||||
$script:FirstImportedDestinationState = $files.destination
|
||||
}
|
||||
@@ -916,7 +930,13 @@ function Assert-LocalHarnessEvidence(
|
||||
[string]$ExchangePath) {
|
||||
$sealed = Read-LocalHarnessEvidenceFile $EvidencePath
|
||||
$value = $sealed.Value
|
||||
if ([int]$value.schemaVersion -ne 1 -or
|
||||
$baselineMode = [string]$value.files.initialDestinationMode
|
||||
$expectedFirstAdded = if ($baselineMode -ceq 'fresh') { 8 } else { 0 }
|
||||
$expectedFirstSkipped = if ($baselineMode -ceq 'fresh') { 0 } else { 8 }
|
||||
$expectedInitialPairCount = if ($baselineMode -ceq 'fresh') { 1 } else { 9 }
|
||||
if (($baselineMode -cne 'fresh' -and $baselineMode -cne 'alreadyImported') -or
|
||||
$baselineMode -cne $script:DestinationBaselineMode -or
|
||||
[int]$value.schemaVersion -ne 1 -or
|
||||
[string]$value.profile -cne 'local-settings-comparison-import' -or
|
||||
[string]$value.result -cne 'PASS' -or $null -ne $value.error -or
|
||||
[string]$value.target.expectedUrl -cne
|
||||
@@ -936,11 +956,18 @@ function Assert-LocalHarnessEvidence(
|
||||
-not (Test-ExactStringSequence @($value.settings.pickerKinds) @(
|
||||
'design', 'resource', 'background')) -or
|
||||
$value.comparison.initialPairPreserved -ne $true -or
|
||||
[int]$value.comparison.initialPairCount -ne $expectedInitialPairCount -or
|
||||
$value.comparison.secondImportIdempotent -ne $true -or
|
||||
[int]$value.comparison.afterFirstImport.receipt.addedPairCount -ne 8 -or
|
||||
[int]$value.comparison.afterFirstImport.receipt.addedPairCount -ne
|
||||
$expectedFirstAdded -or
|
||||
[int]$value.comparison.afterFirstImport.receipt.skippedDuplicateCount -ne
|
||||
$expectedFirstSkipped -or
|
||||
[int]$value.comparison.afterFirstImport.pairCount -ne 9 -or
|
||||
[int]$value.comparison.afterSecondImport.receipt.addedPairCount -ne 0 -or
|
||||
[int]$value.comparison.afterSecondImport.receipt.skippedDuplicateCount -ne 8 -or
|
||||
[int]$value.comparison.afterSecondImport.pairCount -ne 9 -or
|
||||
[string]$value.files.destinationAfterFirstImport.sha256 -cne
|
||||
$ExpectedImportedDestinationSha256 -or
|
||||
[string]$value.files.destinationAfterFirstImport.sha256 -cne
|
||||
[string]$value.files.destinationAfterSecondImport.sha256 -or
|
||||
@($value.exchanges).Count -ne 13) {
|
||||
@@ -1007,8 +1034,10 @@ if ($StaticAudit) {
|
||||
inputRetryCount = 0
|
||||
expectedSourceSha256 = $ExpectedSourceSha256
|
||||
expectedSourceRows = 8
|
||||
expectedInitialDestinationSha256 = $ExpectedInitialDestinationSha256
|
||||
expectedInitialDestinationRows = 1
|
||||
expectedFreshDestinationSha256 = $ExpectedFreshDestinationSha256
|
||||
expectedFreshDestinationRows = 1
|
||||
expectedImportedDestinationSha256 = $ExpectedImportedDestinationSha256
|
||||
expectedImportedDestinationRows = 9
|
||||
sendInputClickAvailable = $null -ne
|
||||
[LegacyPackageInputNative].GetMethod('SendApplicationClick')
|
||||
sendInputEscapeAvailable = $null -ne
|
||||
@@ -1085,8 +1114,8 @@ try {
|
||||
Throw-SafeFailure 'Final local files do not match the sealed cancel/idempotence result.'
|
||||
}
|
||||
|
||||
# This authorized import changed user-local comparison data. Avoid a second
|
||||
# activation; normal close is the only remaining app action.
|
||||
# The authorized import may have appended the fresh baseline or confirmed
|
||||
# the existing imported baseline. Normal close is the only remaining action.
|
||||
$script:Phase = 'normal close'
|
||||
Invoke-ExactNormalClose $script:ApplicationProcess $registration.Executable
|
||||
Wait-PortReleased $Port ([datetime]::UtcNow.AddSeconds(15))
|
||||
@@ -1106,7 +1135,8 @@ try {
|
||||
localInputRequestCalls = $script:LocalInputRequestCalls
|
||||
localInputAcknowledgementCalls = $script:LocalInputAcknowledgementCalls
|
||||
settingsPickerCancelCount = 3
|
||||
comparisonImportAddedCount = 8
|
||||
comparisonBaselineMode = $script:DestinationBaselineMode
|
||||
comparisonImportAddedCount = if ($script:DestinationBaselineMode -ceq 'fresh') { 8 } else { 0 }
|
||||
comparisonSecondImportAddedCount = 0
|
||||
output = $Output
|
||||
outputSha256 = (Get-FileHash -Algorithm SHA256 -LiteralPath $Output).Hash
|
||||
|
||||
Reference in New Issue
Block a user