accessible/tests/mochitest/events/test_flush.html

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

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

mercurial