tizen beta release
[profile/ivi/webkit-efl.git] / LayoutTests / platform / gtk / accessibility / name-from-label.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../../../fast/js/resources/js-test-pre.js"></script>
5 </head>
6 <body id="body" onload="startTest();">
7 <form>
8 <label for="foo">Full Name:</label>
9 <input type="text" id="foo" />
10 </form>
11 <p id="description"></p>
12 <div id="console"></div>
13 <script>
14   var webArea;
15   var form;
16
17   function checkResults() {
18     // Actually check the results
19     entry = form.childAtIndex(1);
20     shouldBe("entry.role", "'AXRole: entry'");
21     shouldBe("entry.title", "'AXTitle: Full Name:'");
22     finishJSTest();
23   }
24
25   function startTest() {
26     description("This tests that AtkObjects derive their names from associated labels.");
27
28     if (window.layoutTestController) {
29       layoutTestController.dumpAsText();
30     }
31
32     document.getElementById("body").focus();
33     webArea = accessibilityController.focusedElement;
34     form = webArea.childAtIndex(0);
35
36     // Check results on idle to ensure layout() is done
37     window.setTimeout("checkResults()", 0);
38   }
39
40   window.jsTestIsAsync = true;
41 </script>
42 <script src="../../../fast/js/resources/js-test-post.js"></script>
43 </body>
44 </html>