|
1 <?xml version="1.0"?> |
|
2 <?xml-stylesheet href="chrome://global/skin" type="text/css"?> |
|
3 <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?> |
|
4 |
|
5 <!-- |
|
6 storage listbox with query parameters |
|
7 --> |
|
8 |
|
9 <window title="XUL Template Tests" width="500" height="600" |
|
10 onload="test_storage_template();" |
|
11 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> |
|
12 <script type="application/javascript" |
|
13 src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> |
|
14 |
|
15 <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/> |
|
16 |
|
17 <data id="output-birds"> |
|
18 <listitem anyid="true" label="Barn Owl"/> |
|
19 <listitem anyid="true" label="Emu"/> |
|
20 <listitem anyid="true" label="Raven"/> |
|
21 </data> |
|
22 |
|
23 <data id="output-L"> |
|
24 <listitem anyid="true" label="LAMA"/> |
|
25 <listitem anyid="true" label="Lion"/> |
|
26 </data> |
|
27 |
|
28 <script src="templates_shared.js"/> |
|
29 |
|
30 <script> |
|
31 <![CDATA[ |
|
32 |
|
33 copyToProfile('animals.sqlite'); |
|
34 SimpleTest.waitForExplicitFinish(); |
|
35 |
|
36 |
|
37 function test_storage_template() |
|
38 { |
|
39 var root = document.getElementById("root1"); |
|
40 expectedOutput = document.getElementById("output-birds"); |
|
41 checkResults(root, 0); |
|
42 |
|
43 root = document.getElementById("root2"); |
|
44 checkResults(root, 0); |
|
45 |
|
46 root = document.getElementById("root6"); |
|
47 checkResults(root, 0); |
|
48 |
|
49 root = document.getElementById("root3"); |
|
50 expectedOutput = document.getElementById("output-L"); |
|
51 checkResults(root, 0); |
|
52 |
|
53 root = document.getElementById("root4"); |
|
54 checkResults(root, 0); |
|
55 |
|
56 root = document.getElementById("root5"); |
|
57 checkResults(root, 0); |
|
58 |
|
59 SimpleTest.finish(); |
|
60 } |
|
61 |
|
62 |
|
63 var testid ="storage listbox with query parameters"; |
|
64 var queryType = "storage"; |
|
65 var isTreeBuilder = false; |
|
66 var needsOpen = false; |
|
67 var notWorkingYet = false; |
|
68 var notWorkingYetDynamic = false; |
|
69 var expectedOutput; |
|
70 |
|
71 var changes = []; |
|
72 ]]> |
|
73 </script> |
|
74 |
|
75 <listbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="root1" |
|
76 flex="1" datasources="profile:animals.sqlite" ref="." querytype="storage"> |
|
77 <template> |
|
78 <query> |
|
79 SELECT * FROM animals WHERE species_id = ? ORDER BY name |
|
80 <param>2</param> |
|
81 </query> |
|
82 <action> |
|
83 <listitem uri="?" label="?name"/> |
|
84 </action> |
|
85 </template> |
|
86 </listbox> |
|
87 |
|
88 |
|
89 <listbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="root2" |
|
90 flex="1" datasources="profile:animals.sqlite" ref="." querytype="storage"> |
|
91 <template> |
|
92 <query> |
|
93 SELECT * FROM animals WHERE species_id = ? ORDER BY name |
|
94 <param type="int32">2</param> |
|
95 </query> |
|
96 <action> |
|
97 <listitem uri="?" label="?name"/> |
|
98 </action> |
|
99 </template> |
|
100 </listbox> |
|
101 |
|
102 |
|
103 <listbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="root3" |
|
104 flex="1" datasources="profile:animals.sqlite" ref="." querytype="storage"> |
|
105 <template> |
|
106 <query> |
|
107 SELECT * FROM animals WHERE species_id = :spec AND name like ? ORDER BY name |
|
108 <param name="spec" type="int32">5</param> |
|
109 <param>L%</param> |
|
110 </query> |
|
111 <action> |
|
112 <listitem uri="?" label="?name"/> |
|
113 </action> |
|
114 </template> |
|
115 </listbox> |
|
116 |
|
117 <listbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="root4" |
|
118 flex="1" datasources="profile:animals.sqlite" ref="." querytype="storage"> |
|
119 <template> |
|
120 <query> |
|
121 SELECT * FROM animals WHERE species_id = ?3 AND name like ?1 ORDER BY name |
|
122 <param index="3" type="int32">5</param> |
|
123 <param index="1">L%</param> |
|
124 </query> |
|
125 <action> |
|
126 <listitem uri="?" label="?name"/> |
|
127 </action> |
|
128 </template> |
|
129 </listbox> |
|
130 |
|
131 <listbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="root5" |
|
132 flex="1" datasources="profile:animals.sqlite" ref="." querytype="storage"> |
|
133 <template> |
|
134 <query> |
|
135 SELECT * FROM animals WHERE species_id = ?3 AND name like :pattern ORDER BY name |
|
136 <param name="pattern">L%</param> |
|
137 <param index="3" type="int32">5</param> |
|
138 </query> |
|
139 <action> |
|
140 <listitem uri="?" label="?name"/> |
|
141 </action> |
|
142 </template> |
|
143 </listbox> |
|
144 |
|
145 <listbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="root6" |
|
146 flex="1" datasources="profile:animals.sqlite" ref="." querytype="storage"> |
|
147 <template> |
|
148 <query> |
|
149 SELECT * FROM animals WHERE species_id = ? ORDER BY name |
|
150 <param type="int32">2qsdqsd</param> |
|
151 </query> |
|
152 <action> |
|
153 <listitem uri="?" label="?name"/> |
|
154 </action> |
|
155 </template> |
|
156 </listbox> |
|
157 |
|
158 |
|
159 |
|
160 </window> |