Wed, 31 Dec 2014 06:55:50 +0100
Added tag UPSTREAM_283F7C6 for changeset ca08bd8f51b2
michael@0 | 1 | <?xml version="1.0"?> |
michael@0 | 2 | <?xml-stylesheet href="chrome://global/skin" type="text/css"?> |
michael@0 | 3 | <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" |
michael@0 | 4 | type="text/css"?> |
michael@0 | 5 | |
michael@0 | 6 | <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" |
michael@0 | 7 | title="Accessibility Name Calculating Test."> |
michael@0 | 8 | |
michael@0 | 9 | <script type="application/javascript" |
michael@0 | 10 | src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" /> |
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="../role.js"></script> |
michael@0 | 18 | <script type="application/javascript" |
michael@0 | 19 | src="../states.js"></script> |
michael@0 | 20 | <script type="application/javascript" |
michael@0 | 21 | src="../events.js"></script> |
michael@0 | 22 | <script type="application/javascript" |
michael@0 | 23 | src="../browser.js"></script> |
michael@0 | 24 | |
michael@0 | 25 | <script type="application/javascript"> |
michael@0 | 26 | <![CDATA[ |
michael@0 | 27 | function addTab(aURL) |
michael@0 | 28 | { |
michael@0 | 29 | this.eventSeq = [ |
michael@0 | 30 | new invokerChecker(EVENT_DOCUMENT_LOAD_COMPLETE, tabDocumentAt, 1) |
michael@0 | 31 | ]; |
michael@0 | 32 | |
michael@0 | 33 | this.invoke = function addTab_invoke() |
michael@0 | 34 | { |
michael@0 | 35 | tabBrowser().addTab(aURL); |
michael@0 | 36 | } |
michael@0 | 37 | |
michael@0 | 38 | this.getID = function addTab_getID() |
michael@0 | 39 | { |
michael@0 | 40 | return "add tab: " + aURL; |
michael@0 | 41 | } |
michael@0 | 42 | } |
michael@0 | 43 | |
michael@0 | 44 | function switchTab(aTabBrowser, aWindow) |
michael@0 | 45 | { |
michael@0 | 46 | this.invoke = function switchTab_invoke() |
michael@0 | 47 | { |
michael@0 | 48 | synthesizeKey("VK_TAB", { ctrlKey: true }, browserWindow()); |
michael@0 | 49 | } |
michael@0 | 50 | |
michael@0 | 51 | this.eventSeq = [ |
michael@0 | 52 | new focusChecker(tabDocumentAt, 1) |
michael@0 | 53 | ]; |
michael@0 | 54 | |
michael@0 | 55 | this.check = function switchTab_check(aEvent) |
michael@0 | 56 | { |
michael@0 | 57 | var title = getAccessible(browserDocument()).name; |
michael@0 | 58 | isnot(title.indexOf(aEvent.accessible.name), -1, |
michael@0 | 59 | "Window title contains the name of active tab document" + |
michael@0 | 60 | " (Is '" + aEvent.accessible.name + "' in '" + title + "'?)"); |
michael@0 | 61 | } |
michael@0 | 62 | |
michael@0 | 63 | this.getID = function switchTab_getID() { return "switch tab"; } |
michael@0 | 64 | } |
michael@0 | 65 | |
michael@0 | 66 | //////////////////////////////////////////////////////////////////////////// |
michael@0 | 67 | // Tests |
michael@0 | 68 | |
michael@0 | 69 | //gA11yEventDumpID = "eventdump"; // debug stuff |
michael@0 | 70 | //gA11yEventDumpToConsole = true; // debug |
michael@0 | 71 | |
michael@0 | 72 | var gQueue = null; |
michael@0 | 73 | function doTests() |
michael@0 | 74 | { |
michael@0 | 75 | gQueue = new eventQueue(); |
michael@0 | 76 | gQueue.push(new addTab("about:mozilla")); |
michael@0 | 77 | gQueue.push(new switchTab()); |
michael@0 | 78 | gQueue.onFinish = function() |
michael@0 | 79 | { |
michael@0 | 80 | closeBrowserWindow(); |
michael@0 | 81 | } |
michael@0 | 82 | |
michael@0 | 83 | gQueue.invoke(); |
michael@0 | 84 | } |
michael@0 | 85 | |
michael@0 | 86 | SimpleTest.waitForExplicitFinish(); |
michael@0 | 87 | openBrowserWindow(doTests, "about:"); |
michael@0 | 88 | ]]> |
michael@0 | 89 | </script> |
michael@0 | 90 | |
michael@0 | 91 | <vbox flex="1" style="overflow: auto;"> |
michael@0 | 92 | <body xmlns="http://www.w3.org/1999/xhtml"> |
michael@0 | 93 | <a target="_blank" |
michael@0 | 94 | href="https://bugzilla.mozilla.org/show_bug.cgi?id=507382" |
michael@0 | 95 | title="focus is fired earlier than root accessible name is changed when switching between tabs"> |
michael@0 | 96 | Mozilla Bug |
michael@0 | 97 | </a> |
michael@0 | 98 | <p id="display"></p> |
michael@0 | 99 | <div id="content" style="display: none"> |
michael@0 | 100 | </div> |
michael@0 | 101 | <pre id="test"> |
michael@0 | 102 | </pre> |
michael@0 | 103 | </body> |
michael@0 | 104 | |
michael@0 | 105 | <vbox id="eventdump"></vbox> |
michael@0 | 106 | </vbox> |
michael@0 | 107 | </window> |