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.
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>Add select options test</title>
5 <link rel="stylesheet" type="text/css"
6 href="chrome://mochikit/content/tests/SimpleTest/test.css" />
8 <script type="application/javascript"
9 src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
11 <script type="application/javascript"
12 src="../common.js"></script>
13 <script type="application/javascript"
14 src="../role.js"></script>
15 <script type="application/javascript"
16 src="../events.js"></script>
18 <script type="application/javascript">
20 function addOptions(aID)
21 {
22 this.selectNode = getNode(aID);
23 this.select = getAccessible(this.selectNode);
25 this.invoke = function addOptions_invoke()
26 {
27 for (i = 0; i < 2; i++) {
28 var opt = document.createElement("option");
29 opt.value = i;
30 opt.text = "Option: Value " + i;
32 this.selectNode.add(opt, null);
33 }
34 }
36 this.eventSeq = [
37 new invokerChecker(EVENT_REORDER, this.select)
38 ];
40 this.finalCheck = function addOptions_finalCheck()
41 {
42 var tree =
43 { COMBOBOX: [
44 { COMBOBOX_LIST: [
45 { COMBOBOX_OPTION: [
46 { TEXT_LEAF: [] }
47 ] },
48 { COMBOBOX_OPTION: [
49 { TEXT_LEAF: [] }
50 ] }
51 ] }
52 ] };
53 testAccessibleTree(this.select, tree);
54 }
56 this.getID = function addOptions_getID()
57 {
58 return "test elements insertion into a select";
59 }
60 }
62 function removeOptions(aID)
63 {
64 this.selectNode = getNode(aID);
65 this.select = getAccessible(this.selectNode);
67 this.invoke = function removeOptions_invoke()
68 {
69 while (this.selectNode.length)
70 this.selectNode.remove(0);
71 }
73 this.eventSeq = [
74 new invokerChecker(EVENT_REORDER, this.select)
75 ];
77 this.finalCheck = function removeOptions_finalCheck()
78 {
79 var tree =
80 { COMBOBOX: [
81 { COMBOBOX_LIST: [] }
82 ] };
83 testAccessibleTree(this.select, tree);
84 }
86 this.getID = function removeptions_getID()
87 {
88 return "test elements removal from a select";
89 }
90 }
92 //gA11yEventDumpID = "debug";
94 function doTest()
95 {
96 gQueue = new eventQueue();
98 gQueue.push(new addOptions("select"));
99 gQueue.push(new removeOptions("select"));
101 gQueue.invoke(); // Will call SimpleTest.finish();
103 }
105 SimpleTest.waitForExplicitFinish();
106 addA11yLoadEvent(doTest);
107 </script>
108 </head>
109 <body>
111 <a target="_blank"
112 href="https://bugzilla.mozilla.org/show_bug.cgi?id=616452"
113 title="Bug 616452 - Dynamically inserted select options aren't reflected in accessible tree">
114 Mozilla Bug 616452</a>
115 <a target="_blank"
116 href="https://bugzilla.mozilla.org/show_bug.cgi?id=616940"
117 title="Removed select option accessibles aren't removed until hide event is fired">
118 Mozilla Bug 616940</a>
119 <p id="display"></p>
120 <div id="content" style="display: none"></div>
121 <pre id="test">
122 </pre>
124 <select id="select"></select>
126 <div id="debug"/>
127 </body>
128 </html>