Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ foreach ($headless in @($false, $true)) {
"Headless navigation selection: 179 checks, 0 failures")
} else {
@("", '"%GRAPHCODE_NATIVE_PROVIDER%"', "oleaut32.lib uiautomationcore.lib user32.lib",
"Native accessibility provider: 280 checks, 0 failures")
"Native accessibility provider: 281 checks, 0 failures")
}
$actual = @($plan.definitions, $plan.providerSource, $plan.libraries, $plan.summary)
for ($index = 0; $index -lt $expected.Count; $index++) {
Expand All @@ -47,6 +47,25 @@ foreach ($literal in @(
if (-not $nativeSource.Contains($literal)) { throw "Native compile plan is not enforced: $literal" }
$planChecks++
}
function Test-NativeHeaderIdentityContract([string] $Source) {
$attention = 'check\(stringProperty\(attention,\s*UIA_AutomationIdPropertyId\)\s*==\s*L"header-attention:needs-you",\s*"Needs-you header exposes its exact public automation id"\);'
$overflow = 'check\(stringProperty\(overflow,\s*UIA_AutomationIdPropertyId\)\.rfind\(\s*L"header-overflow-",\s*0\)\s*==\s*0,\s*"header overflow exposes its stable automation id prefix"\);'
return $Source -match "(?s)$attention" -and $Source -match "(?s)$overflow"
}
$nativeCppSource = [IO.File]::ReadAllText((Join-Path $PSScriptRoot "AccessibilityProvider.Native.Tests.cpp"))
if (-not (Test-NativeHeaderIdentityContract $nativeCppSource)) {
throw "Native header checks do not independently assert Needs-you and overflow identities"
}
$planChecks++
$mutatedNativeCppSource = $nativeCppSource.Replace(
'L"header-attention:needs-you"',
'L"header-attention:mutated"',
[StringComparison]::Ordinal)
if ($mutatedNativeCppSource -ceq $nativeCppSource -or
(Test-NativeHeaderIdentityContract $mutatedNativeCppSource)) {
throw "Native header mutation retained the exact Needs-you identity contract"
}
$planChecks++
Write-Host "Native accessibility compile plan: $planChecks checks, 0 failures (source/data only)"
if ($PlanOnly) {
if ($ArtifactRoot) {
Expand Down
27 changes: 17 additions & 10 deletions Tools/windows/Tests/AccessibilityProvider.Native.Tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -868,22 +868,28 @@ static void nativeHeaderOverflowChecks(IRawElementProviderSimple *provider, HWND
"header overflow provider supports fragment hit-testing");
if (!root) return;
const char *identity = "header-overflow:actions";
const char *identities[] = {identity};
const char *names[] = {"More actions"};
const int parents[] = {1};
const int none[] = {0};
const int eligible[] = {1};
const int invokable_flags[] = {1};
const int bounds[] = {444, 5, 480, 29};
const char *identities[] = {"header-attention:needs-you", identity};
const char *names[] = {"1 need you", "More actions"};
const int parents[] = {1, 1};
const int none[] = {0, 0};
const int eligible[] = {1, 1};
const int invokable_flags[] = {1, 1};
const int bounds[] = {300, 5, 412, 29, 444, 5, 480, 29};
auto update = &gc_uia_update;
check(update(provider, "Header overflow", identities, names, parents, none, eligible,
invokable_flags, bounds, 1, 0, 1, 0, 0, 0, 0) == S_OK,
invokable_flags, bounds, 2, 0, 1, 0, 0, 0, 0) == S_OK,
"header overflow publishes");

auto *projects = child(root_fragment, NavigateDirection_FirstChild);
auto *overflow = child(projects, NavigateDirection_FirstChild);
auto *attention = child(projects, NavigateDirection_FirstChild);
IRawElementProviderFragment *overflow = nullptr;
if (attention) attention->Navigate(NavigateDirection_NextSibling, &overflow);
checkName(overflow, L"More actions");
check(stringProperty(overflow, UIA_AutomationIdPropertyId).rfind(L"header-overflow-", 0) == 0,
check(stringProperty(attention, UIA_AutomationIdPropertyId) ==
L"header-attention:needs-you",
"Needs-you header exposes its exact public automation id");
check(stringProperty(overflow, UIA_AutomationIdPropertyId).rfind(
L"header-overflow-", 0) == 0,
"header overflow exposes its stable automation id prefix");

IRawElementProviderSimple *simple = nullptr;
Expand Down Expand Up @@ -937,6 +943,7 @@ static void nativeHeaderOverflowChecks(IRawElementProviderSimple *provider, HWND
"header overflow wins native UIA coordinate hit-testing");

if (overflow) overflow->Release();
if (attention) attention->Release();
if (projects) projects->Release();
root->Release();
}
Expand Down
2 changes: 1 addition & 1 deletion Tools/windows/Tests/AccessibilityProvider.Native.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ function Get-AccessibilityProviderNativeTestPlan([bool] $HeadlessSelection) {
definitions = ""
providerSource = '"%GRAPHCODE_NATIVE_PROVIDER%"'
libraries = "oleaut32.lib uiautomationcore.lib user32.lib"
summary = "Native accessibility provider: 280 checks, 0 failures"
summary = "Native accessibility provider: 281 checks, 0 failures"
}
}
$plan = Get-AccessibilityProviderNativeTestPlan ([bool]$HeadlessSelection)
Expand Down
1 change: 1 addition & 0 deletions Tools/windows/Tests/ValidationRunner.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3795,6 +3795,7 @@ try {
return $value.StartsWith($prefix, [StringComparison]::Ordinal)
}
foreach ($identity in @(
'header-attention:needs-you',
'wire-node-1000000000000000001',
'mark-entry-1000000000000000002',
'overview-wire-node-1000000000000000003',
Expand Down
2 changes: 1 addition & 1 deletion Tools/windows/ValidationRunner/Manifests/ui.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"units": [
{ "id": "ui.navigation.headless-runner-plan", "owner": "Ui", "minimumCount": 14, "exactCount": 14, "requiredGroups": [] },
{ "id": "ui.navigation.headless-runner-plan", "owner": "Ui", "minimumCount": 16, "exactCount": 16, "requiredGroups": [] },
{ "id": "ui.popup.effect.expected-modal-transition", "owner": "Ui", "minimumCount": 1, "exactCount": 1, "requiredGroups": [] },
{ "id": "ui.popup.receipt.cancelled-after-queued-input", "owner": "Ui", "minimumCount": 1, "exactCount": 1, "requiredGroups": [] },
{ "id": "ui.navigation.selection-event-controls", "owner": "Ui", "minimumCount": 12, "exactCount": 12,
Expand Down
2 changes: 1 addition & 1 deletion Tools/windows/uia-live-gate.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4443,7 +4443,7 @@ function Read-MultiProjectMetadataProperty($element, [string] $property) {
function Test-MultiProjectSourceSupportedChromeId([string] $identity, [string] $ownership) {
if ($ownership -cne "owned") { return $false }
$staticIds = @("canvas-primary-action", "zoom-out", "actual-size", "zoom-in", "fit-canvas",
"overview-destination", "quick-chats-destination")
"overview-destination", "quick-chats-destination", "header-attention:needs-you")
$chromePrefixes = @("sidebar-section-", "project-row-", "project-new-loop-", "project-disclosure-",
"quick-chats-header-", "quick-chat-new-", "quick-chats-disclosure-", "quick-chat-row-", "sidebar-update-banner-",
"workspace-footer-",
Expand Down
2 changes: 2 additions & 0 deletions graphcode-windows/src/AccessibilityProvider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1354,6 +1354,8 @@ class Node final : public IRawElementProviderSimple,
std::wstring automationIdLocked() const {
if (isRowKey(id_)) {
const Row &row = state_->rows.at(id_);
if (row.identity == "header-attention:needs-you")
return L"header-attention:needs-you";
const int parent = row.parent;
const wchar_t *prefix =
row.identity.rfind("sidebar-section:", 0) == 0 ? L"sidebar-section-" :
Expand Down
Loading