| <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| <html> |
| <head> |
| <script src="../../resources/accessibility-helper.js"></script> |
| <script src="../../resources/js-test.js"></script> |
| </head> |
| <body> |
| |
| <label for="startTime">Please enter a start time for the meeting: </label> |
| <input aria-errormessage="errorMessage1 errorMessage2" id="startTime" type="text" value="" aria-invalid="true"> |
| <span id="errorMessage1" aria-live="off" style="visibility:hidden">Invalid meeting time!</span> |
| <span id="errorMessage2" aria-live="off" style="visibility:hidden">The meeting time must be between 9:00 AM and 5:00 PM.</span> |
| <input type="submit" id="submitButton"> |
| |
| <script> |
| var output = "This verifies the exposure of aria-errormessage.\n\n"; |
| |
| if (window.accessibilityController) { |
| window.jsTestIsAsync = true; |
| |
| var axStartTime = accessibilityController.accessibleElementById("startTime"); |
| var errorMessages = axStartTime.errorMessageElements(); |
| output += expect("errorMessages.length", "2"); |
| output += expect("errorMessages[0].domIdentifier", "'errorMessage1'"); |
| output += expect("errorMessages[1].domIdentifier", "'errorMessage2'"); |
| |
| output += "\nChanging #startTime aria-invalid to be false.\n"; |
| document.getElementById("startTime").setAttribute("aria-invalid", "false"); |
| setTimeout(async function() { |
| output += await expectAsync("axStartTime.errorMessageElements()", "undefined"); |
| |
| debug(output); |
| finishJSTest(); |
| }, 0); |
| } |
| </script> |
| </body> |
| </html> |
| |