Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2691)

Unified Diff: chrome/browser/resources/chromeos/chromevox/chromevox/injected/event_watcher_test.unitjs

Issue 596033002: Entering / exiting dialog notification should not interrupt live region. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@event_watcher_tests
Patch Set: Use map and filter Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/chromeos/chromevox/chromevox/injected/event_watcher_test.unitjs
diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/event_watcher_test.unitjs b/chrome/browser/resources/chromeos/chromevox/chromevox/injected/event_watcher_test.unitjs
index 23db11907b504b8100e50767eb9ddbd15c4e2f48..758cd9f9766d4aef5546f5896f87383c03051148 100644
--- a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/event_watcher_test.unitjs
+++ b/chrome/browser/resources/chromeos/chromevox/chromevox/injected/event_watcher_test.unitjs
@@ -736,3 +736,37 @@ TEST_F('CvoxEventWatcherUnitTest', 'ToggleOnKeyUp', function() {
.waitForCalm(this.assertSpoken, 'Not pressed')
.waitForCalm(testDone);
});
+
+/**
+ * Exiting dialog message should not interrupt a live region.
+ */
+TEST_F('CvoxEventWatcherUnitTest', 'ExitDialogWithLiveRegion', function() {
+ this.loadHtml(
+ '<div role="dialog" aria-label="MyAlert">' +
+ ' <h1>Heading</h1>' +
+ ' <button id="initial">Initial focus</button>' +
+ '</div>' +
+ '<div>' +
+ ' <button id="final">Final focus</button>' +
+ '</div>' +
+ '<div id="live" aria-live="polite"></div>');
+
+ // Focus on the button in the dialog.
+ this.setFocus('initial');
+ this.waitForCalm(this.assertSpoken,
+ 'Entered dialog MyAlert Dialog Initial focus Button')
+ .waitForCalm(function() {
+ $('live').innerText = 'Live region changed';
+ })
+ .waitForCalm(function() {
+ this.setFocus('final');
+ })
+ .waitForCalm(function() {
+ var ulist = cvox.ChromeVoxTester.testTts().getSpeechQueueOutput();
+ assertEquals('Live region changed', ulist[0]);
+ assertEquals('Exited dialog.', ulist[1]);
+ assertEquals('Final focus', ulist[2]);
+ assertEquals('Button', ulist[3]);
+ testDone();
+ });
+});

Powered by Google App Engine
This is Rietveld 408576698