accessible/tests/mochitest/relations/test_tree.xul

branch
TOR_BUG_9701
changeset 8
97036ab72558
equal deleted inserted replaced
-1:000000000000 0:bb8e17dc302a
1 <?xml version="1.0"?>
2 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
3 <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
4 type="text/css"?>
5
6 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
7 title="Accessible XUL tree relations tests">
8
9 <script type="application/javascript"
10 src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
11
12 <script type="application/javascript"
13 src="../treeview.js" />
14
15 <script type="application/javascript"
16 src="../common.js" />
17 <script type="application/javascript"
18 src="../events.js" />
19 <script type="application/javascript"
20 src="../relations.js" />
21
22 <script type="application/javascript">
23 <![CDATA[
24 ////////////////////////////////////////////////////////////////////////////
25 // Test
26
27 function doTest()
28 {
29 var treeNode = getNode("tree");
30
31 var tree = getAccessible(treeNode);
32 var treeitem1 = tree.firstChild.nextSibling;
33 testRelation(treeitem1, RELATION_NODE_CHILD_OF, [tree]);
34
35 var treeitem2 = treeitem1.nextSibling;
36 testRelation(treeitem2, RELATION_NODE_CHILD_OF, [tree]);
37
38 var treeitem3 = treeitem2.nextSibling;
39 testRelation(treeitem3, RELATION_NODE_CHILD_OF, [treeitem2]);
40
41 var treeitem4 = treeitem3.nextSibling;
42 testRelation(treeitem4, RELATION_NODE_CHILD_OF, [treeitem2]);
43
44 var treeitem5 = treeitem4.nextSibling;
45 testRelation(treeitem5, RELATION_NODE_CHILD_OF, [tree]);
46
47 var treeitem6 = treeitem5.nextSibling;
48 testRelation(treeitem6, RELATION_NODE_CHILD_OF, [tree]);
49
50 testRelation(tree, RELATION_NODE_PARENT_OF,
51 [treeitem1, treeitem2, treeitem5, treeitem6]);
52 testRelation(treeitem2, RELATION_NODE_PARENT_OF,
53 [treeitem3, treeitem4]);
54
55 // treeitems and treecells shouldn't pick up relations from tree
56 testRelation(treeitem1, RELATION_LABELLED_BY, null);
57 testRelation(treeitem1.firstChild, RELATION_LABELLED_BY, null);
58
59 SimpleTest.finish();
60 }
61
62 SimpleTest.waitForExplicitFinish();
63 addA11yXULTreeLoadEvent(doTest, "tree", new nsTreeTreeView());
64 ]]>
65 </script>
66
67 <hbox flex="1" style="overflow: auto;">
68 <body xmlns="http://www.w3.org/1999/xhtml">
69 <a target="_blank"
70 href="https://bugzilla.mozilla.org/show_bug.cgi?id=503727"
71 title="Reorganize implementation of XUL tree accessibility">
72 Bug 503727
73 </a>
74 <a target="_blank"
75 href="https://bugzilla.mozilla.org/show_bug.cgi?id=527461"
76 title="Implement RELATION_NODE_PARENT_OF">
77 Bug 527461
78 </a>
79 <a target="_blank"
80 href="https://bugzilla.mozilla.org/show_bug.cgi?id=691248"
81 title="XUL tree items shouldn't pick up relations from XUL tree">
82 Bug 691248
83 </a>
84 <p id="display"></p>
85 <div id="content" style="display: none">
86 </div>
87 <pre id="test">
88 </pre>
89 </body>
90
91 <vbox flex="1">
92 <label control="tree" value="It's a tree"/>
93 <tree id="tree" flex="1">
94 <treecols>
95 <treecol id="col" flex="1" primary="true" label="column"/>
96 <treecol id="col2" flex="1" label="column2"/>
97 </treecols>
98 <treechildren/>
99 </tree>
100
101 <vbox id="debug"/>
102 </vbox>
103 </hbox>
104
105 </window>
106

mercurial