36 const dbGUID =
"9c1ecf14-667b-47ce-b533-2dfd242f3ede";
38 var directory =
Cc[
"@mozilla.org/file/directory_service;1"].
40 get(
"ProfD",
Ci.nsIFile);
41 directory.append(
"db_tests");
43 if (!directory.exists()) {
47 var
file = directory.clone();
48 file.append(dbGUID +
".db");
55 Cc[
"@songbirdnest.com/Songbird/Library/LocalDatabase/LibraryFactory;1"].
58 var hashBag =
Cc[
"@mozilla.org/hash-property-bag;1"].
60 hashBag.setPropertyAsInterface(
"databaseFile", file);
62 var library = libraryFactory.createLibrary(hashBag);
67 var testURI =
newURI(
"file:///testitem");
68 var item1 = library.createMediaItem(testURI,
null,
true);
69 var item2 = library.createMediaItem(testURI,
null,
true);
73 assertEqual(library.getItemByGuid(item1.guid).guid, item1.guid);
74 assertEqual(library.getItemByGuid(item2.guid).guid, item2.guid);
function loadData(databaseGuid, databaseLocation)
function assertNotEqual(aExpected, aActual, aMessage)
function assertEqual(aExpected, aActual, aMessage)
getService(Ci.sbIFaceplateManager)
function runTest()
Test file.
function newFileURI(file)
function newURI(aURLString)
#define PERMISSIONS_DIRECTORY