accessible/tests/mochitest/test_bug428479.html
author Jason Evans <jasone@canonware.com>
Fri, 20 Jun 2008 10:29:43 -0700
changeset 15456 38972d94e6312cca26dc09bb1d8ac4a9bec84b1c
parent 14303 738ae74eaf0933930a4b5d9d0d3463359af64824
permissions -rw-r--r--
Bug 431743: Upstream jemalloc fixes, r=benjamin Incorporate upstream jemalloc fixes from FreeBSD: * Detect overflow for huge allocations via sbrk(2). * Fix deadlock for base (internal) allocations in OOM case. * Fix bitmap vector initialization for small allocation runs.

<!DOCTYPE html>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=428479
-->
<head>
  <title>ARIA role math chrome tests</title>
  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />

  <script type="application/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>

  <script type="application/javascript">
    function testThis(aID, aAcc)
    {
      is(aAcc.finalRole,
         Components.interfaces.nsIAccessibleRole.ROLE_FLAT_EQUATION,
         "Wrong role for " + aID +"!");
      is(aAcc.name, "x^2 + y^2 + z^2", "Wrong name for " + aID + "!");
    }

    function doTest()
    {
      var accRetrieval = Components.classes["@mozilla.org/accessibleRetrieval;1"].
                       getService(Components.interfaces.nsIAccessibleRetrieval);

      // Test equation image
      var imgEqElement = document.getElementById("img_eq");
      var imgEqAcc;
      try {
        imgEqAcc = accRetrieval.getAccessibleFor(imgEqElement);
      } catch(e) {
      }
      ok(imgEqAcc, "no accessible for image equation!");
      if (imgEqAcc)
        testThis("img_eq", imgEqAcc);

      // Test textual equation
      var txtEqElement = document.getElementById("txt_eq");
      var txtEqAcc;
      try {
        txtEqAcc = accRetrieval.getAccessibleFor(txtEqElement);
      } catch(e) {
      }
      ok(txtEqAcc, "no accessible for textual equation!");
      if (txtEqAcc)
        testThis("txt_eq", txtEqAcc);

      SimpleTest.finish();
    }

    SimpleTest.waitForExplicitFinish();
    addLoadEvent(doTest);
  </script>
</head>
<body>

  <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=428479">Mozilla Bug 428479</a>
  <p id="display"></p>
  <div id="content" style="display: none"></div>
  <pre id="test">
  </pre>
  <p>Image: 
    <img id="img_eq" role="math" src="foo" alt="x^2 + y^2 + z^2">
  </p>
  <p>Text: 
    <span id="txt_eq" role="math" title="x^2 + y^2 + z^2">x<sup>2</sup> + 
      y<sup>2</sup> + z<sup>2</sup></span>
  </p>
</body>
</html>