33 Components.utils.import(
"resource://app/jsmodules/sbProperties.jsm");
34 Components.utils.import(
"resource://app/jsmodules/sbLibraryUtils.jsm");
40 var view = list.createView();
44 [SBProperties.artistName, [
"AC/DC"]]
47 view.filterConstraint =
filter;
48 assertTrue(filter.equals(view.filterConstraint));
53 [SBProperties.artistName, [
"AC/DC",
"Accept"]]
56 view.filterConstraint =
filter;
61 [SBProperties.artistName, [
"AC/DC",
"Accept",
"a-ha"]]
64 view.filterConstraint =
filter;
69 [SBProperties.artistName, [
"AC/DC",
"Accept",
"a-ha"]]
72 [SBProperties.albumName, [
"Back in Black"]]
75 view.filterConstraint =
filter;
80 [SBProperties.artistName, [
"AC/DC",
"Accept",
"a-ha"]]
83 [SBProperties.albumName, [
"Back in Black",
"Restless and Wild/Balls to the Wall"]]
86 view.filterConstraint =
filter;
89 view.filterConstraint =
null;
94 [SBProperties.GUID, [
"3E3A8948-AD99-11DB-9321-C22AB7121F49"]]
97 view.filterConstraint =
filter;
99 assertEqual(view.getItemByIndex(0).guid,
"3E3A8948-AD99-11DB-9321-C22AB7121F49");
102 list = library.getMediaItem(
"7e8dcc95-7a1d-4bb3-9b14-d4906a9952cb");
103 view = list.createView();
107 [SBProperties.GUID, [
"3E3A8948-AD99-11DB-9321-C22AB7121F49"]]
110 view.filterConstraint =
filter;
112 assertEqual(view.getItemByIndex(0).guid,
"3E3A8948-AD99-11DB-9321-C22AB7121F49");
116 [SBProperties.artistName, [
"AC/DC"]]
119 view.filterConstraint =
filter;
function assertTrue(aTest, aMessage)
function assertEqual(aExpected, aActual, aMessage)
function runTest()
Test file.
function createLibrary(databaseGuid, databaseLocation)
Javascript wrappers for common library tasks.
Array filter(tab.attributes, function(aAttr){return(_this.xulAttributes.indexOf(aAttr.name) >-1);}).forEach(tab.removeAttribute