Wed, 31 Dec 2014 06:55:50 +0100
Added tag UPSTREAM_283F7C6 for changeset ca08bd8f51b2
michael@0 | 1 | <html> |
michael@0 | 2 | |
michael@0 | 3 | <head> |
michael@0 | 4 | <title>nsIAccessible::focusedChild 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 | |
michael@0 | 12 | <script type="application/javascript" |
michael@0 | 13 | src="../common.js"></script> |
michael@0 | 14 | <script type="application/javascript" |
michael@0 | 15 | src="../role.js"></script> |
michael@0 | 16 | <script type="application/javascript" |
michael@0 | 17 | src="../states.js"></script> |
michael@0 | 18 | <script type="application/javascript" |
michael@0 | 19 | src="../events.js"></script> |
michael@0 | 20 | |
michael@0 | 21 | <script type="application/javascript"> |
michael@0 | 22 | function openWnd() |
michael@0 | 23 | { |
michael@0 | 24 | this.eventSeq = [ new invokerChecker(EVENT_FOCUS, |
michael@0 | 25 | getDialogAccessible, |
michael@0 | 26 | this) ]; |
michael@0 | 27 | |
michael@0 | 28 | this.invoke = function openWnd_invoke() |
michael@0 | 29 | { |
michael@0 | 30 | this.dialog = window.openDialog("about:mozilla", |
michael@0 | 31 | "AboutMozilla", |
michael@0 | 32 | "chrome,width=600,height=600"); |
michael@0 | 33 | } |
michael@0 | 34 | |
michael@0 | 35 | this.finalCheck = function openWnd_finalCheck() |
michael@0 | 36 | { |
michael@0 | 37 | var app = getApplicationAccessible(); |
michael@0 | 38 | is(app.focusedChild, getDialogAccessible(this), |
michael@0 | 39 | "Wrong focused child"); |
michael@0 | 40 | |
michael@0 | 41 | this.dialog.close(); |
michael@0 | 42 | } |
michael@0 | 43 | |
michael@0 | 44 | this.getID = function openWnd_getID() |
michael@0 | 45 | { |
michael@0 | 46 | return "focusedChild for application accessible"; |
michael@0 | 47 | } |
michael@0 | 48 | |
michael@0 | 49 | function getDialogAccessible(aInvoker) |
michael@0 | 50 | { |
michael@0 | 51 | return getAccessible(aInvoker.dialog.document); |
michael@0 | 52 | } |
michael@0 | 53 | } |
michael@0 | 54 | |
michael@0 | 55 | gA11yEventDumpToConsole = true; |
michael@0 | 56 | var gQueue = null; |
michael@0 | 57 | |
michael@0 | 58 | function doTest() |
michael@0 | 59 | { |
michael@0 | 60 | enableLogging("focus,doclifecycle"); |
michael@0 | 61 | gQueue = new eventQueue(); |
michael@0 | 62 | |
michael@0 | 63 | gQueue.push(new openWnd()); |
michael@0 | 64 | |
michael@0 | 65 | gQueue.onFinish = function() { disableLogging(); } |
michael@0 | 66 | gQueue.invoke(); // Will call SimpleTest.finish(); |
michael@0 | 67 | } |
michael@0 | 68 | |
michael@0 | 69 | SimpleTest.waitForExplicitFinish(); |
michael@0 | 70 | addA11yLoadEvent(doTest); |
michael@0 | 71 | </script> |
michael@0 | 72 | </head> |
michael@0 | 73 | |
michael@0 | 74 | <body> |
michael@0 | 75 | |
michael@0 | 76 | <a target="_blank" |
michael@0 | 77 | href="https://bugzilla.mozilla.org/show_bug.cgi?id=677467" |
michael@0 | 78 | title="focusedChild crashes on application accessible"> |
michael@0 | 79 | Mozilla Bug 677467 |
michael@0 | 80 | </a> |
michael@0 | 81 | <p id="display"></p> |
michael@0 | 82 | <div id="content" style="display: none"></div> |
michael@0 | 83 | <pre id="test"> |
michael@0 | 84 | </pre> |
michael@0 | 85 | |
michael@0 | 86 | </body> |
michael@0 | 87 | </html> |