Sat, 03 Jan 2015 20:18:00 +0100
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>ARIA alert event 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 showAlert(aID) |
michael@0 | 23 | { |
michael@0 | 24 | this.DOMNode = document.createElement("div"); |
michael@0 | 25 | |
michael@0 | 26 | this.invoke = function showAlert_invoke() |
michael@0 | 27 | { |
michael@0 | 28 | this.DOMNode.setAttribute("role", "alert"); |
michael@0 | 29 | this.DOMNode.setAttribute("id", aID); |
michael@0 | 30 | var text = document.createTextNode("alert"); |
michael@0 | 31 | this.DOMNode.appendChild(text); |
michael@0 | 32 | document.body.appendChild(this.DOMNode); |
michael@0 | 33 | }; |
michael@0 | 34 | |
michael@0 | 35 | this.getID = function showAlert_getID() |
michael@0 | 36 | { |
michael@0 | 37 | return "Show ARIA alert " + aID; |
michael@0 | 38 | }; |
michael@0 | 39 | } |
michael@0 | 40 | |
michael@0 | 41 | function changeAlert(aID) |
michael@0 | 42 | { |
michael@0 | 43 | this.__defineGetter__("DOMNode", function() { return getNode(aID) }); |
michael@0 | 44 | |
michael@0 | 45 | this.invoke = function changeAlert_invoke() |
michael@0 | 46 | { |
michael@0 | 47 | this.DOMNode.textContent = "new alert"; |
michael@0 | 48 | } |
michael@0 | 49 | |
michael@0 | 50 | this.getID = function showAlert_getID() |
michael@0 | 51 | { |
michael@0 | 52 | return "Change ARIA alert " + aID; |
michael@0 | 53 | } |
michael@0 | 54 | } |
michael@0 | 55 | |
michael@0 | 56 | //////////////////////////////////////////////////////////////////////////// |
michael@0 | 57 | // Do tests |
michael@0 | 58 | |
michael@0 | 59 | var gQueue = null; |
michael@0 | 60 | |
michael@0 | 61 | //gA11yEventDumpID = "eventdump"; |
michael@0 | 62 | |
michael@0 | 63 | function doTests() |
michael@0 | 64 | { |
michael@0 | 65 | gQueue = new eventQueue(nsIAccessibleEvent.EVENT_ALERT); |
michael@0 | 66 | |
michael@0 | 67 | gQueue.push(new showAlert("alert")); |
michael@0 | 68 | gQueue.push(new changeAlert("alert")); |
michael@0 | 69 | |
michael@0 | 70 | gQueue.invoke(); // Will call SimpleTest.finish(); |
michael@0 | 71 | } |
michael@0 | 72 | |
michael@0 | 73 | SimpleTest.waitForExplicitFinish(); |
michael@0 | 74 | addA11yLoadEvent(doTests); |
michael@0 | 75 | </script> |
michael@0 | 76 | </head> |
michael@0 | 77 | |
michael@0 | 78 | <body> |
michael@0 | 79 | |
michael@0 | 80 | <a target="_blank" |
michael@0 | 81 | href="https://bugzilla.mozilla.org/show_bug.cgi?id=591199" |
michael@0 | 82 | title="mochitest for bug 334386: fire alert event when ARIA alert is shown or new its children are inserted"> |
michael@0 | 83 | Mozilla Bug 591199 |
michael@0 | 84 | </a> |
michael@0 | 85 | |
michael@0 | 86 | <p id="display"></p> |
michael@0 | 87 | <div id="content" style="display: none"></div> |
michael@0 | 88 | <pre id="test"> |
michael@0 | 89 | </pre> |
michael@0 | 90 | <div id="eventdump"></div> |
michael@0 | 91 | |
michael@0 | 92 | </body> |
michael@0 | 93 | </html> |