accessible/tests/mochitest/events/test_attrs.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>Event object attributes tests</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 <script type="application/javascript"
michael@0 19 src="../attributes.js"></script>
michael@0 20
michael@0 21 <script type="application/javascript">
michael@0 22
michael@0 23 /**
michael@0 24 * Test "event-from-input" object attribute.
michael@0 25 */
michael@0 26 function eventFromInputChecker(aEventType, aID, aValue, aNoTargetID)
michael@0 27 {
michael@0 28 this.type = aEventType;
michael@0 29 this.target = getAccessible(aID);
michael@0 30
michael@0 31 this.noTarget = getNode(aNoTargetID);
michael@0 32
michael@0 33 this.check = function checker_check(aEvent)
michael@0 34 {
michael@0 35 testAttrs(aEvent.accessible, { "event-from-input": aValue }, true);
michael@0 36
michael@0 37 var accessible = getAccessible(this.noTarget);
michael@0 38 testAbsentAttrs(accessible, { "event-from-input": "" });
michael@0 39 }
michael@0 40 }
michael@0 41
michael@0 42 /**
michael@0 43 * Do tests.
michael@0 44 */
michael@0 45 var gQueue = null;
michael@0 46
michael@0 47 // gA11yEventDumpID = "eventdump"; // debug stuff
michael@0 48 //gA11yEventDumpToConsole = true; // debug stuff
michael@0 49
michael@0 50 function doTests()
michael@0 51 {
michael@0 52 gQueue = new eventQueue();
michael@0 53
michael@0 54 var id = "textbox", noTargetId = "textarea";
michael@0 55 var checker =
michael@0 56 new eventFromInputChecker(EVENT_FOCUS, id, "false", noTargetId);
michael@0 57 gQueue.push(new synthFocus(id, checker));
michael@0 58
michael@0 59 if (!MAC) { // Mac failure is bug 541093
michael@0 60 var checker =
michael@0 61 new eventFromInputChecker(EVENT_TEXT_CARET_MOVED, id, "true", noTargetId);
michael@0 62 gQueue.push(new synthHomeKey(id, checker));
michael@0 63 }
michael@0 64
michael@0 65 gQueue.invoke(); // Will call SimpleTest.finish();
michael@0 66 }
michael@0 67
michael@0 68 SimpleTest.waitForExplicitFinish();
michael@0 69 addA11yLoadEvent(doTests);
michael@0 70 </script>
michael@0 71 </head>
michael@0 72
michael@0 73 <body>
michael@0 74
michael@0 75 <a target="_blank"
michael@0 76 href="https://bugzilla.mozilla.org/show_bug.cgi?id=540285"
michael@0 77 title="Event object attributes testing">
michael@0 78 Mozilla Bug 540285
michael@0 79 </a>
michael@0 80 <p id="display"></p>
michael@0 81 <div id="content" style="display: none"></div>
michael@0 82 <pre id="test">
michael@0 83 </pre>
michael@0 84
michael@0 85 <input id="textbox" value="hello">
michael@0 86 <textarea id="textarea"></textarea>
michael@0 87
michael@0 88 <div id="eventdump"></div>
michael@0 89 </body>
michael@0 90 </html>

mercurial