Skip to content

Commit 74927d4

Browse files
committed
bound windows community apply verify
1 parent 964458d commit 74927d4

4 files changed

Lines changed: 12 additions & 1 deletion

File tree

windows/scripts/apply-community-theme.ps1

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,12 @@ function Invoke-DreamSkinCommunityStartAndVerify {
308308
' -RequireUnpaused -OperationLockTimeoutMilliseconds ' +
309309
"$OperationLockTimeoutMilliseconds"
310310
$startProcess = Start-Process -FilePath $powershell -ArgumentList $argumentLine `
311-
-WindowStyle Hidden -Wait -PassThru
311+
-WindowStyle Hidden -PassThru
312+
if (-not $startProcess.WaitForExit($OperationLockTimeoutMilliseconds)) {
313+
try { Stop-Process -InputObject $startProcess -Force -ErrorAction SilentlyContinue } catch {}
314+
[void]$startProcess.WaitForExit(15000)
315+
throw "Dream Skin start verification did not finish within $OperationLockTimeoutMilliseconds ms."
316+
}
312317
if ($startProcess.ExitCode -ne 0) {
313318
throw "Dream Skin could not start and visibly verify the active theme (exit code $($startProcess.ExitCode))."
314319
}

windows/scripts/verify-dream-skin.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ $ErrorActionPreference = 'Stop'
88
$PortExplicit = $PSBoundParameters.ContainsKey('Port')
99
$injector = Join-Path $PSScriptRoot 'injector.mjs'
1010
. (Join-Path $PSScriptRoot 'common-windows.ps1')
11+
. (Join-Path $PSScriptRoot 'theme-windows.ps1')
1112

1213
$operationLock = Enter-DreamSkinOperationLock
1314
$verifyExitCode = 1

windows/tests/community-theme-link.tests.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,8 @@ foreach ($requiredSafety in @(
242242
'Set-DreamSkinActiveThemeFromSnapshot',
243243
'Get-DreamSkinThemeRuntimeContentFingerprint',
244244
'Invoke-DreamSkinCommunityStartAndVerify',
245+
'WaitForExit($OperationLockTimeoutMilliseconds)',
246+
'Dream Skin start verification did not finish within',
245247
'Move-DreamSkinCommunityRollbackSnapshot',
246248
"['DreamSkinRecovery']",
247249
"Join-Path `$PSScriptRoot 'start-dream-skin.ps1'",

windows/tests/run-tests.ps1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1309,6 +1309,9 @@ try {
13091309
throw 'Start lost the any-registered endpoint fallback for Store auto-updates.'
13101310
}
13111311
$verifyScriptSource = Read-DreamSkinUtf8File -Path (Join-Path $Root 'scripts\verify-dream-skin.ps1')
1312+
if (-not $verifyScriptSource.Contains(". (Join-Path `$PSScriptRoot 'theme-windows.ps1')")) {
1313+
throw 'Verify must dot-source theme-windows.ps1 before using theme store helpers such as Get-DreamSkinThemePaths.'
1314+
}
13121315
if (-not $verifyScriptSource.Contains('Get-DreamSkinVerifiedCdpIdentityForAnyRegistered')) {
13131316
throw 'Verify lost the any-registered endpoint fallback for Store auto-updates.'
13141317
}

0 commit comments

Comments
 (0)