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

Side by Side Diff: third_party/WebKit/LayoutTests/accessibility/nochildren-elements.html

Issue 2382083002: Make LayoutTests ambivalent of of anonymous blocks (Closed)
Patch Set: Created 4 years, 2 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
1 <html> 1 <html>
2 <script> 2 <script>
3 if (window.testRunner) 3 if (window.testRunner)
4 testRunner.dumpAsText(); 4 testRunner.dumpAsText();
5 </script> 5 </script>
6 <body id='body'> 6 <body id='body'>
7 7
8 8
9 <!-- This test makes sure that these types of elements DO NOT have children. 9 <!-- This test makes sure that these types of elements DO NOT have children.
10 The test will pass if attributesOfChildren() returns nil --> 10 The test will pass if attributesOfChildren() returns nil -->
11 11
12 <input type="file"> 12 <input id="file" type="file">
13 <div role="button"><b><i>inside</i></b></div> 13 <div id="button" role="button"><b><i>inside</i></b></div>
14 14
15 <div id="result"></div> 15 <div id="result"></div>
16 16
17 17
18 <script> 18 <script>
19 if (window.accessibilityController) { 19 if (window.accessibilityController) {
20 var result = document.getElementById("result"); 20 var result = document.getElementById("result");
21 21
22 // radio button 1 22 var element1 = accessibilityController.accessibleElementById("file") ;
23 var body = document.getElementById("body");
24 body.focus();
25 var focusedElement = accessibilityController.focusedElement;
26 23
27 // this input=file is inside of a group, so we need to go two levels 24 var element2 = accessibilityController.accessibleElementById("button ");
28 var element1 = focusedElement.childAtIndex(0);
29 element1 = element1.childAtIndex(0);
30
31 var element2 = focusedElement.childAtIndex(1);
32 25
33 var element1Children = element1.attributesOfChildren(); 26 var element1Children = element1.attributesOfChildren();
34 var element2Children = element2.attributesOfChildren(); 27 var element2Children = element2.attributesOfChildren();
35 28
36 if (element1Children != "" || element2Children != "") { 29 if (element1Children != "" || element2Children != "") {
37 result.innerText += "FAIL\n" + element1Children + "\n" + element2 Children; 30 result.innerText += "FAIL\n" + element1Children + "\n" + element2 Children;
38 } 31 }
39 else { 32 else {
40 result.innerText += "PASS"; 33 result.innerText += "PASS";
41 } 34 }
42 } 35 }
43 </script> 36 </script>
44 </body> 37 </body>
45 </html> 38 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698