33 Components.utils.import(
"resource://app/jsmodules/sbProperties.jsm");
34 Components.utils.import(
"resource://app/jsmodules/sbLibraryUtils.jsm");
40 [
"The Beatles",
"Abbey Road",
"Come Together",
"ROCK"],
41 [
"The Beatles",
"Abbey Road",
"Sun King",
"ROCK"],
42 [
"The Beatles",
"Let It Be",
"Get Back",
"POP"],
43 [
"The Beatles",
"Let It Be",
"Two Of Us",
"POP"],
44 [
"The Doors",
"L.A. Woman",
"L.A. Woman",
"ROCK"],
45 [
"The Doors",
"L.A. Woman",
"Love Her Madly",
"ROCK"]
48 function makeItem(
i) {
49 var item = library.createMediaItem(
50 newURI(
"http://foo/" +
i +
".mp3"),
51 SBProperties.createArray([
52 [SBProperties.artistName,items[
i][0]],
53 [SBProperties.albumName, items[i][1]],
54 [SBProperties.trackName, items[i][2]],
55 [SBProperties.genre, items[i][3]]
60 var item1 = makeItem(0);
61 var item2 = makeItem(1);
62 var item3 = makeItem(2);
63 var item4 = makeItem(3);
64 var item5 = makeItem(4);
65 var item6 = makeItem(5);
67 var view = library.createView();
69 var enumerator = view.getDistinctValuesForProperty(SBProperties.artistName);
74 enumerator = view.getDistinctValuesForProperty(SBProperties.albumName);
82 [SBProperties.artistName, [
"The Beatles"]]
86 enumerator = view.getDistinctValuesForProperty(SBProperties.artistName);
90 enumerator = view.getDistinctValuesForProperty(SBProperties.albumName);
97 [SBProperties.artistName, [
"The Beatles"]]
100 [SBProperties.albumName, [
"Let It Be"]]
104 enumerator = view.getDistinctValuesForProperty(SBProperties.artistName);
108 enumerator = view.getDistinctValuesForProperty(SBProperties.albumName);
function assertEqual(aExpected, aActual, aMessage)
function runTest()
Test file.
function createLibrary(databaseGuid, databaseLocation)
function newURI(aURLString)
function assertFalse(aTest, aMessage)
Javascript wrappers for common library tasks.
_getSelectedPageStyle s i