accessible/tests/mochitest/focus/test_focusedChild.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/accessible/tests/mochitest/focus/test_focusedChild.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,87 @@
     1.4 +<html>
     1.5 +
     1.6 +<head>
     1.7 +  <title>nsIAccessible::focusedChild testing</title>
     1.8 +
     1.9 +  <link rel="stylesheet" type="text/css"
    1.10 +        href="chrome://mochikit/content/tests/SimpleTest/test.css" />
    1.11 +
    1.12 +  <script type="application/javascript"
    1.13 +          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
    1.14 +
    1.15 +  <script type="application/javascript"
    1.16 +          src="../common.js"></script>
    1.17 +  <script type="application/javascript"
    1.18 +          src="../role.js"></script>
    1.19 +  <script type="application/javascript"
    1.20 +          src="../states.js"></script>
    1.21 +  <script type="application/javascript"
    1.22 +          src="../events.js"></script>
    1.23 +
    1.24 +  <script type="application/javascript">
    1.25 +    function openWnd()
    1.26 +    {
    1.27 +      this.eventSeq = [ new invokerChecker(EVENT_FOCUS,
    1.28 +                                           getDialogAccessible,
    1.29 +                                           this) ];
    1.30 +
    1.31 +      this.invoke = function openWnd_invoke()
    1.32 +      {
    1.33 +        this.dialog = window.openDialog("about:mozilla",
    1.34 +                                        "AboutMozilla",
    1.35 +                                        "chrome,width=600,height=600");
    1.36 +      }
    1.37 +
    1.38 +      this.finalCheck = function openWnd_finalCheck()
    1.39 +      {
    1.40 +        var app = getApplicationAccessible();
    1.41 +        is(app.focusedChild, getDialogAccessible(this),
    1.42 +           "Wrong focused child");
    1.43 +
    1.44 +        this.dialog.close();
    1.45 +      }
    1.46 +
    1.47 +      this.getID = function openWnd_getID()
    1.48 +      {
    1.49 +        return "focusedChild for application accessible";
    1.50 +      }
    1.51 +
    1.52 +      function getDialogAccessible(aInvoker)
    1.53 +      {
    1.54 +        return getAccessible(aInvoker.dialog.document);
    1.55 +      }
    1.56 +    }
    1.57 +
    1.58 +    gA11yEventDumpToConsole = true;
    1.59 +    var gQueue = null;
    1.60 +
    1.61 +    function doTest()
    1.62 +    {
    1.63 +      enableLogging("focus,doclifecycle");
    1.64 +      gQueue = new eventQueue();
    1.65 +
    1.66 +      gQueue.push(new openWnd());
    1.67 +
    1.68 +      gQueue.onFinish = function() { disableLogging(); }
    1.69 +      gQueue.invoke(); // Will call SimpleTest.finish();
    1.70 +    }
    1.71 +
    1.72 +    SimpleTest.waitForExplicitFinish();
    1.73 +    addA11yLoadEvent(doTest);
    1.74 +  </script>
    1.75 +</head>
    1.76 +
    1.77 +<body>
    1.78 +
    1.79 +  <a target="_blank"
    1.80 +     href="https://bugzilla.mozilla.org/show_bug.cgi?id=677467"
    1.81 +     title="focusedChild crashes on application accessible">
    1.82 +    Mozilla Bug 677467
    1.83 +  </a>
    1.84 +  <p id="display"></p>
    1.85 +  <div id="content" style="display: none"></div>
    1.86 +  <pre id="test">
    1.87 +  </pre>
    1.88 +
    1.89 +</body>
    1.90 +</html>

mercurial