content/xul/templates/tests/chrome/test_bug476634.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
michael@0 4 href="chrome://mochikit/content/tests/SimpleTest/test.css"
michael@0 5 type="text/css"?>
michael@0 6 <!--
michael@0 7 https://bugzilla.mozilla.org/show_bug.cgi?id=476634
michael@0 8 -->
michael@0 9 <window title="Mozilla Bug 476634" onload="startup()"
michael@0 10 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
michael@0 11
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">
michael@0 16 <a target="_blank"
michael@0 17 href="https://bugzilla.mozilla.org/show_bug.cgi?id=304188">Mozilla Bug 476634</a>
michael@0 18 <p id="display"></p>
michael@0 19 <div id="content" style="display: none">
michael@0 20 </div>
michael@0 21 <pre id="test">
michael@0 22 </pre>
michael@0 23 </body>
michael@0 24 <template id="test-template">
michael@0 25 <query>SELECT id,value FROM test</query>
michael@0 26 <action>
michael@0 27 <label uri="?" id="?id" value="?value"/>
michael@0 28 </action>
michael@0 29 </template>
michael@0 30 <vbox id="results-list" datasources="rdf:null" querytype="storage" ref="*"
michael@0 31 template="test-template"/>
michael@0 32
michael@0 33 <script class="testbody" type="application/javascript">
michael@0 34 <![CDATA[
michael@0 35 function startup() {
michael@0 36 var ss = Components.classes["@mozilla.org/storage/service;1"]
michael@0 37 .getService(Components.interfaces.mozIStorageService);
michael@0 38 var db = ss.openSpecialDatabase("memory");
michael@0 39
michael@0 40 db.createTable("test", "id TEXT, value INTEGER");
michael@0 41 var stmt = db.createStatement("INSERT INTO test (id, value) VALUES (?,?)");
michael@0 42 stmt.bindStringParameter(0, "test1");
michael@0 43 stmt.bindInt32Parameter(1, 0);
michael@0 44 stmt.execute();
michael@0 45 stmt.bindStringParameter(0, "test2");
michael@0 46 stmt.bindInt32Parameter(1, 2147483647);
michael@0 47 stmt.execute();
michael@0 48 stmt.bindStringParameter(0, "test3");
michael@0 49 stmt.bindInt32Parameter(1, -2147483648);
michael@0 50 stmt.execute();
michael@0 51 stmt.bindStringParameter(0, "test4");
michael@0 52 stmt.bindInt64Parameter(1, 0);
michael@0 53 stmt.execute();
michael@0 54 stmt.bindStringParameter(0, "test5");
michael@0 55 stmt.bindInt64Parameter(1, 3147483647);
michael@0 56 stmt.execute();
michael@0 57 stmt.bindStringParameter(0, "test6");
michael@0 58 stmt.bindInt64Parameter(1, -3147483648);
michael@0 59 stmt.execute();
michael@0 60 stmt.finalize();
michael@0 61
michael@0 62 var list = document.getElementById("results-list");
michael@0 63 list.builder.datasource = db;
michael@0 64
michael@0 65 is(list.childNodes.length, 6, "Should be 6 generated elements");
michael@0 66 is(list.childNodes[0].value, "0", "Should have seen the correct value");
michael@0 67 is(list.childNodes[1].value, "2147483647", "Should have seen the correct value");
michael@0 68 is(list.childNodes[2].value, "-2147483648", "Should have seen the correct value");
michael@0 69 is(list.childNodes[3].value, "0", "Should have seen the correct value");
michael@0 70 is(list.childNodes[4].value, "3147483647", "Should have seen the correct value");
michael@0 71 is(list.childNodes[5].value, "-3147483648", "Should have seen the correct value");
michael@0 72 }
michael@0 73 ]]>
michael@0 74 </script>
michael@0 75
michael@0 76 </window>

mercurial