accessible/tests/mochitest/events/test_flush.html

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 <html>
     3 <head>
     4   <title>Flush delayed events testing</title>
     6   <link rel="stylesheet" type="text/css"
     7         href="chrome://mochikit/content/tests/SimpleTest/test.css" />
     9   <script type="application/javascript"
    10           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
    11   <script type="application/javascript"
    12           src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
    14   <script type="application/javascript"
    15           src="../common.js"></script>
    16   <script type="application/javascript"
    17           src="../events.js"></script>
    19   <script type="application/javascript">
    20     SimpleTest.expectAssertions(0, 1);
    22     var gFocusHandler = {
    23       handleEvent: function(aEvent) {
    24         switch (this.count) {
    25           case 0:
    26             is(aEvent.DOMNode, getNode("input1"),
    27                "Focus event for input1 was expected!");
    28             getAccessible("input2").takeFocus();
    29             break;
    31           case 1:
    32             is(aEvent.DOMNode, getNode("input2"),
    33                "Focus event for input2 was expected!");
    35             unregisterA11yEventListener(EVENT_FOCUS, gFocusHandler);
    36             SimpleTest.finish();
    37             break;
    39           default:
    40             ok(false, "Wrong focus event!");
    41         }
    43         this.count++;
    44       },
    46       count: 0
    47     };
    49     function doTests()
    50     {
    51       registerA11yEventListener(EVENT_FOCUS, gFocusHandler);
    53       getAccessible("input1").takeFocus();
    54     }
    56     SimpleTest.waitForExplicitFinish();
    57     addA11yLoadEvent(doTests);
    58   </script>
    59 </head>
    61 <body>
    63   <a target="_blank"
    64      href="https://bugzilla.mozilla.org/show_bug.cgi?id=477551"
    65      title="DocAccessible::FlushPendingEvents isn't robust">
    66     Mozilla Bug 477551
    67   </a>
    69   <p id="display"></p>
    70   <div id="content" style="display: none"></div>
    71   <pre id="test">
    72   </pre>
    74   <input id="input1">
    75   <input id="input2">
    76 </body>
    77 </html>

mercurial