4 <script src=
"../resources/js-test.js"></script>
9 <button id=
"aria-busy" aria-busy=
"false">Busy
</button>
10 <button id=
"aria-disabled" aria-disabled=
"false">Disabled
</button>
11 <button id=
"aria-readonly" aria-readonly=
"false">Readonly
</button>
12 <button id=
"aria-required" aria-required=
"false">Required
</button>
15 <div id=
"console"></div>
17 description("This test ensures that a change to any ARIA attribute, not just a state, sends a notification.");
18 window
.jsTestIsAsync
= true;
20 if (window
.testRunner
&& window
.accessibilityController
) {
21 testRunner
.dumpAsText();
23 function accessibleElementById(id
) {
24 return accessibilityController
.accessibleElementById(id
);
27 window
.successCount
= 0;
28 function gotSuccessfulNotification() {
30 if (successCount
!= 4)
33 debug('All notifications received successfully.');
34 accessibleElementById('aria-busy').removeNotificationListener();
35 accessibleElementById('aria-disabled').removeNotificationListener();
36 accessibleElementById('aria-readonly').removeNotificationListener();
37 accessibleElementById('aria-required').removeNotificationListener();
39 document
.getElementById('container').hidden
= true;
43 accessibleElementById('aria-busy').addNotificationListener(function(notification
) {
44 debug('Got ' + notification
+ ' notification on aria-busy');
45 gotSuccessfulNotification();
47 document
.getElementById('aria-busy').setAttribute('aria-busy', 'true');
49 accessibleElementById('aria-disabled').addNotificationListener(function(notification
) {
50 debug('Got ' + notification
+ ' notification on aria-disabled');
51 gotSuccessfulNotification();
53 document
.getElementById('aria-disabled').setAttribute('aria-disabled', 'true');
55 accessibleElementById('aria-readonly').addNotificationListener(function(notification
) {
56 debug('Got ' + notification
+ ' notification on aria-readonly');
57 gotSuccessfulNotification();
59 document
.getElementById('aria-readonly').setAttribute('aria-readonly', 'true');
61 accessibleElementById('aria-required').addNotificationListener(function(notification
) {
62 debug('Got ' + notification
+ ' notification on aria-required');
63 gotSuccessfulNotification();
65 document
.getElementById('aria-required').setAttribute('aria-required', 'true');