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

Side by Side Diff: LayoutTests/platform/chromium/accessibility/is-ignored-change-sends-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
10 <div id="hiddenDivContainer" aria-label="hiddenDivContainer">
11 <div id="hiddenDiv" hidden>
12 <div>
13 <button>Button</button>
14 </div>
15 </div>
16 </div>
17
18 <div id="invisibleDivContainer" aria-label="invisibleDivContainer">
19 <div id="invisibleDiv" style="visibility: hidden">
20 <div>
21 <button>Button</button>
22 </div>
23 </div>
24 </div>
25
26 <div id="emptyDivContainer" aria-label="emptyDivContainer">
27 <div id="emptyDiv"></div>
28 </div>
29
30 <div id="divWithoutRoleContainer" aria-label="divWithoutRoleContainer">
31 <div id="divWithoutRole">
32 <div>
33 <button>Button</button>
34 </div>
35 </div>
36 </div>
37
38 <div id="divWithoutLabelContainer" aria-label="divWithoutLabelContainer">
39 <div id="divWithoutLabel">
40 <div>
41 <button>Button</button>
42 </div>
43 </div>
44 </div>
45
46 </div>
47
48 <div id="console"></div>
49 <script>
50 description("This test ensures that a change to accessibilityIsIgnored fires a c hildren changed notification on the parent.");
51 window.jsTestIsAsync = true;
52
53 if (window.testRunner && window.accessibilityController) {
54 testRunner.dumpAsText();
55
56 function accessibleElementById(id) {
57 return accessibilityController.accessibleElementById(id);
58 }
59
60 window.successCount = 0;
61 function gotSuccessfulNotification() {
62 successCount++;
63 if (successCount != 5)
64 return;
65
66 debug('All notifications received successfully.');
67 accessibleElementById('hiddenDivContainer').removeNotificationListener() ;
68 accessibleElementById('invisibleDivContainer').removeNotificationListene r();
69 accessibleElementById('emptyDivContainer').removeNotificationListener();
70 accessibleElementById('divWithoutRoleContainer').removeNotificationListe ner();
71 accessibleElementById('divWithoutLabelContainer').removeNotificationList ener();
72 document.getElementById('container').hidden = true;
73 finishJSTest();
74 }
75
76 shouldBeTrue("accessibleElementById('hiddenDivContainer') != null");
77 shouldBeFalse("accessibleElementById('hiddenDiv') != null");
78 accessibleElementById('hiddenDivContainer').addNotificationListener(function (notification) {
79 debug('Got ' + notification + ' notification on hiddenDivContainer');
80 shouldBe("accessibleElementById('hiddenDivContainer').childrenCount", "1 ");
81 gotSuccessfulNotification();
82 });
83 document.getElementById('hiddenDiv').hidden = false;
84
85 shouldBeTrue("accessibleElementById('invisibleDivContainer') != null");
86 shouldBeFalse("accessibleElementById('invisibleDiv') != null");
87 accessibleElementById('invisibleDivContainer').addNotificationListener(funct ion(notification) {
88 debug('Got ' + notification + ' notification on invisibleDivContainer');
89 shouldBe("accessibleElementById('invisibleDivContainer').childrenCount", "1");
90 gotSuccessfulNotification();
91 });
92 document.getElementById('invisibleDiv').style.visibility = 'visible';
93
94 shouldBeTrue("accessibleElementById('emptyDivContainer') != null");
95 shouldBeFalse("accessibleElementById('emptyDiv') != null");
96 accessibleElementById('emptyDivContainer').addNotificationListener(function( notification) {
97 debug('Got ' + notification + ' notification on emptyDivContainer');
98 shouldBe("accessibleElementById('emptyDivContainer').childrenCount", "1" );
99 gotSuccessfulNotification();
100 });
101
102 document.getElementById('emptyDiv').innerText = 'Not empty anymore.';
103 document.getElementById('emptyDiv').offsetLeft;
104
105 shouldBeTrue("accessibleElementById('divWithoutRoleContainer') != null");
106 shouldBeFalse("accessibleElementById('divWithoutRole') != null");
107 accessibleElementById('divWithoutRoleContainer').addNotificationListener(fun ction(notification) {
108 debug('Got ' + notification + ' notification on divWithoutRoleContainer' );
109 shouldBe("accessibleElementById('divWithoutRoleContainer').childrenCount ", "1");
110 gotSuccessfulNotification();
111 });
112 document.getElementById('divWithoutRole').setAttribute('role', 'heading');
113
114 shouldBeTrue("accessibleElementById('divWithoutLabelContainer') != null");
115 shouldBeFalse("accessibleElementById('divWithoutLabel') != null");
116 accessibleElementById('divWithoutLabelContainer').addNotificationListener(fu nction(notification) {
117 debug('Got ' + notification + ' notification on divWithoutLabelContainer ');
118 shouldBe("accessibleElementById('divWithoutLabelContainer').childrenCoun t", "1");
119 gotSuccessfulNotification();
120 });
121 document.getElementById('divWithoutLabel').setAttribute('aria-label', 'Label ');
122
123 debug('');
124 }
125
126 </script>
127
128 <script src="../../../fast/js/resources/js-test-post.js"></script>
129 </body>
130 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698