tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

test_shutdown.xhtml (3479B)


      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 hierarchy tests">
      8 
      9  <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
     10 
     11  <script type="application/javascript"
     12          src="../treeview.js" />
     13 
     14  <script type="application/javascript"
     15          src="../common.js" />
     16  <script type="application/javascript"
     17          src="../role.js" />
     18  <script type="application/javascript"
     19          src="../states.js" />
     20  <script type="application/javascript"
     21          src="../events.js" />
     22 
     23  <script type="application/javascript">
     24  <![CDATA[
     25    function setXULTreeView(aTreeID, aTreeView)
     26    {
     27      this.treeNode = getNode(aTreeID);
     28 
     29      this.eventSeq = [
     30        new invokerChecker(EVENT_REORDER, this.treeNode)
     31      ];
     32 
     33      this.invoke = function loadXULTree_invoke()
     34      {
     35        this.treeNode.view = aTreeView;
     36      };
     37 
     38      this.getID = function loadXULTree_getID()
     39      {
     40        return "Load XUL tree " + prettyName(aTreeID);
     41      };
     42    }
     43 
     44    function removeTree(aID)
     45    {
     46      this.tree = getAccessible(aID);
     47      this.lastItem = null;
     48 
     49      this.eventSeq = [
     50        new invokerChecker(EVENT_REORDER, document)
     51      ];
     52 
     53      this.invoke = function invoke()
     54      {
     55        this.lastItem = getAccessible(aID).lastChild;
     56        this.lastCell = this.lastItem.lastChild;
     57        getNode(aID).remove();
     58      };
     59 
     60      this.check = function check()
     61      {
     62        testIsDefunct(this.tree, aID);
     63        testIsDefunct(this.lastItem, "last item of " + aID);
     64        if (this.lastCell) {
     65          testIsDefunct(this.lastCell, "last item cell of " + aID);
     66        }
     67      };
     68 
     69      this.getID = function getID()
     70      {
     71        return "Remove tree from DOM";
     72      };
     73    }
     74 
     75    ////////////////////////////////////////////////////////////////////////////
     76    // Test
     77 
     78    // gA11yEventDumpID = "debug";
     79    var gQueue = null;
     80 
     81    function doTest()
     82    {
     83      gQueue = new eventQueue();
     84 
     85      gQueue.push(new setXULTreeView("tree", new nsTreeTreeView()));
     86      gQueue.push(new removeTree("tree"));
     87 
     88      gQueue.push(new setXULTreeView("treetable", new nsTreeTreeView()));
     89      gQueue.push(new removeTree("treetable"));
     90 
     91      gQueue.invoke(); // Will call SimpleTest.finish()
     92    }
     93 
     94    SimpleTest.waitForExplicitFinish();
     95    addA11yLoadEvent(doTest);
     96  ]]>
     97  </script>
     98 
     99  <hbox flex="1" style="overflow: auto;">
    100    <body xmlns="http://www.w3.org/1999/xhtml">
    101      <a target="_blank"
    102         href="https://bugzilla.mozilla.org/show_bug.cgi?id=503727"
    103         title="Reorganize implementation of XUL tree accessibility">
    104        Bug 503727
    105      </a><br/>
    106      <p id="display"></p>
    107      <div id="content" style="display: none">
    108      </div>
    109      <pre id="test">
    110      </pre>
    111    </body>
    112 
    113    <vbox flex="1">
    114      <tree id="tree" flex="1">
    115        <treecols>
    116          <treecol id="col" flex="1" primary="true" label="column"/>
    117        </treecols>
    118        <treechildren/>
    119      </tree>
    120 
    121      <tree id="treetable" flex="1">
    122        <treecols>
    123          <treecol id="col1" flex="1" primary="true" label="column"/>
    124          <treecol id="col2" flex="1" label="column 2"/>
    125        </treecols>
    126        <treechildren/>
    127      </tree>
    128    </vbox>
    129  </hbox>
    130 
    131 </window>