Sat, 03 Jan 2015 20:18:00 +0100
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 listbox with query parameters |
michael@0 | 7 | --> |
michael@0 | 8 | |
michael@0 | 9 | <window title="XUL Template Tests" width="500" height="600" |
michael@0 | 10 | onload="test_storage_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-birds"> |
michael@0 | 18 | <listitem anyid="true" label="Barn Owl"/> |
michael@0 | 19 | <listitem anyid="true" label="Emu"/> |
michael@0 | 20 | <listitem anyid="true" label="Raven"/> |
michael@0 | 21 | </data> |
michael@0 | 22 | |
michael@0 | 23 | <data id="output-L"> |
michael@0 | 24 | <listitem anyid="true" label="LAMA"/> |
michael@0 | 25 | <listitem anyid="true" label="Lion"/> |
michael@0 | 26 | </data> |
michael@0 | 27 | |
michael@0 | 28 | <script src="templates_shared.js"/> |
michael@0 | 29 | |
michael@0 | 30 | <script> |
michael@0 | 31 | <![CDATA[ |
michael@0 | 32 | |
michael@0 | 33 | copyToProfile('animals.sqlite'); |
michael@0 | 34 | SimpleTest.waitForExplicitFinish(); |
michael@0 | 35 | |
michael@0 | 36 | |
michael@0 | 37 | function test_storage_template() |
michael@0 | 38 | { |
michael@0 | 39 | var root = document.getElementById("root1"); |
michael@0 | 40 | expectedOutput = document.getElementById("output-birds"); |
michael@0 | 41 | checkResults(root, 0); |
michael@0 | 42 | |
michael@0 | 43 | root = document.getElementById("root2"); |
michael@0 | 44 | checkResults(root, 0); |
michael@0 | 45 | |
michael@0 | 46 | root = document.getElementById("root6"); |
michael@0 | 47 | checkResults(root, 0); |
michael@0 | 48 | |
michael@0 | 49 | root = document.getElementById("root3"); |
michael@0 | 50 | expectedOutput = document.getElementById("output-L"); |
michael@0 | 51 | checkResults(root, 0); |
michael@0 | 52 | |
michael@0 | 53 | root = document.getElementById("root4"); |
michael@0 | 54 | checkResults(root, 0); |
michael@0 | 55 | |
michael@0 | 56 | root = document.getElementById("root5"); |
michael@0 | 57 | checkResults(root, 0); |
michael@0 | 58 | |
michael@0 | 59 | SimpleTest.finish(); |
michael@0 | 60 | } |
michael@0 | 61 | |
michael@0 | 62 | |
michael@0 | 63 | var testid ="storage listbox with query parameters"; |
michael@0 | 64 | var queryType = "storage"; |
michael@0 | 65 | var isTreeBuilder = false; |
michael@0 | 66 | var needsOpen = false; |
michael@0 | 67 | var notWorkingYet = false; |
michael@0 | 68 | var notWorkingYetDynamic = false; |
michael@0 | 69 | var expectedOutput; |
michael@0 | 70 | |
michael@0 | 71 | var changes = []; |
michael@0 | 72 | ]]> |
michael@0 | 73 | </script> |
michael@0 | 74 | |
michael@0 | 75 | <listbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="root1" |
michael@0 | 76 | flex="1" datasources="profile:animals.sqlite" ref="." querytype="storage"> |
michael@0 | 77 | <template> |
michael@0 | 78 | <query> |
michael@0 | 79 | SELECT * FROM animals WHERE species_id = ? ORDER BY name |
michael@0 | 80 | <param>2</param> |
michael@0 | 81 | </query> |
michael@0 | 82 | <action> |
michael@0 | 83 | <listitem uri="?" label="?name"/> |
michael@0 | 84 | </action> |
michael@0 | 85 | </template> |
michael@0 | 86 | </listbox> |
michael@0 | 87 | |
michael@0 | 88 | |
michael@0 | 89 | <listbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="root2" |
michael@0 | 90 | flex="1" datasources="profile:animals.sqlite" ref="." querytype="storage"> |
michael@0 | 91 | <template> |
michael@0 | 92 | <query> |
michael@0 | 93 | SELECT * FROM animals WHERE species_id = ? ORDER BY name |
michael@0 | 94 | <param type="int32">2</param> |
michael@0 | 95 | </query> |
michael@0 | 96 | <action> |
michael@0 | 97 | <listitem uri="?" label="?name"/> |
michael@0 | 98 | </action> |
michael@0 | 99 | </template> |
michael@0 | 100 | </listbox> |
michael@0 | 101 | |
michael@0 | 102 | |
michael@0 | 103 | <listbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="root3" |
michael@0 | 104 | flex="1" datasources="profile:animals.sqlite" ref="." querytype="storage"> |
michael@0 | 105 | <template> |
michael@0 | 106 | <query> |
michael@0 | 107 | SELECT * FROM animals WHERE species_id = :spec AND name like ? ORDER BY name |
michael@0 | 108 | <param name="spec" type="int32">5</param> |
michael@0 | 109 | <param>L%</param> |
michael@0 | 110 | </query> |
michael@0 | 111 | <action> |
michael@0 | 112 | <listitem uri="?" label="?name"/> |
michael@0 | 113 | </action> |
michael@0 | 114 | </template> |
michael@0 | 115 | </listbox> |
michael@0 | 116 | |
michael@0 | 117 | <listbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="root4" |
michael@0 | 118 | flex="1" datasources="profile:animals.sqlite" ref="." querytype="storage"> |
michael@0 | 119 | <template> |
michael@0 | 120 | <query> |
michael@0 | 121 | SELECT * FROM animals WHERE species_id = ?3 AND name like ?1 ORDER BY name |
michael@0 | 122 | <param index="3" type="int32">5</param> |
michael@0 | 123 | <param index="1">L%</param> |
michael@0 | 124 | </query> |
michael@0 | 125 | <action> |
michael@0 | 126 | <listitem uri="?" label="?name"/> |
michael@0 | 127 | </action> |
michael@0 | 128 | </template> |
michael@0 | 129 | </listbox> |
michael@0 | 130 | |
michael@0 | 131 | <listbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="root5" |
michael@0 | 132 | flex="1" datasources="profile:animals.sqlite" ref="." querytype="storage"> |
michael@0 | 133 | <template> |
michael@0 | 134 | <query> |
michael@0 | 135 | SELECT * FROM animals WHERE species_id = ?3 AND name like :pattern ORDER BY name |
michael@0 | 136 | <param name="pattern">L%</param> |
michael@0 | 137 | <param index="3" type="int32">5</param> |
michael@0 | 138 | </query> |
michael@0 | 139 | <action> |
michael@0 | 140 | <listitem uri="?" label="?name"/> |
michael@0 | 141 | </action> |
michael@0 | 142 | </template> |
michael@0 | 143 | </listbox> |
michael@0 | 144 | |
michael@0 | 145 | <listbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="root6" |
michael@0 | 146 | flex="1" datasources="profile:animals.sqlite" ref="." querytype="storage"> |
michael@0 | 147 | <template> |
michael@0 | 148 | <query> |
michael@0 | 149 | SELECT * FROM animals WHERE species_id = ? ORDER BY name |
michael@0 | 150 | <param type="int32">2qsdqsd</param> |
michael@0 | 151 | </query> |
michael@0 | 152 | <action> |
michael@0 | 153 | <listitem uri="?" label="?name"/> |
michael@0 | 154 | </action> |
michael@0 | 155 | </template> |
michael@0 | 156 | </listbox> |
michael@0 | 157 | |
michael@0 | 158 | |
michael@0 | 159 | |
michael@0 | 160 | </window> |