1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/content/xul/templates/tests/chrome/test_tmpl_storage_multiqueries.xul Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,86 @@ 1.4 +<?xml version="1.0"?> 1.5 +<?xml-stylesheet href="chrome://global/skin" type="text/css"?> 1.6 +<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?> 1.7 + 1.8 +<!-- 1.9 + storage listbox with multiqueries 1.10 +--> 1.11 + 1.12 +<window title="XUL Template Tests" width="500" height="600" 1.13 + onload="test_template();" 1.14 + xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> 1.15 + <script type="application/javascript" 1.16 + src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> 1.17 + 1.18 + <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/> 1.19 + 1.20 + <data id="output"> 1.21 + <listitem anyid="true" label="Mammal: African Elephant"/> 1.22 + <listitem anyid="true" label="Mammal: Gorilla" style="font-weight:bold"/> 1.23 + <listitem anyid="true" label="Mammal: HIPPOPOTAMUS"/> 1.24 + <listitem anyid="true" label="Mammal: LAMA"/> 1.25 + <listitem anyid="true" label="Mammal: Lion"/> 1.26 + <listitem anyid="true" label="Mammal: Nine-banded Armadillo" style="font-weight:bold"/> 1.27 + <listitem anyid="true" label="Mammal: Polar Bear"/> 1.28 + <listitem anyid="true" label="Mammal: aardvark"/> 1.29 + <listitem anyid="true" label="Bird: Barn Owl" style="font-style:italic"/> 1.30 + <listitem anyid="true" label="Bird: Emu"/> 1.31 + <listitem anyid="true" label="Bird: Raven"/> 1.32 + </data> 1.33 + 1.34 +<script src="templates_shared.js"/> 1.35 + 1.36 +<script> 1.37 +<![CDATA[ 1.38 +SimpleTest.waitForExplicitFinish(); 1.39 + 1.40 +copyToProfile('animals.sqlite'); 1.41 + 1.42 +var testid ="storage listbox with multiqueries"; 1.43 +var queryType = "storage"; 1.44 +var isTreeBuilder = false; 1.45 +var needsOpen = false; 1.46 +var notWorkingYet = false; 1.47 +var notWorkingYetDynamic = false; 1.48 +var expectedOutput = document.getElementById("output"); 1.49 + 1.50 +var changes = []; 1.51 +]]> 1.52 +</script> 1.53 + 1.54 +<listbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="root" 1.55 + flex="1" datasources="profile:animals.sqlite" ref="." querytype="storage"> 1.56 + <template> 1.57 + <queryset> 1.58 + <query>SELECT * FROM animals WHERE species_id = 5 ORDER BY name</query> 1.59 + <rule> 1.60 + <where subject="?id" rel="greater" value="12"/> 1.61 + <action> 1.62 + <listitem uri="?" label="Mammal: ?name" style="font-weight:bold"/> 1.63 + </action> 1.64 + </rule> 1.65 + <rule> 1.66 + <action> 1.67 + <listitem uri="?" label="Mammal: ?name"/> 1.68 + </action> 1.69 + </rule> 1.70 + </queryset> 1.71 + <queryset> 1.72 + <!-- we use aliases on columns just to have different "column names" in the result set 1.73 + to "similate" a result set from another table for example --> 1.74 + <query>SELECT * FROM animals WHERE species_id = 2 ORDER BY name</query> 1.75 + <rule> 1.76 + <where subject="?id" rel="equals" value="3"/> 1.77 + <action> 1.78 + <listitem uri="?" label="Bird: ?name" style="font-style:italic"/> 1.79 + </action> 1.80 + </rule> 1.81 + <rule> 1.82 + <action> 1.83 + <listitem uri="?" label="Bird: ?name"/> 1.84 + </action> 1.85 + </rule> 1.86 + </queryset> 1.87 + </template> 1.88 +</listbox> 1.89 +</window>