tor-browser

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

test_tooltip.xhtml (2086B)


      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 tooltip test">
      8 
      9  <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
     10  <script src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js" />
     11 
     12  <script type="application/javascript"
     13          src="../common.js" />
     14  <script type="application/javascript"
     15          src="../role.js" />
     16  <script type="application/javascript"
     17          src="../promisified-events.js" />
     18 
     19  <script type="application/javascript">
     20  <![CDATA[
     21 
     22    async function doTest() {
     23      let tooltip = document.getElementById("tooltip");
     24 
     25      testAccessibleTree("tooltip-container", { GROUPING: [
     26      ] });
     27 
     28      let shown = waitForEvent(EVENT_SHOW, tooltip);
     29      tooltip.openPopup();
     30      await shown;
     31 
     32      testAccessibleTree("tooltip-container",
     33        { GROUPING: [
     34          { TOOLTIP: [] },
     35          { STATICTEXT: [] },
     36        ] });
     37 
     38      let hidden = waitForEvent(EVENT_HIDE, tooltip);
     39      tooltip.hidePopup();
     40      await hidden;
     41 
     42      testAccessibleTree("tooltip-container", { GROUPING: [] });
     43 
     44      SimpleTest.finish();
     45    }
     46 
     47    SimpleTest.waitForExplicitFinish();
     48    addA11yLoadEvent(doTest);
     49  ]]>
     50  </script>
     51 
     52  <hbox flex="1" style="overflow: auto;">
     53    <body xmlns="http://www.w3.org/1999/xhtml">
     54      <a target="_blank"
     55         href="https://bugzilla.mozilla.org/show_bug.cgi?id=1652211"
     56         title="Added anonymous tooltip to mochitest docs messes with text">
     57        Bug 1652211
     58      </a>
     59      <br/>
     60      <p id="display"></p>
     61      <div id="content" style="display: none">
     62      </div>
     63      <pre id="test">
     64      </pre>
     65    </body>
     66 
     67    <vbox flex="1" role="group" id="tooltip-container">
     68      <tooltip id="tooltip">
     69        <description class="tooltip-label" value="hello world"/>
     70      </tooltip>
     71    </vbox>
     72  </hbox>
     73 
     74 </window>