33 Components.utils.import(
"resource://app/jsmodules/sbProperties.jsm");
38 var item = library.createMediaItem(
newURI(
"http://foo.com/"));
40 assertEqual(item.guid, item.getProperty(SBProperties.GUID));
41 var properties = item.getProperties();
42 assertEqual(item.guid, properties.getPropertyValue(SBProperties.GUID));
45 item.setProperty(SBProperties.GUID,
"foo");
46 fail(
"did not throw");
53 item.setProperties(SBProperties.createArray([
54 [SBProperties.GUID,
"foo"]
56 fail(
"did not throw");
63 var item2 = library.createMediaItem(
newURI(
"http://foo.com/"),
64 SBProperties.createArray([
65 [SBProperties.GUID,
"foo"]
71 onEnumerationBegin:
function(aMediaList) {
73 onEnumeratedItem:
function(aMediaList, aMediaItem) {
74 this._item = aMediaItem;
76 onEnumerationEnd:
function(aMediaList, aStatusCode) {
80 library.enumerateItemsByProperty(SBProperties.GUID,
83 Ci.sbIMediaList.ENUMERATIONTYPE_LOCKING);
function runTest()
Test file.
function assertTrue(aTest, aMessage)
function assertEqual(aExpected, aActual, aMessage)
function createLibrary(databaseGuid, databaseLocation)
function newURI(aURLString)