Tue, 06 Jan 2015 21:39:09 +0100
Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
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 | <?xml-stylesheet href="../treeview.css" type="text/css"?> |
michael@0 | 6 | |
michael@0 | 7 | <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" |
michael@0 | 8 | title="XUL tree selectable tests"> |
michael@0 | 9 | |
michael@0 | 10 | <script type="application/javascript" |
michael@0 | 11 | src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" /> |
michael@0 | 12 | |
michael@0 | 13 | <script type="application/javascript" |
michael@0 | 14 | src="../common.js" /> |
michael@0 | 15 | <script type="application/javascript" |
michael@0 | 16 | src="../role.js" /> |
michael@0 | 17 | <script type="application/javascript" |
michael@0 | 18 | src="../states.js" /> |
michael@0 | 19 | <script type="application/javascript" |
michael@0 | 20 | src="../selectable.js" /> |
michael@0 | 21 | |
michael@0 | 22 | <script type="application/javascript"> |
michael@0 | 23 | <![CDATA[ |
michael@0 | 24 | |
michael@0 | 25 | //////////////////////////////////////////////////////////////////////////// |
michael@0 | 26 | // Test |
michael@0 | 27 | |
michael@0 | 28 | //gA11yEventDumpID = "debug"; |
michael@0 | 29 | |
michael@0 | 30 | var gQueue = null; |
michael@0 | 31 | |
michael@0 | 32 | function doTest() |
michael@0 | 33 | { |
michael@0 | 34 | ////////////////////////////////////////////////////////////////////////// |
michael@0 | 35 | // menulist aka combobox |
michael@0 | 36 | |
michael@0 | 37 | var id = "combobox"; |
michael@0 | 38 | var combobox = getAccessible(id); |
michael@0 | 39 | var comboboxList = combobox.firstChild; |
michael@0 | 40 | ok(isAccessible(comboboxList, [nsIAccessibleSelectable]), |
michael@0 | 41 | "No selectable accessible for list of " + id); |
michael@0 | 42 | |
michael@0 | 43 | var select = getAccessible(comboboxList, [nsIAccessibleSelectable]); |
michael@0 | 44 | testSelectableSelection(select, [ "cb1_item1" ]); |
michael@0 | 45 | |
michael@0 | 46 | select.addItemToSelection(1); |
michael@0 | 47 | testSelectableSelection(select, [ "cb1_item2" ], "addItemToSelection(1): "); |
michael@0 | 48 | |
michael@0 | 49 | select.removeItemFromSelection(1); |
michael@0 | 50 | testSelectableSelection(select, [ ], |
michael@0 | 51 | "removeItemFromSelection(1): "); |
michael@0 | 52 | |
michael@0 | 53 | is(select.selectAll(), false, |
michael@0 | 54 | "No way to select all items in combobox '" + id + "'"); |
michael@0 | 55 | testSelectableSelection(select, [ ], "selectAll: "); |
michael@0 | 56 | |
michael@0 | 57 | select.addItemToSelection(1); |
michael@0 | 58 | select.unselectAll(); |
michael@0 | 59 | testSelectableSelection(select, [ ], "unselectAll: "); |
michael@0 | 60 | |
michael@0 | 61 | SimpleTest.finish(); |
michael@0 | 62 | } |
michael@0 | 63 | |
michael@0 | 64 | SimpleTest.waitForExplicitFinish(); |
michael@0 | 65 | addA11yLoadEvent(doTest); |
michael@0 | 66 | ]]> |
michael@0 | 67 | </script> |
michael@0 | 68 | |
michael@0 | 69 | <hbox flex="1" style="overflow: auto;"> |
michael@0 | 70 | <body xmlns="http://www.w3.org/1999/xhtml"> |
michael@0 | 71 | <a target="_blank" |
michael@0 | 72 | href="https://bugzilla.mozilla.org/show_bug.cgi?id=590176" |
michael@0 | 73 | title="add pseudo SelectAccessible interface"> |
michael@0 | 74 | Mozilla Bug 590176 |
michael@0 | 75 | </a><br/> |
michael@0 | 76 | <p id="display"></p> |
michael@0 | 77 | <div id="content" style="display: none"> |
michael@0 | 78 | </div> |
michael@0 | 79 | <pre id="test"> |
michael@0 | 80 | </pre> |
michael@0 | 81 | </body> |
michael@0 | 82 | |
michael@0 | 83 | <vbox flex="1"> |
michael@0 | 84 | <menulist id="combobox"> |
michael@0 | 85 | <menupopup> |
michael@0 | 86 | <menuitem id="cb1_item1" label="item1"/> |
michael@0 | 87 | <menuitem id="cb1_item2" label="item2"/> |
michael@0 | 88 | </menupopup> |
michael@0 | 89 | </menulist> |
michael@0 | 90 | |
michael@0 | 91 | <vbox id="debug"/> |
michael@0 | 92 | </vbox> |
michael@0 | 93 | </hbox> |
michael@0 | 94 | |
michael@0 | 95 | </window> |
michael@0 | 96 |