accessible/tests/mochitest/relations/test_tree.xul

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/accessible/tests/mochitest/relations/test_tree.xul	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,106 @@
     1.4 +<?xml version="1.0"?>
     1.5 +<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
     1.6 +<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
     1.7 +                 type="text/css"?>
     1.8 +
     1.9 +<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
    1.10 +        title="Accessible XUL tree relations tests">
    1.11 +
    1.12 +  <script type="application/javascript"
    1.13 +          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
    1.14 +
    1.15 +  <script type="application/javascript"
    1.16 +          src="../treeview.js" />
    1.17 +
    1.18 +  <script type="application/javascript"
    1.19 +          src="../common.js" />
    1.20 +  <script type="application/javascript"
    1.21 +          src="../events.js" />
    1.22 +  <script type="application/javascript"
    1.23 +          src="../relations.js" />
    1.24 +
    1.25 +  <script type="application/javascript">
    1.26 +  <![CDATA[
    1.27 +    ////////////////////////////////////////////////////////////////////////////
    1.28 +    // Test
    1.29 +
    1.30 +    function doTest()
    1.31 +    {
    1.32 +      var treeNode = getNode("tree");
    1.33 +
    1.34 +      var tree = getAccessible(treeNode);
    1.35 +      var treeitem1 = tree.firstChild.nextSibling;
    1.36 +      testRelation(treeitem1, RELATION_NODE_CHILD_OF, [tree]);
    1.37 +
    1.38 +      var treeitem2 = treeitem1.nextSibling;
    1.39 +      testRelation(treeitem2, RELATION_NODE_CHILD_OF, [tree]);
    1.40 +
    1.41 +      var treeitem3 = treeitem2.nextSibling;
    1.42 +      testRelation(treeitem3, RELATION_NODE_CHILD_OF, [treeitem2]);
    1.43 +
    1.44 +      var treeitem4 = treeitem3.nextSibling;
    1.45 +      testRelation(treeitem4, RELATION_NODE_CHILD_OF, [treeitem2]);
    1.46 +
    1.47 +      var treeitem5 = treeitem4.nextSibling;
    1.48 +      testRelation(treeitem5, RELATION_NODE_CHILD_OF, [tree]);
    1.49 +
    1.50 +      var treeitem6 = treeitem5.nextSibling;
    1.51 +      testRelation(treeitem6, RELATION_NODE_CHILD_OF, [tree]);
    1.52 +
    1.53 +      testRelation(tree, RELATION_NODE_PARENT_OF,
    1.54 +                   [treeitem1, treeitem2, treeitem5, treeitem6]);
    1.55 +      testRelation(treeitem2, RELATION_NODE_PARENT_OF,
    1.56 +                   [treeitem3, treeitem4]);
    1.57 +
    1.58 +      // treeitems and treecells shouldn't pick up relations from tree
    1.59 +      testRelation(treeitem1, RELATION_LABELLED_BY, null);
    1.60 +      testRelation(treeitem1.firstChild, RELATION_LABELLED_BY, null);
    1.61 +
    1.62 +      SimpleTest.finish();
    1.63 +    }
    1.64 +
    1.65 +    SimpleTest.waitForExplicitFinish();
    1.66 +    addA11yXULTreeLoadEvent(doTest, "tree", new nsTreeTreeView());
    1.67 +  ]]>
    1.68 +  </script>
    1.69 +
    1.70 +  <hbox flex="1" style="overflow: auto;">
    1.71 +    <body xmlns="http://www.w3.org/1999/xhtml">
    1.72 +      <a target="_blank"
    1.73 +         href="https://bugzilla.mozilla.org/show_bug.cgi?id=503727"
    1.74 +         title="Reorganize implementation of XUL tree accessibility">
    1.75 +        Bug 503727
    1.76 +      </a>
    1.77 +      <a target="_blank"
    1.78 +         href="https://bugzilla.mozilla.org/show_bug.cgi?id=527461"
    1.79 +         title="Implement RELATION_NODE_PARENT_OF">
    1.80 +        Bug 527461
    1.81 +      </a>
    1.82 +      <a target="_blank"
    1.83 +         href="https://bugzilla.mozilla.org/show_bug.cgi?id=691248"
    1.84 +         title="XUL tree items shouldn't pick up relations from XUL tree">
    1.85 +        Bug 691248
    1.86 +      </a>
    1.87 +      <p id="display"></p>
    1.88 +      <div id="content" style="display: none">
    1.89 +      </div>
    1.90 +      <pre id="test">
    1.91 +      </pre>
    1.92 +    </body>
    1.93 +
    1.94 +    <vbox flex="1">
    1.95 +      <label control="tree" value="It's a tree"/>
    1.96 +      <tree id="tree" flex="1">
    1.97 +        <treecols>
    1.98 +          <treecol id="col" flex="1" primary="true" label="column"/>
    1.99 +          <treecol id="col2" flex="1" label="column2"/>
   1.100 +        </treecols>
   1.101 +        <treechildren/>
   1.102 +      </tree>
   1.103 +
   1.104 +      <vbox id="debug"/>
   1.105 +    </vbox>
   1.106 +  </hbox>
   1.107 +
   1.108 +</window>
   1.109 +

mercurial