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

Side by Side Diff: third_party/WebKit/LayoutTests/accessibility/aria-owns.html

Issue 1417213006: Switch all LayoutTests to use new AX name calculation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix canvas-fallback-content-labels-expected.txt Created 5 years, 1 month 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
1 <!DOCTYPE HTML> 1 <!DOCTYPE HTML>
2 <script src="../resources/testharness.js"></script> 2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script> 3 <script src="../resources/testharnessreport.js"></script>
4 4
5 <style> 5 <style>
6 .hideAllContainers .container { display: none; } 6 .hideAllContainers .container { display: none; }
7 </style> 7 </style>
8 8
9 <div class="container"> 9 <div class="container">
10 <ul id="list1" aria-owns="item3"> 10 <ul id="list1" aria-owns="item3">
11 <li>One</li> 11 <li>One</li>
12 <li>Two</li> 12 <li>Two</li>
13 </ul> 13 </ul>
14 <ul id="list2"> 14 <ul id="list2">
15 <li id="item3">Three</li> 15 <li id="item3">Three</li>
16 <li>Four</li> 16 <li>Four</li>
17 </ul> 17 </ul>
18 </div> 18 </div>
19 19
20 <script> 20 <script>
21 test(function(t) 21 test(function(t)
22 { 22 {
23 var axList1 = accessibilityController.accessibleElementById("list1"); 23 var axList1 = accessibilityController.accessibleElementById("list1");
24 assert_equals(axList1.role, "AXRole: AXList"); 24 assert_equals(axList1.role, "AXRole: AXList");
25 assert_equals(axList1.childrenCount, 3); 25 assert_equals(axList1.childrenCount, 3);
26 26
27 var axItem = axList1.childAtIndex(0); 27 var axItem = axList1.childAtIndex(0);
28 assert_equals(axList1.childAtIndex(0).deprecatedTitle, "AXTitle: One"); 28 assert_equals(axList1.childAtIndex(0).name, "One");
29 assert_equals(axList1.childAtIndex(1).deprecatedTitle, "AXTitle: Two"); 29 assert_equals(axList1.childAtIndex(1).name, "Two");
30 assert_equals(axList1.childAtIndex(2).deprecatedTitle, "AXTitle: Three"); 30 assert_equals(axList1.childAtIndex(2).name, "Three");
31 31
32 var axList2 = accessibilityController.accessibleElementById("list2"); 32 var axList2 = accessibilityController.accessibleElementById("list2");
33 assert_equals(axList2.role, "AXRole: AXList"); 33 assert_equals(axList2.role, "AXRole: AXList");
34 assert_equals(axList2.childrenCount, 1); 34 assert_equals(axList2.childrenCount, 1);
35 assert_equals(axList2.childAtIndex(0).deprecatedTitle, "AXTitle: Four"); 35 assert_equals(axList2.childAtIndex(0).name, "Four");
36 }, "Aria-owns moves an element from one part of the tree to another."); 36 }, "Aria-owns moves an element from one part of the tree to another.");
37 </script> 37 </script>
38 38
39 <div class="container"> 39 <div class="container">
40 <ul id="parent1" aria-owns="child"></ul> 40 <ul id="parent1" aria-owns="child"></ul>
41 <ul id="parent2" aria-owns="child"></ul> 41 <ul id="parent2" aria-owns="child"></ul>
42 <ul id="parent3"> 42 <ul id="parent3">
43 <li id="child">Child</li> 43 <li id="child">Child</li>
44 </ul> 44 </ul>
45 </div> 45 </div>
46 46
47 <script> 47 <script>
48 test(function(t) 48 test(function(t)
49 { 49 {
50 var axParent1 = accessibilityController.accessibleElementById("parent1"); 50 var axParent1 = accessibilityController.accessibleElementById("parent1");
51 var axParent2 = accessibilityController.accessibleElementById("parent2"); 51 var axParent2 = accessibilityController.accessibleElementById("parent2");
52 var axParent3 = accessibilityController.accessibleElementById("parent3"); 52 var axParent3 = accessibilityController.accessibleElementById("parent3");
53 var axChild = accessibilityController.accessibleElementById("child"); 53 var axChild = accessibilityController.accessibleElementById("child");
54 54
55 // Either parent1 or parent2 should own the child, but either one is okay. 55 // Either parent1 or parent2 should own the child, but either one is okay.
56 var axActualParent = axChild.parentElement(); 56 var axActualParent = axChild.parentElement();
57 assert_true(axActualParent.isEqual(axParent1) || axActualParent.isEqual(axPa rent2)); 57 assert_true(axActualParent.isEqual(axParent1) || axActualParent.isEqual(axPa rent2));
58 if (axActualParent.isEqual(axParent1)) { 58 if (axActualParent.isEqual(axParent1)) {
59 assert_equals(axParent1.childrenCount, 1); 59 assert_equals(axParent1.childrenCount, 1);
60 assert_equals(axParent1.childAtIndex(0).deprecatedTitle, "AXTitle: Child "); 60 assert_equals(axParent1.childAtIndex(0).name, "Child");
61 assert_equals(axParent2.childrenCount, 0); 61 assert_equals(axParent2.childrenCount, 0);
62 } else { 62 } else {
63 assert_equals(axParent1.childrenCount, 0); 63 assert_equals(axParent1.childrenCount, 0);
64 assert_equals(axParent2.childrenCount, 1); 64 assert_equals(axParent2.childrenCount, 1);
65 assert_equals(axParent2.childAtIndex(0).deprecatedTitle, "AXTitle: Child "); 65 assert_equals(axParent2.childAtIndex(0).name, "Child");
66 } 66 }
67 assert_equals(axParent3.childrenCount, 0); 67 assert_equals(axParent3.childrenCount, 0);
68 }, "If two nodes own (using aria-owns) the same element by id, only one gets to be the owner."); 68 }, "If two nodes own (using aria-owns) the same element by id, only one gets to be the owner.");
69 </script> 69 </script>
70 70
71 <div class="container"> 71 <div class="container">
72 <div id="xyz" role="group"> 72 <div id="xyz" role="group">
73 <div id="x" role="group" aria-owns="y"></div> 73 <div id="x" role="group" aria-owns="y"></div>
74 <div id="y" role="group" aria-owns="z"></div> 74 <div id="y" role="group" aria-owns="z"></div>
75 <div id="z" role="group" aria-owns="x"></div> 75 <div id="z" role="group" aria-owns="x"></div>
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 assert_equals(axLogicalParent.childAtIndex(1).childAtIndex(0).name, "2"); 152 assert_equals(axLogicalParent.childAtIndex(1).childAtIndex(0).name, "2");
153 assert_equals(axLogicalParent.childAtIndex(2).childAtIndex(0).name, "3"); 153 assert_equals(axLogicalParent.childAtIndex(2).childAtIndex(0).name, "3");
154 assert_equals(axLogicalParent.childAtIndex(3).childAtIndex(0).name, "4"); 154 assert_equals(axLogicalParent.childAtIndex(3).childAtIndex(0).name, "4");
155 }, "A parent can use aria-owns to reorder its children into a more logical AX or dering."); 155 }, "A parent can use aria-owns to reorder its children into a more logical AX or dering.");
156 </script> 156 </script>
157 157
158 <script> 158 <script>
159 if (window.testRunner) 159 if (window.testRunner)
160 document.body.className = "hideAllContainers"; 160 document.body.className = "hideAllContainers";
161 </script> 161 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698