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

Side by Side Diff: LayoutTests/platform/chromium/accessibility/text-change-notification.html

Issue 14120003: Move LayoutTests from platform/chromium/... to generic location (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <script src="../../../fast/js/resources/js-test-pre.js"></script>
5 </head>
6 <body>
7
8 <div id="container">
9 <button id="aria-label" aria-label="Aria Label">Content</button>
10 <button id="title" title="Title">Content</button>
11 <button id="labelledby" aria-labelledby="label1">Content</button>
12 <button id="labeled">Content</button>
13
14 <label id="label1">Label1</label>
15 <label id="label2">Label2</label>
16 </div>
17
18 <div id="console"></div>
19 <script>
20 description("This test ensures that a change to an element's accessible text, ev en if indirect, sends a notification.");
21 window.jsTestIsAsync = true;
22
23 if (window.testRunner && window.accessibilityController) {
24 testRunner.dumpAsText();
25
26 function accessibleElementById(id) {
27 return accessibilityController.accessibleElementById(id);
28 }
29
30 window.successCount = 0;
31 function gotSuccessfulNotification() {
32 successCount++;
33 if (successCount != 4)
34 return;
35
36 debug('All notifications received successfully.');
37 accessibleElementById('aria-label').removeNotificationListener();
38 accessibleElementById('title').removeNotificationListener();
39 accessibleElementById('labelledby').removeNotificationListener();
40 accessibleElementById('labeled').removeNotificationListener();
41
42 document.getElementById('container').hidden = true;
43 finishJSTest();
44 }
45
46 accessibleElementById('aria-label').addNotificationListener(function(notific ation) {
47 debug('Got ' + notification + ' notification on aria-label');
48 gotSuccessfulNotification();
49 });
50 document.getElementById('aria-label').setAttribute('aria-label', 'New aria-l abel');
51
52 accessibleElementById('title').addNotificationListener(function(notification ) {
53 debug('Got ' + notification + ' notification on title');
54 gotSuccessfulNotification();
55 });
56 document.getElementById('title').title = 'New title';
57
58 accessibleElementById('labelledby').addNotificationListener(function(notific ation) {
59 debug('Got ' + notification + ' notification on labelledby');
60 gotSuccessfulNotification();
61 });
62 document.getElementById('labelledby').setAttribute('aria-labelledby', 'label 2');
63
64 accessibleElementById('labeled').addNotificationListener(function(notificati on) {
65 debug('Got ' + notification + ' notification on labeled');
66 gotSuccessfulNotification();
67 });
68 document.getElementById('label1').setAttribute('for', 'labeled');
69
70 debug('');
71 }
72
73 </script>
74
75 <script src="../../../fast/js/resources/js-test-post.js"></script>
76 </body>
77 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698