accessible/tests/mochitest/relations/test_tree.xul

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     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"?>
     6 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
     7         title="Accessible XUL tree relations tests">
     9   <script type="application/javascript"
    10           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
    12   <script type="application/javascript"
    13           src="../treeview.js" />
    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" />
    22   <script type="application/javascript">
    23   <![CDATA[
    24     ////////////////////////////////////////////////////////////////////////////
    25     // Test
    27     function doTest()
    28     {
    29       var treeNode = getNode("tree");
    31       var tree = getAccessible(treeNode);
    32       var treeitem1 = tree.firstChild.nextSibling;
    33       testRelation(treeitem1, RELATION_NODE_CHILD_OF, [tree]);
    35       var treeitem2 = treeitem1.nextSibling;
    36       testRelation(treeitem2, RELATION_NODE_CHILD_OF, [tree]);
    38       var treeitem3 = treeitem2.nextSibling;
    39       testRelation(treeitem3, RELATION_NODE_CHILD_OF, [treeitem2]);
    41       var treeitem4 = treeitem3.nextSibling;
    42       testRelation(treeitem4, RELATION_NODE_CHILD_OF, [treeitem2]);
    44       var treeitem5 = treeitem4.nextSibling;
    45       testRelation(treeitem5, RELATION_NODE_CHILD_OF, [tree]);
    47       var treeitem6 = treeitem5.nextSibling;
    48       testRelation(treeitem6, RELATION_NODE_CHILD_OF, [tree]);
    50       testRelation(tree, RELATION_NODE_PARENT_OF,
    51                    [treeitem1, treeitem2, treeitem5, treeitem6]);
    52       testRelation(treeitem2, RELATION_NODE_PARENT_OF,
    53                    [treeitem3, treeitem4]);
    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);
    59       SimpleTest.finish();
    60     }
    62     SimpleTest.waitForExplicitFinish();
    63     addA11yXULTreeLoadEvent(doTest, "tree", new nsTreeTreeView());
    64   ]]>
    65   </script>
    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>
    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>
   101       <vbox id="debug"/>
   102     </vbox>
   103   </hbox>
   105 </window>

mercurial