content/xul/templates/tests/chrome/test_tmpl_storage_parameters.xul

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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"?>
     5 <!--
     6     storage listbox with query parameters
     7 -->
     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>
    15   <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/>
    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>
    23   <data id="output-L">
    24     <listitem anyid="true" label="LAMA"/>
    25     <listitem anyid="true" label="Lion"/>
    26   </data>
    28 <script src="templates_shared.js"/>
    30 <script>
    31 <![CDATA[
    33 copyToProfile('animals.sqlite');
    34 SimpleTest.waitForExplicitFinish();
    37 function test_storage_template()
    38 {
    39   var root = document.getElementById("root1");
    40   expectedOutput = document.getElementById("output-birds");
    41   checkResults(root, 0);
    43 root = document.getElementById("root2");
    44 checkResults(root, 0);
    46 root = document.getElementById("root6");
    47 checkResults(root, 0);
    49 root = document.getElementById("root3");
    50 expectedOutput = document.getElementById("output-L");
    51 checkResults(root, 0);
    53 root = document.getElementById("root4");
    54 checkResults(root, 0);
    56 root = document.getElementById("root5");
    57 checkResults(root, 0);
    59 SimpleTest.finish();
    60 }
    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;
    71 var changes = [];
    72 ]]>
    73 </script>
    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>
    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>
   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>
   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>
   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>
   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>
   160 </window>

mercurial