|
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 dynamic 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"/> |
|
18 |
|
19 <data id="rebuilt-output"> |
|
20 <listitem anyid="true" label="Barn Owl"/> |
|
21 <listitem anyid="true" label="Emu"/> |
|
22 <listitem anyid="true" label="Raven"/> |
|
23 </data> |
|
24 |
|
25 <script src="templates_shared.js"/> |
|
26 |
|
27 <script> |
|
28 <![CDATA[ |
|
29 SimpleTest.expectAssertions(1, 2); |
|
30 |
|
31 SimpleTest.waitForExplicitFinish(); |
|
32 |
|
33 copyToProfile('animals.sqlite'); |
|
34 |
|
35 function test_storage_template() |
|
36 { |
|
37 var root = document.getElementById("root"); |
|
38 expectedOutput = document.getElementById("output"); |
|
39 checkResults(root, 0); |
|
40 |
|
41 document.getElementById("species-id").textContent = '2'; |
|
42 root.builder.addListener(myBuilderListener); |
|
43 root.builder.rebuild(); |
|
44 } |
|
45 |
|
46 var myBuilderListener = { |
|
47 |
|
48 willRebuild: function(aBuilder) { |
|
49 |
|
50 }, |
|
51 didRebuild: function (aBuilder) { |
|
52 var root = document.getElementById("root"); |
|
53 expectedOutput = document.getElementById("rebuilt-output"); |
|
54 checkResults(root, 0); |
|
55 SimpleTest.finish(); |
|
56 } |
|
57 } |
|
58 |
|
59 var testid ="storage listbox with dynamic query parameters"; |
|
60 var queryType = "storage"; |
|
61 var isTreeBuilder = false; |
|
62 var needsOpen = false; |
|
63 var notWorkingYet = false; |
|
64 var notWorkingYetDynamic = false; |
|
65 var expectedOutput = document.getElementById("output"); |
|
66 |
|
67 var changes = []; |
|
68 ]]> |
|
69 </script> |
|
70 |
|
71 <listbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="root" |
|
72 flex="1" datasources="profile:animals.sqlite" ref="." querytype="storage"> |
|
73 <template> |
|
74 <query> |
|
75 SELECT * FROM animals WHERE species_id = :spec ORDER BY name |
|
76 <param id="species-id" name="spec" type="int32" /> |
|
77 </query> |
|
78 <action> |
|
79 <listitem uri="?" label="?name"/> |
|
80 </action> |
|
81 </template> |
|
82 </listbox> |
|
83 |
|
84 |
|
85 |
|
86 </window> |