38 onQueryEnd:
function(resultObject, dbGUID, query) {
52 var dbq =
Cc[
"@songbirdnest.com/Songbird/DatabaseQuery;1"]
53 .createInstance(
Ci.sbIDatabaseQuery);
55 var
ios =
Cc[
"@mozilla.org/network/io-service;1"]
56 .createInstance(
Ci.nsIIOService);
58 var
dir =
Cc[
"@mozilla.org/file/directory_service;1"]
59 .createInstance(
Ci.nsIProperties);
61 var testdir = dir.get(
"ProfD",
Ci.nsIFile);
63 var actualdir = testdir.clone();
64 actualdir.append(
"db_tests");
66 if(!actualdir.exists())
69 actualdir.create(
Ci.nsIFile.DIRECTORY_TYPE, 0700);
76 var
uri = ios.newFileURI(actualdir);
77 dbq.databaseLocation =
uri;
81 dbq.setDatabaseGUID(
"test_sync");
82 dbq.addQuery(
"drop table proxy_test");
83 dbq.addQuery(
"create table proxy_test (name text, value text)");
84 dbq.addQuery(
"insert into proxy_test values ('test 0', 'testing... 0')");
85 dbq.addQuery(
"insert into proxy_test values ('test 1', 'testing... 1')");
88 dbq.waitForCompletion();
94 dbq.addQuery(
"select * from proxy_test");
99 return Components.results.NS_OK;
function assertEqual(aExpected, aActual, aMessage)
function runTest()
Advanced DataRemote unit tests.