Bug 1968547: Add test to verify no error message event is fired when aria-invalid=false r=Jamie a=dmeehan
Differential Revision: https://phabricator.services.mozilla.com/D253399
This commit is contained in:
committed by
dmeehan@mozilla.com
parent
7bfb0e8915
commit
889171cae3
@@ -266,3 +266,26 @@ addAccessibleTask(
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
/**
|
||||
* This test modifies the innerText of an associated error message on an
|
||||
* input with aria-invalid=false and verifies the error change event
|
||||
* is NOT fired.
|
||||
*/
|
||||
addAccessibleTask(
|
||||
`
|
||||
<label for="input">Valid field with associated error error</label><input id="input" aria-invalid="false" aria-errormessage="error-msg">
|
||||
<div id="error-msg">Field validation failed</div>
|
||||
`,
|
||||
async (browser, _accDoc) => {
|
||||
// XXX: We don't have a way to await unexpected, non-core events, so we
|
||||
// use the core EVENT_ERRORMESSAGE_CHANGED here as a proxy for AXValidationErrorChanged
|
||||
const unexpectedEvents = { unexpected: [[EVENT_ERRORMESSAGE_CHANGED]] };
|
||||
info("Setting new error message text");
|
||||
await contentSpawnMutation(browser, unexpectedEvents, function () {
|
||||
content.document.getElementById("error-msg").innerText =
|
||||
"new error message";
|
||||
});
|
||||
ok(true, "Did not receive error message event!");
|
||||
}
|
||||
);
|
||||
|
||||
@@ -16,6 +16,8 @@ const EVENT_DOCUMENT_LOAD_COMPLETE =
|
||||
const EVENT_DOCUMENT_RELOAD = nsIAccessibleEvent.EVENT_DOCUMENT_RELOAD;
|
||||
const EVENT_DOCUMENT_LOAD_STOPPED =
|
||||
nsIAccessibleEvent.EVENT_DOCUMENT_LOAD_STOPPED;
|
||||
const EVENT_ERRORMESSAGE_CHANGED =
|
||||
nsIAccessibleEvent.EVENT_ERRORMESSAGE_CHANGED;
|
||||
const EVENT_HIDE = nsIAccessibleEvent.EVENT_HIDE;
|
||||
const EVENT_FOCUS = nsIAccessibleEvent.EVENT_FOCUS;
|
||||
const EVENT_NAME_CHANGE = nsIAccessibleEvent.EVENT_NAME_CHANGE;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
EVENT_DESCRIPTION_CHANGE, EVENT_NAME_CHANGE, EVENT_STATE_CHANGE,
|
||||
EVENT_VALUE_CHANGE, EVENT_TEXT_VALUE_CHANGE, EVENT_FOCUS,
|
||||
EVENT_DOCUMENT_RELOAD, EVENT_VIRTUALCURSOR_CHANGED, EVENT_ALERT,
|
||||
EVENT_OBJECT_ATTRIBUTE_CHANGED, EVENT_MENUPOPUP_START, EVENT_MENUPOPUP_END,
|
||||
EVENT_OBJECT_ATTRIBUTE_CHANGED, EVENT_MENUPOPUP_START, EVENT_MENUPOPUP_END, EVENT_ERRORMESSAGE_CHANGED,
|
||||
UnexpectedEvents, waitForEvent,
|
||||
waitForEvents, waitForOrderedEvents, waitForStateChange,
|
||||
stateChangeEventArgs */
|
||||
@@ -55,6 +55,8 @@ const EVENT_OBJECT_ATTRIBUTE_CHANGED =
|
||||
const EVENT_INNER_REORDER = nsIAccessibleEvent.EVENT_INNER_REORDER;
|
||||
const EVENT_MENUPOPUP_START = nsIAccessibleEvent.EVENT_MENUPOPUP_START;
|
||||
const EVENT_MENUPOPUP_END = nsIAccessibleEvent.EVENT_MENUPOPUP_END;
|
||||
const EVENT_ERRORMESSAGE_CHANGED =
|
||||
nsIAccessibleEvent.EVENT_ERRORMESSAGE_CHANGED;
|
||||
|
||||
const EventsLogger = {
|
||||
enabled: false,
|
||||
|
||||
Reference in New Issue
Block a user