accessible/tests/mochitest/events/test_selection.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>Accessible selection 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 <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="../role.js"></script>
michael@0 20 <script type="application/javascript"
michael@0 21 src="../states.js"></script>
michael@0 22
michael@0 23 <script type="application/javascript">
michael@0 24 ////////////////////////////////////////////////////////////////////////////
michael@0 25 // Invokers
michael@0 26
michael@0 27 ////////////////////////////////////////////////////////////////////////////
michael@0 28 // Do tests
michael@0 29
michael@0 30 //gA11yEventDumpToConsole = true; // debuggin
michael@0 31
michael@0 32 var gQueue = null;
michael@0 33 function doTests()
michael@0 34 {
michael@0 35 gQueue = new eventQueue();
michael@0 36
michael@0 37 // open combobox
michael@0 38 gQueue.push(new synthClick("combobox",
michael@0 39 new invokerChecker(EVENT_FOCUS, "cb1_item1")));
michael@0 40 gQueue.push(new synthDownKey("cb1_item1",
michael@0 41 selChangeSeq("cb1_item1", "cb1_item2")));
michael@0 42
michael@0 43 // closed combobox
michael@0 44 gQueue.push(new synthEscapeKey("combobox",
michael@0 45 new invokerChecker(EVENT_FOCUS, "combobox")));
michael@0 46 gQueue.push(new synthDownKey("cb1_item2",
michael@0 47 selChangeSeq("cb1_item2", "cb1_item3")));
michael@0 48
michael@0 49 // listbox
michael@0 50 gQueue.push(new synthClick("lb1_item1",
michael@0 51 new invokerChecker(EVENT_SELECTION, "lb1_item1")));
michael@0 52 gQueue.push(new synthDownKey("lb1_item1",
michael@0 53 selChangeSeq("lb1_item1", "lb1_item2")));
michael@0 54
michael@0 55 // multiselectable listbox
michael@0 56 gQueue.push(new synthClick("lb2_item1",
michael@0 57 selChangeSeq(null, "lb2_item1")));
michael@0 58 gQueue.push(new synthDownKey("lb2_item1",
michael@0 59 selAddSeq("lb2_item2"),
michael@0 60 { shiftKey: true }));
michael@0 61 gQueue.push(new synthUpKey("lb2_item2",
michael@0 62 selRemoveSeq("lb2_item2"),
michael@0 63 { shiftKey: true }));
michael@0 64 gQueue.push(new synthKey("lb2_item1", " ", { ctrlKey: true },
michael@0 65 selRemoveSeq("lb2_item1")));
michael@0 66
michael@0 67 gQueue.invoke(); // Will call SimpleTest.finish();
michael@0 68 }
michael@0 69
michael@0 70 SimpleTest.waitForExplicitFinish();
michael@0 71 addA11yLoadEvent(doTests);
michael@0 72 </script>
michael@0 73 </head>
michael@0 74
michael@0 75 <body>
michael@0 76
michael@0 77 <a target="_blank"
michael@0 78 href="https://bugzilla.mozilla.org/show_bug.cgi?id=414302"
michael@0 79 title="Incorrect selection events in HTML, XUL and ARIA">
michael@0 80 Bug 414302
michael@0 81 </a>
michael@0 82 <a target="_blank"
michael@0 83 href="https://bugzilla.mozilla.org/show_bug.cgi?id=810268"
michael@0 84 title="There's no way to know unselected item when selection in single selection was changed">
michael@0 85 Bug 810268
michael@0 86 </a>
michael@0 87
michael@0 88 <p id="display"></p>
michael@0 89 <div id="content" style="display: none"></div>
michael@0 90 <pre id="test">
michael@0 91 </pre>
michael@0 92
michael@0 93 <select id="combobox">
michael@0 94 <option id="cb1_item1" value="mushrooms">mushrooms
michael@0 95 <option id="cb1_item2" value="greenpeppers">green peppers
michael@0 96 <option id="cb1_item3" value="onions" id="onions">onions
michael@0 97 <option id="cb1_item4" value="tomatoes">tomatoes
michael@0 98 <option id="cb1_item5" value="olives">olives
michael@0 99 </select>
michael@0 100
michael@0 101 <select id="listbox" size=5>
michael@0 102 <option id="lb1_item1" value="mushrooms">mushrooms
michael@0 103 <option id="lb1_item2" value="greenpeppers">green peppers
michael@0 104 <option id="lb1_item3" value="onions" id="onions">onions
michael@0 105 <option id="lb1_item4" value="tomatoes">tomatoes
michael@0 106 <option id="lb1_item5" value="olives">olives
michael@0 107 </select>
michael@0 108
michael@0 109 <p>Pizza</p>
michael@0 110 <select id="listbox2" multiple size=5>
michael@0 111 <option id="lb2_item1" value="mushrooms">mushrooms
michael@0 112 <option id="lb2_item2" value="greenpeppers">green peppers
michael@0 113 <option id="lb2_item3" value="onions" id="onions">onions
michael@0 114 <option id="lb2_item4" value="tomatoes">tomatoes
michael@0 115 <option id="lb2_item5" value="olives">olives
michael@0 116 </select>
michael@0 117
michael@0 118 <div id="eventdump"></div>
michael@0 119 </body>
michael@0 120 </html>

mercurial