tor-browser

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

test_focus_tabbox.xhtml (3503B)


      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        xmlns:html="http://www.w3.org/1999/xhtml"
      8        title="Tabbox focus testing">
      9 
     10  <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
     11  <script src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
     12 
     13  <script type="application/javascript"
     14          src="../common.js" />
     15  <script type="application/javascript"
     16          src="../role.js" />
     17  <script type="application/javascript"
     18          src="../states.js" />
     19  <script type="application/javascript"
     20          src="../events.js" />
     21 
     22  <script type="application/javascript">
     23    //gA11yEventDumpID = "eventdump"; // debug stuff
     24    //gA11yEventDumpToConsole = true; // debug stuff
     25 
     26    var gQueue = null;
     27    function doTests()
     28    {
     29      if (MAC) {
     30        todo(false, "Tests disabled because of imminent failure.");
     31        SimpleTest.finish();
     32        return;
     33      }
     34 
     35      // Test focus events.
     36      gQueue = new eventQueue();
     37 
     38      var input = getNode("input");
     39      gQueue.push(new synthClick("tab1", new focusChecker("tab1")));
     40      gQueue.push(new synthTab("tab1", new focusChecker("checkbox1")));
     41      gQueue.push(new synthKey("tab1", "VK_TAB", { ctrlKey: true },
     42                               new focusChecker(input)));
     43      gQueue.push(new synthKey("tab2", "VK_TAB", { ctrlKey: true },
     44                               new focusChecker("tab3")));
     45      gQueue.push(new synthKey("tab3", "VK_TAB", { ctrlKey: true },
     46                               new focusChecker("tab1")));
     47 
     48      gQueue.invoke(); // Will call SimpleTest.finish();
     49    }
     50 
     51    SimpleTest.waitForExplicitFinish();
     52    addA11yLoadEvent(doTests);
     53  </script>
     54 
     55  <hbox flex="1" style="overflow: auto;">
     56    <body xmlns="http://www.w3.org/1999/xhtml">
     57      <a target="_blank"
     58         href="https://bugzilla.mozilla.org/show_bug.cgi?id=370396"
     59         title="Control+Tab to an empty tab panel in a tabbox causes focus to leave the tabbox">
     60        Mozilla Bug 370396
     61      </a>
     62      <p id="display"></p>
     63      <div id="content" style="display: none"></div>
     64      <pre id="test">
     65      </pre>
     66    </body>
     67 
     68    <vbox flex="1">
     69      <tabbox>
     70        <tabs>
     71          <tab id="tab1" label="Tab1" selected="true"/>
     72          <tab id="tab2" label="Tab2" />
     73          <tab id="tab3" label="Tab3" />
     74        </tabs>
     75        <tabpanels>
     76          <tabpanel orient="vertical">
     77            <groupbox orient="vertical">
     78              <checkbox id="checkbox1" label="Monday" width="75"/>
     79              <checkbox label="Tuesday" width="75"/>
     80              <checkbox label="Wednesday" width="75"/>
     81              <checkbox label="Thursday" width="75"/>
     82              <checkbox label="Friday" width="75"/>
     83              <checkbox label="Saturday" width="75"/>
     84              <checkbox label="Sunday" width="75"/>
     85            </groupbox>
     86 
     87            <spacer style="height: 10px" />
     88            <label value="Label After checkboxes" />
     89          </tabpanel>
     90          <tabpanel orient="vertical">
     91            <html:input id="input" />
     92          </tabpanel>
     93          <tabpanel orient="vertical">
     94            <description>Tab 3 content</description>
     95          </tabpanel>
     96        </tabpanels>
     97      </tabbox>
     98 
     99      <vbox id="eventdump"/>
    100    </vbox>
    101  </hbox>
    102 </window>