<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>

<!--
    storage sort integer desc
-->

<window title="XUL Template Tests" width="500" height="600"
        onload="test_template();"
        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
  <script type="application/javascript"
          src="chrome://mochikit/content/MochiKit/packed.js"></script>
  <script type="application/javascript"
          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>

  <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/>

<script src="templates_shared.js"/>

<script>
<![CDATA[
SimpleTest.waitForExplicitFinish();

var testid ="storage sort integer desc";
var queryType = "storage";
var isTreeBuilder = false;
var needsOpen = false;
var notWorkingYet = false;
var notWorkingYetDynamic = false;
var expectedOutput =
<output>
    <row anyid="true">  <label value="16"/>  <label value="Chameleon"/>  </row>
    <row anyid="true">  <label value="15"/>  <label value="Anaconda"/>  </row>
    <row anyid="true">  <label value="14"/>  <label value="Gorilla"/>  </row>
    <row anyid="true">  <label value="13"/>  <label value="Nine-banded Armadillo"/>  </row>
    <row anyid="true">  <label value="12"/>  <label value="aardvark"/>  </row>
    <row anyid="true">  <label value="11"/>  <label value="Polar Bear"/>  </row>
    <row anyid="true">  <label value="10"/>  <label value="LAMA"/>  </row>
    <row anyid="true">  <label value="9"/>  <label value="African Elephant"/>  </row>
    <row anyid="true">  <label value="8"/>  <label value="HIPPOPOTAMUS"/>  </row>
    <row anyid="true">  <label value="7"/>  <label value="Lion"/>  </row>
    <row anyid="true">  <label value="6"/>  <label value="Swordfish"/>  </row>
    <row anyid="true">  <label value="5"/>  <label value="Cod"/>  </row>
    <row anyid="true">  <label value="4"/>  <label value="Raven"/>  </row>
    <row anyid="true">  <label value="3"/>  <label value="Barn Owl"/>  </row>
    <row anyid="true">  <label value="2"/>  <label value="Emu"/> </row>
    <row anyid="true">  <label value="1"/>  <label value="Tarantula"/> </row>
</output>;

var changes = [];
]]>
</script>

<grid xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" >
    <columns>
        <column flex="1"/>
        <column flex="3"/>
    </columns>
    <rows id="root" datasources="animals.sqlite" querytype="storage" ref="."
         sort="?id" sortDirection="descending">
        <template>
            <query>SELECT id, name FROM animals</query>
            <action>
                <row uri="?">
                    <label value="?id"/>
                    <label value="?name"/>
                </row>
            </action>
        </template>
    </rows>
</grid>




</window>
