tenfourfox/dom/xul/templates/tests/chrome/test_bug476634.xul
Cameron Kaiser c9b2922b70 hello FPR
2017-04-19 00:56:45 -07:00

77 lines
2.5 KiB
XML

<?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"?>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=476634
-->
<window title="Mozilla Bug 476634" onload="startup()"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<body xmlns="http://www.w3.org/1999/xhtml">
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=304188">Mozilla Bug 476634</a>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
</pre>
</body>
<template id="test-template">
<query>SELECT id,value FROM test</query>
<action>
<label uri="?" id="?id" value="?value"/>
</action>
</template>
<vbox id="results-list" datasources="rdf:null" querytype="storage" ref="*"
template="test-template"/>
<script class="testbody" type="application/javascript">
<![CDATA[
function startup() {
var ss = Components.classes["@mozilla.org/storage/service;1"]
.getService(Components.interfaces.mozIStorageService);
var db = ss.openSpecialDatabase("memory");
db.createTable("test", "id TEXT, value INTEGER");
var stmt = db.createStatement("INSERT INTO test (id, value) VALUES (?,?)");
stmt.bindByIndex(0, "test1");
stmt.bindByIndex(1, 0);
stmt.execute();
stmt.bindByIndex(0, "test2");
stmt.bindByIndex(1, 2147483647);
stmt.execute();
stmt.bindByIndex(0, "test3");
stmt.bindByIndex(1, -2147483648);
stmt.execute();
stmt.bindByIndex(0, "test4");
stmt.bindByIndex(1, 0);
stmt.execute();
stmt.bindByIndex(0, "test5");
stmt.bindByIndex(1, 3147483647);
stmt.execute();
stmt.bindByIndex(0, "test6");
stmt.bindByIndex(1, -3147483648);
stmt.execute();
stmt.finalize();
var list = document.getElementById("results-list");
list.builder.datasource = db;
is(list.childNodes.length, 6, "Should be 6 generated elements");
is(list.childNodes[0].value, "0", "Should have seen the correct value");
is(list.childNodes[1].value, "2147483647", "Should have seen the correct value");
is(list.childNodes[2].value, "-2147483648", "Should have seen the correct value");
is(list.childNodes[3].value, "0", "Should have seen the correct value");
is(list.childNodes[4].value, "3147483647", "Should have seen the correct value");
is(list.childNodes[5].value, "-3147483648", "Should have seen the correct value");
}
]]>
</script>
</window>