Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | <html> |
michael@0 | 2 | |
michael@0 | 3 | <head> |
michael@0 | 4 | <title>Modal prompts</title> |
michael@0 | 5 | <link rel="stylesheet" type="text/css" |
michael@0 | 6 | href="chrome://mochikit/content/tests/SimpleTest/test.css" /> |
michael@0 | 7 | |
michael@0 | 8 | <script type="application/javascript" |
michael@0 | 9 | src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> |
michael@0 | 10 | <script type="application/javascript" |
michael@0 | 11 | src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script> |
michael@0 | 12 | |
michael@0 | 13 | <script type="application/javascript" |
michael@0 | 14 | src="../common.js"></script> |
michael@0 | 15 | <script type="application/javascript" |
michael@0 | 16 | src="../relations.js"></script> |
michael@0 | 17 | <script type="application/javascript" |
michael@0 | 18 | src="../role.js"></script> |
michael@0 | 19 | <script type="application/javascript" |
michael@0 | 20 | src="../events.js"></script> |
michael@0 | 21 | <script type="application/javascript" |
michael@0 | 22 | src="../browser.js"></script> |
michael@0 | 23 | |
michael@0 | 24 | <script type="application/javascript"> |
michael@0 | 25 | function hasTabModalPrompts() { |
michael@0 | 26 | try { |
michael@0 | 27 | return SpecialPowers.getBoolPref("prompts.tab_modal.enabled"); |
michael@0 | 28 | } catch (ex) { |
michael@0 | 29 | return false; |
michael@0 | 30 | } |
michael@0 | 31 | } |
michael@0 | 32 | |
michael@0 | 33 | function showAlert() |
michael@0 | 34 | { |
michael@0 | 35 | this.eventSeq = [ |
michael@0 | 36 | { |
michael@0 | 37 | type: EVENT_SHOW, |
michael@0 | 38 | match: function(aEvent) |
michael@0 | 39 | { |
michael@0 | 40 | return aEvent.accessible.role == ROLE_DIALOG; |
michael@0 | 41 | } |
michael@0 | 42 | } |
michael@0 | 43 | ]; |
michael@0 | 44 | |
michael@0 | 45 | this.invoke = function showAlert_invoke() |
michael@0 | 46 | { |
michael@0 | 47 | window.setTimeout( |
michael@0 | 48 | function() |
michael@0 | 49 | { |
michael@0 | 50 | currentTabDocument().defaultView.alert("hello"); |
michael@0 | 51 | }, 0); |
michael@0 | 52 | } |
michael@0 | 53 | |
michael@0 | 54 | this.check = function showAlert_finalCheck(aEvent) |
michael@0 | 55 | { |
michael@0 | 56 | var dialog = aEvent.accessible.DOMNode; |
michael@0 | 57 | var info = dialog.ui.infoBody; |
michael@0 | 58 | testRelation(info, RELATION_DESCRIPTION_FOR, dialog); |
michael@0 | 59 | testRelation(dialog, RELATION_DESCRIBED_BY, info); |
michael@0 | 60 | } |
michael@0 | 61 | |
michael@0 | 62 | this.getID = function showAlert_getID() |
michael@0 | 63 | { |
michael@0 | 64 | return "show alert"; |
michael@0 | 65 | } |
michael@0 | 66 | } |
michael@0 | 67 | |
michael@0 | 68 | //gA11yEventDumpToConsole = true; // debug |
michael@0 | 69 | |
michael@0 | 70 | var gQueue = null; |
michael@0 | 71 | function doTests() |
michael@0 | 72 | { |
michael@0 | 73 | gQueue = new eventQueue(); |
michael@0 | 74 | gQueue.push(new showAlert()); |
michael@0 | 75 | gQueue.onFinish = function() |
michael@0 | 76 | { |
michael@0 | 77 | synthesizeKey("VK_RETURN", {}, browserWindow()); |
michael@0 | 78 | closeBrowserWindow(); |
michael@0 | 79 | } |
michael@0 | 80 | gQueue.invoke(); // will call SimpleTest.finish() |
michael@0 | 81 | } |
michael@0 | 82 | |
michael@0 | 83 | if (!hasTabModalPrompts()) { |
michael@0 | 84 | todo(false, "Test disabled when tab modal prompts are not enabled."); |
michael@0 | 85 | } else { |
michael@0 | 86 | SimpleTest.waitForExplicitFinish(); |
michael@0 | 87 | openBrowserWindow(doTests); |
michael@0 | 88 | } |
michael@0 | 89 | </script> |
michael@0 | 90 | |
michael@0 | 91 | </head> |
michael@0 | 92 | |
michael@0 | 93 | <body id="body"> |
michael@0 | 94 | |
michael@0 | 95 | <a target="_blank" |
michael@0 | 96 | href="https://bugzilla.mozilla.org/show_bug.cgi?id=661293" |
michael@0 | 97 | title="The tabmodalprompt dialog's prompt label doesn't get the text properly associated for accessibility"> |
michael@0 | 98 | Mozilla Bug 661293 |
michael@0 | 99 | </a> |
michael@0 | 100 | <br> |
michael@0 | 101 | <p id="display"></p> |
michael@0 | 102 | <div id="content" style="display: none"></div> |
michael@0 | 103 | <pre id="test"> |
michael@0 | 104 | </pre> |
michael@0 | 105 | |
michael@0 | 106 | </body> |
michael@0 | 107 | </html> |