33 var dbq =
Cc[
"@songbirdnest.com/Songbird/DatabaseQuery;1"]
34 .createInstance(
Ci.sbIDatabaseQuery);
36 var
ios =
Cc[
"@mozilla.org/network/io-service;1"]
37 .createInstance(
Ci.nsIIOService);
39 var
dir =
Cc[
"@mozilla.org/file/directory_service;1"]
40 .createInstance(
Ci.nsIProperties);
42 var testdir = dir.get(
"ProfD",
Ci.nsIFile);
44 var actualdir = testdir.clone();
45 actualdir.append(
"db_tests");
47 if(!actualdir.exists())
50 actualdir.create(
Ci.nsIFile.DIRECTORY_TYPE, 0700);
57 var
uri = ios.newFileURI(actualdir);
58 dbq.databaseLocation =
uri;
63 dbq.setDatabaseGUID(
"test_sync");
64 dbq.addQuery(
"drop table proxy_test");
65 dbq.addQuery(
"create table proxy_test (name text, value text)");
67 dbq.waitForCompletion();
70 for ( var j = 0; j < 500; j++ ) {
71 log(
"Looping: doing query number: " + j);
72 var query =
Cc[
"@songbirdnest.com/Songbird/DatabaseQuery;1"]
73 .createInstance(
Ci.sbIDatabaseQuery);
74 query.databaseLocation =
uri;
75 query.setDatabaseGUID(
"test_sync");
77 for ( var
i = 0;
i < 10;
i++ ) {
78 query.addQuery(
"insert into proxy_test values ('test " + j +
i +
"', 'testing... " + j +
i +
"')");
84 return Components.results.NS_OK;
function assertEqual(aExpected, aActual, aMessage)
function runTest()
Test file.
_getSelectedPageStyle s i