Add native Android parity captures
This commit is contained in:
parent
987e90cd90
commit
81a7ed7f44
4 changed files with 49 additions and 14 deletions
|
|
@ -39,6 +39,13 @@ viewport matrix:
|
|||
- `tablet`: 768 x 1024
|
||||
- `desktop`: 1280 x 720
|
||||
|
||||
Device runtimes also capture native physical panel cases when the platform
|
||||
adapter can control orientation without overriding size. Android currently
|
||||
emits:
|
||||
|
||||
- `native-portrait`: Periwinkle at physical portrait resolution
|
||||
- `native-landscape`: Periwinkle at physical landscape resolution
|
||||
|
||||
The semantic runner writes:
|
||||
|
||||
- `artifacts/parity/latest.md`
|
||||
|
|
@ -82,8 +89,8 @@ The harness tracks every target runtime:
|
|||
`/var/mobile/Library/EveCanvas/capture-request` service. Current iOS capture
|
||||
is fixed-device until a simulator or device-resize adapter exists.
|
||||
- Android / Kotlin: screenshot target through `adb install`, activity launch,
|
||||
`adb shell wm size`, and `adb exec-out screencap`; the script restores the
|
||||
device size after each viewport.
|
||||
optional `adb shell wm size`, orientation control, and `adb exec-out
|
||||
screencap`; the script restores device size and rotation after each viewport.
|
||||
- Windows / Flutter: screenshot target through the Flutter parity golden smoke,
|
||||
with phone, tablet, and desktop goldens.
|
||||
- Linux / Flutter: requires a Linux runner. A Windows host must fail this
|
||||
|
|
|
|||
|
|
@ -29,20 +29,25 @@ if (-not (Test-Path $absoluteApk)) {
|
|||
|
||||
$overrideSize = $Width -gt 0 -and $Height -gt 0
|
||||
$overrideRotation = $Orientation -ne "natural"
|
||||
$previousAccelerometerRotation = $null
|
||||
$previousUserRotation = $null
|
||||
$previousWindowUserRotation = $null
|
||||
$previousIgnoreOrientationRequest = $null
|
||||
try {
|
||||
if ($overrideRotation) {
|
||||
$previousAccelerometerRotation = (adb shell settings get system accelerometer_rotation).Trim()
|
||||
$previousUserRotation = (adb shell settings get system user_rotation).Trim()
|
||||
$previousWindowUserRotation = (adb shell cmd window user-rotation).Trim()
|
||||
$previousIgnoreOrientationRequest = (adb shell cmd window get-ignore-orientation-request).Trim()
|
||||
$rotation = if ($Orientation -eq "landscape") { "1" } else { "0" }
|
||||
adb shell settings put system accelerometer_rotation 0 | Out-Host
|
||||
adb shell settings put system user_rotation $rotation | Out-Host
|
||||
adb shell cmd window set-ignore-orientation-request true | Out-Host
|
||||
adb shell cmd window user-rotation lock $rotation | Out-Host
|
||||
}
|
||||
|
||||
if ($overrideSize -or $overrideRotation) {
|
||||
adb shell am force-stop $PackageName | Out-Host
|
||||
}
|
||||
|
||||
if ($overrideSize) {
|
||||
adb shell am force-stop $PackageName | Out-Host
|
||||
adb shell wm size "${Width}x${Height}" | Out-Host
|
||||
$wmWidth = if ($Orientation -eq "landscape") { $Height } else { $Width }
|
||||
$wmHeight = if ($Orientation -eq "landscape") { $Width } else { $Height }
|
||||
adb shell wm size "${wmWidth}x${wmHeight}" | Out-Host
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
throw "adb wm size failed with exit code $LASTEXITCODE"
|
||||
}
|
||||
|
|
@ -72,11 +77,15 @@ try {
|
|||
adb shell wm size reset | Out-Host
|
||||
}
|
||||
if ($overrideRotation) {
|
||||
if ($previousAccelerometerRotation -and $previousAccelerometerRotation -ne "null") {
|
||||
adb shell settings put system accelerometer_rotation $previousAccelerometerRotation | Out-Host
|
||||
if ($previousWindowUserRotation -match "^free") {
|
||||
adb shell cmd window user-rotation free | Out-Host
|
||||
} elseif ($previousWindowUserRotation -match "^lock\s+(\d+)") {
|
||||
adb shell cmd window user-rotation lock $Matches[1] | Out-Host
|
||||
}
|
||||
if ($previousUserRotation -and $previousUserRotation -ne "null") {
|
||||
adb shell settings put system user_rotation $previousUserRotation | Out-Host
|
||||
if ($previousIgnoreOrientationRequest -match "true") {
|
||||
adb shell cmd window set-ignore-orientation-request true | Out-Host
|
||||
} elseif ($previousIgnoreOrientationRequest -match "false") {
|
||||
adb shell cmd window set-ignore-orientation-request false | Out-Host
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ $runRoot = Join-Path $projectRoot (Join-Path $OutputDirectory $stamp)
|
|||
New-Item -ItemType Directory -Force $runRoot | Out-Null
|
||||
$manifest = Get-Content (Join-Path $projectRoot "tools\parity\parity-manifest.json") | ConvertFrom-Json
|
||||
$responsiveCases = @($manifest.responsiveCases)
|
||||
$androidNativeCases = @($manifest.androidNativeCases)
|
||||
|
||||
$results = [ordered]@{
|
||||
schema = "gamecult.eve.parity_smoke.v1"
|
||||
|
|
@ -87,6 +88,14 @@ try {
|
|||
}
|
||||
}
|
||||
|
||||
foreach ($case in $androidNativeCases) {
|
||||
Invoke-Capture "android-$($case.id)" {
|
||||
powershell -ExecutionPolicy Bypass -File .\scripts\capture-android-screenshot.ps1 `
|
||||
-OutputPath (Join-Path $runRoot "android-periwinkle-$($case.id).png") `
|
||||
-Orientation $case.orientation
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($case in $responsiveCases) {
|
||||
Invoke-Capture "windows-$($case.id)" {
|
||||
powershell -ExecutionPolicy Bypass -File .\scripts\capture-flutter-parity.ps1 `
|
||||
|
|
|
|||
|
|
@ -23,6 +23,16 @@
|
|||
"deviceScale": 1
|
||||
}
|
||||
],
|
||||
"androidNativeCases": [
|
||||
{
|
||||
"id": "native-portrait",
|
||||
"orientation": "portrait"
|
||||
},
|
||||
{
|
||||
"id": "native-landscape",
|
||||
"orientation": "landscape"
|
||||
}
|
||||
],
|
||||
"fixtures": [
|
||||
{
|
||||
"id": "cultui-inspector",
|
||||
|
|
|
|||
Loading…
Reference in a new issue