content/xul/templates/tests/chrome/test_tmpl_storage_tree.xul

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

michael@0 1 <?xml version="1.0"?>
michael@0 2 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
michael@0 3 <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
michael@0 4
michael@0 5 <!--
michael@0 6 storage tree
michael@0 7 -->
michael@0 8
michael@0 9 <window title="XUL Template Tests" width="500" height="600"
michael@0 10 onload="test_template();"
michael@0 11 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
michael@0 12 <script type="application/javascript"
michael@0 13 src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
michael@0 14
michael@0 15 <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/>
michael@0 16
michael@0 17 <data id="output">
michael@0 18 <treecols orient="horizontal">
michael@0 19 <treecol id="species" primary="true" label="Species" flex="2" ordinal="1"/>
michael@0 20 <treecol id="name" label="Common name" flex="2" ordinal="3"/>
michael@0 21 <treecol id="specimen" label="Specimen" flex="3" ordinal="5"/>
michael@0 22 <treecol id="id" label="id" flex="1" ordinal="7"/>
michael@0 23 </treecols>
michael@0 24 <treechildren>
michael@0 25 <treeitem anyid="true"> <treerow>
michael@0 26 <treecell label="arachnids" /> <treecell label="Tarantula"/> <treecell label="Avicularia avicularia" /> <treecell label="1"/>
michael@0 27 </treerow> </treeitem>
michael@0 28 <treeitem anyid="true"> <treerow>
michael@0 29 <treecell label="birds" /> <treecell label="Barn Owl"/> <treecell label="Tyto alba" /> <treecell label="3"/>
michael@0 30 </treerow> </treeitem>
michael@0 31 <treeitem anyid="true"> <treerow>
michael@0 32 <treecell label="birds" /> <treecell label="Emu"/> <treecell label="Dromaius novaehollandiae" /> <treecell label="2"/>
michael@0 33 </treerow> </treeitem>
michael@0 34 <treeitem anyid="true"> <treerow>
michael@0 35 <treecell label="birds" /> <treecell label="Raven"/> <treecell label="Corvus corax" /> <treecell label="4"/>
michael@0 36 </treerow> </treeitem>
michael@0 37 <treeitem anyid="true"> <treerow>
michael@0 38 <treecell label="fish" /> <treecell label="Cod"/> <treecell label="Gadus morhua" /> <treecell label="5"/>
michael@0 39 </treerow> </treeitem>
michael@0 40 <treeitem anyid="true"> <treerow>
michael@0 41 <treecell label="fish" /> <treecell label="Swordfish"/> <treecell label="Xiphias gladius" /> <treecell label="6"/>
michael@0 42 </treerow> </treeitem>
michael@0 43 <treeitem anyid="true"> <treerow>
michael@0 44 <treecell label="mammals" /> <treecell label="African Elephant"/> <treecell label="Loxodonta africana" /> <treecell label="9"/>
michael@0 45 </treerow> </treeitem>
michael@0 46 <treeitem anyid="true"> <treerow>
michael@0 47 <treecell label="mammals" /> <treecell label="Gorilla"/> <treecell label="Gorilla gorilla" /> <treecell label="14"/>
michael@0 48 </treerow> </treeitem>
michael@0 49 <treeitem anyid="true"> <treerow>
michael@0 50 <treecell label="mammals" /> <treecell label="HIPPOPOTAMUS"/> <treecell label="Hippopotamus amphibius" /> <treecell label="8"/>
michael@0 51 </treerow> </treeitem>
michael@0 52 <treeitem anyid="true"> <treerow>
michael@0 53 <treecell label="mammals" /> <treecell label="LAMA"/> <treecell label="Lama glama" /> <treecell label="10"/>
michael@0 54 </treerow> </treeitem>
michael@0 55 <treeitem anyid="true"> <treerow>
michael@0 56 <treecell label="mammals" /> <treecell label="Lion"/> <treecell label="Panthera leo" /> <treecell label="7"/>
michael@0 57 </treerow> </treeitem>
michael@0 58 <treeitem anyid="true"> <treerow>
michael@0 59 <treecell label="mammals" /> <treecell label="Nine-banded Armadillo"/> <treecell label="Dasypus novemcinctus" /> <treecell label="13"/>
michael@0 60 </treerow> </treeitem>
michael@0 61 <treeitem anyid="true"> <treerow>
michael@0 62 <treecell label="mammals" /> <treecell label="Polar Bear"/> <treecell label="Thalarctos maritimus" /> <treecell label="11"/>
michael@0 63 </treerow> </treeitem>
michael@0 64 <treeitem anyid="true"> <treerow>
michael@0 65 <treecell label="mammals" /> <treecell label="aardvark"/> <treecell label="Orycteropus afer" /> <treecell label="12"/>
michael@0 66 </treerow> </treeitem>
michael@0 67 <treeitem anyid="true"> <treerow>
michael@0 68 <treecell label="reptiles" /> <treecell label="Anaconda"/> <treecell label="Eunectes murinus" /> <treecell label="15"/>
michael@0 69 </treerow> </treeitem>
michael@0 70 <treeitem anyid="true"> <treerow>
michael@0 71 <treecell label="reptiles" /> <treecell label="Chameleon"/> <treecell label="Chamaeleo chamaelon" /> <treecell label="16"/>
michael@0 72 </treerow> </treeitem>
michael@0 73 </treechildren>
michael@0 74 </data>
michael@0 75
michael@0 76 <script src="templates_shared.js"/>
michael@0 77
michael@0 78 <script>
michael@0 79 <![CDATA[
michael@0 80 SimpleTest.waitForExplicitFinish();
michael@0 81
michael@0 82 copyToProfile('animals.sqlite');
michael@0 83
michael@0 84 var testid ="storage tree";
michael@0 85 var queryType = "storage";
michael@0 86 var isTreeBuilder = true;
michael@0 87 var needsOpen = false;
michael@0 88 var notWorkingYet = false;
michael@0 89 var notWorkingYetDynamic = false;
michael@0 90 var expectedOutput = document.getElementById("output");
michael@0 91
michael@0 92 var changes = [];
michael@0 93 ]]>
michael@0 94 </script>
michael@0 95
michael@0 96 <tree xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="root"
michael@0 97 flex="1" datasources="profile:animals.sqlite" ref="*" querytype="storage" flags="dont-build-content">
michael@0 98 <treecols>
michael@0 99 <treecol id="species" primary="true" label="Species" flex="2"/>
michael@0 100 <treecol id="name" label="Common name" flex="2"/>
michael@0 101 <treecol id="specimen" label="Specimen" flex="3"/>
michael@0 102 <treecol id="id" label="id" flex="1"/>
michael@0 103 </treecols>
michael@0 104 <template>
michael@0 105 <query>
michael@0 106 SELECT a.id, a.name, a.specimen, s.name as species FROM animals a, species s
michael@0 107 WHERE a.species_id = s.id ORDER BY species, a.name</query>
michael@0 108 <action>
michael@0 109 <treechildren>
michael@0 110 <treeitem uri="?">
michael@0 111 <treerow>
michael@0 112 <treecell label="?species"/>
michael@0 113 <treecell label="?name"/>
michael@0 114 <treecell label="?specimen"/>
michael@0 115 <treecell label="?id"/>
michael@0 116 </treerow>
michael@0 117 </treeitem>
michael@0 118 </treechildren>
michael@0 119 </action>
michael@0 120 </template>
michael@0 121 </tree>
michael@0 122 </window>

mercurial