-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add placeholder support for new at additionalSettings #73
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import { startJob } from '../shared/job.js'; | ||
|
||
import { ATDriver, ATKey, webDriverCodePoints } from './at-driver.js'; | ||
Check warning on line 3 in src/runner/driver-test-runner.js
|
||
import { RunnerMessage } from './messages.js'; | ||
|
||
/** | ||
|
@@ -92,8 +92,9 @@ | |
* | ||
* @param {string} settings - "browseMode" "focusMode" for NVDA, "pcCursor" "virtualCursor" | ||
* for JAWS., "defaultMode" for others. | ||
* @param {string[]} additionalSettings - e.g. "speechRateIncrease" and "commentAnnouncementOn" for JAWS | ||
*/ | ||
async ensureSettings(settings) { | ||
async ensureSettings(settings, additionalSettings) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can revert on including Examples of how this has been handled at w3c/aria-at#1126: |
||
const { atName } = await this.collectedCapabilities; | ||
if (atName == 'NVDA') { | ||
const desiredResponse = { browsemode: 'Browse mode', focusmode: 'Focus mode' }[ | ||
|
@@ -123,6 +124,12 @@ | |
}, | ||
}); | ||
} | ||
for (const additionalSetting of additionalSettings) { | ||
switch (additionalSetting) { | ||
default: | ||
throw new Error(`Unrecognized addditional setting for NVDA: ${additionalSetting}`); | ||
} | ||
} | ||
} else if (atName == 'VoiceOver') { | ||
if (settings === 'quickNavOn' || settings === 'arrowQuickKeyNavOn') { | ||
await this.pressKeysToToggleSetting( | ||
|
@@ -147,6 +154,12 @@ | |
} else if (settings !== 'defaultMode') { | ||
throw new Error(`Unrecognized setting for VoiceOver: ${settings}`); | ||
} | ||
for (const additionalSetting of additionalSettings) { | ||
switch (additionalSetting) { | ||
default: | ||
throw new Error(`Unrecognized addditional setting for VoiceOver: ${additionalSetting}`); | ||
} | ||
} | ||
return; | ||
} else if (!atName) { | ||
return; | ||
|
@@ -162,7 +175,7 @@ | |
async ensureMode(mode) { | ||
const { atName } = await this.collectedCapabilities; | ||
if (atName === 'NVDA') { | ||
await this.ensureSettings(mode.toLowerCase() === 'reading' ? 'browseMode' : 'focusMode'); | ||
await this.ensureSettings(mode.toLowerCase() === 'reading' ? 'browseMode' : 'focusMode', []); | ||
return; | ||
} else if (atName === 'VoiceOver') { | ||
return; | ||
|
@@ -204,7 +217,7 @@ | |
|
||
if (command.settings) { | ||
// Ensure AT is in proper mode for tests. V2 tests define "settings" per command. | ||
await this.ensureSettings(command.settings); | ||
await this.ensureSettings(command.settings, command.additionalSettings); | ||
} else if (test.target?.mode) { | ||
// V1 tests define a "mode" of "reading" or "interaction" on the test.target | ||
await this.ensureMode(test.target.mode); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change isn't present in Howard's patch. Since the file needs to match the corresponding file in the aria-at repository, we'll need to resolve the discrepancy before merging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, i noticed that too! i have a PR open to Howard's patch here: w3c/aria-at#1128
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks both! As with my comment in w3c/aria-at#1128, this change should no longer be necessary