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

Side by Side Diff: LayoutTests/accessibility/name-calc-native-markup-buttons.html

Issue 1301993003: Last few steps of text alternative computation algorithm (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Testing all the special cases Created 5 years, 4 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
OLDNEW
(Empty)
1 <!DOCTYPE HTML>
2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script>
4
5 <style>
6 .hideAllContainers .container {
7 display: none;
8 }
9 </style>
10
11 <div class="container">
12 <button id="button1"></button>
13 </div>
14
15 <script>
16 test(function(t) {
17 var axButton1 = accessibilityController.accessibleElementById("button1");
18 assert_equals(axButton1.name, "");
19 }, "Button with no content");
20 </script>
21
22 <div class="container">
23 <button id="button2">button2-content</button>
24 </div>
25
26 <script>
27 test(function(t) {
28 var axButton2 = accessibilityController.accessibleElementById("button2");
29 assert_equals(axButton2.name, "button2-content");
30 assert_equals(axButton2.nameFrom, "contents");
31 }, "Button with text content");
32 </script>
33
34 <div class="container">
35 <button id="button3"><img src="resources/cake.png"></button>
36 </div>
37
38 <script>
39 test(function(t) {
40 var axButton3 = accessibilityController.accessibleElementById("button3");
41 assert_equals(axButton3.name, "");
42 }, "Button with img content with no alt");
43 </script>
44
45 <div class="container">
46 <button id="button4"><img src="resources/cake.png" alt="cake"></button>
47 </div>
48
49 <script>
50 test(function(t) {
51 var axButton4 = accessibilityController.accessibleElementById("button4");
52 assert_equals(axButton4.name, "cake");
dmazzoni 2015/08/24 18:02:03 I'm excited that this works correctly! Could you
aboxhall 2015/08/25 02:45:53 Done. It turned out it _didn't_ work, so I made a
53 assert_equals(axButton4.nameFrom, "contents");
54 }, "Button with img content with alt");
55 </script>
56
57 <div class="container">
58 <button id="button5" title="button5-title"></button>
59 </div>
60
61 <script>
62 test(function(t) {
63 var axButton5 = accessibilityController.accessibleElementById("button5");
64 assert_equals(axButton5.name, "button5-title");
65 assert_equals(axButton5.nameFrom, "attribute");
66 }, "Button with title only");
67 </script>
68
69 <div class="container">
70 <button id="button6" title="button6-title">button6-content</button>
71 </div>
72
73 <script>
74 test(function(t) {
75 var axButton6 = accessibilityController.accessibleElementById("button6");
76 assert_equals(axButton6.name, "button6-content");
77 assert_equals(axButton6.nameFrom, "contents");
78 }, "Button with title and contents");
79 </script>
80
81 <div class="container">
82 <button id="button7" title="button7-title"><img src="resources/cake.png"></b utton>
83 </div>
84
85 <script>
86 test(function(t) {
87 var axButton7 = accessibilityController.accessibleElementById("button7");
88 assert_equals(axButton7.name, "button7-title");
89 assert_equals(axButton7.nameFrom, "attribute");
90 }, "Button with title and img content with no alt");
91 </script>
92
93 <div class="container">
94 <button id="button8" title="button8-title"><img src="resources/cake.png" alt ="cake"></button>
95 </div>
96
97 <script>
98 test(function(t) {
99 var axButton8 = accessibilityController.accessibleElementById("button8");
100 assert_equals(axButton8.name, "cake");
101 assert_equals(axButton8.nameFrom, "contents");
102 }, "Button with title and img content with alt");
103 </script>
104
105 <div class="container">
106 <button id="button9">button9-content</button>
107 <label for="button9">label-for-button9</label>
108 </div>
109
110 <script>
111 test(function(t) {
112 var axButton9 = accessibilityController.accessibleElementById("button9");
113 assert_equals(axButton9.name, "label-for-button9");
114 assert_equals(axButton9.nameFrom, "relatedElement");
115 }, "Button with text content and label");
116 </script>
117
118
119 <script>
120 if (window.testRunner)
121 document.body.className = "hideAllContainers";
122 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698