Source code
Revision control
Copy as Markdown
Other Tools
<!DOCTYPE html>
<html>
<head>
<title>ARIA Notify API Test: Priority Queue</title>
<link rel="author" title="Jacques Newman" href="mailto:janewman@microsoft.com">
<script src="core-aam/arianotify/resources/aria-notify-helpers.js"></script>
</head>
<body>
<h1>ARIA Notify API Test: Priority Queue</h1>
<p>This test checks the behavior of the <code>ariaNotify</code> API with mixed priority messages to test queue
behavior.</p>
<h2>Setup Instructions</h2>
<p><strong>Setup:</strong> Use a screen reader (NVDA, JAWS, VoiceOver, etc.) or other assistive technology that
supports the ARIA Notify API.</p>
<p><strong>Instructions:</strong> Click the "Run Test" button and listen for the announced text from your screen reader.</p>
<div>
<h3>Test: A Normal Priority Message Followed by a High Priority Message</h3>
<p>A normal-priority "Loading..." message followed by a high-priority "Loading failed." message, both fired against
the document.</p>
<p><strong>Expected:</strong> Screen reader should announce "Loading..." at normal priority, then "Loading failed."
at high priority. The high priority message should be prioritized in the queue.</p>
<button onclick="test()">Run Test</button>
<div id="status"></div>
<script>
function test() {
// Fire the first message at normal priority
let status = tryCallAriaNotify(document, 'Loading...', { priority: 'normal' });
// Fire the second message at high priority
status += ' ' + tryCallAriaNotify(document, 'Loading failed.', { priority: 'high' });
document.getElementById('status').textContent = status;
}
</script>
</div>
</body>
</html>