29 Components.utils.import(
"resource://app/jsmodules/sbProperties.jsm");
30 Components.utils.import(
"resource://app/jsmodules/sbLibraryUtils.jsm");
35 var playlist1 = library.createMediaList(
"simple");
36 var
playlist2 = library.createMediaList(
"simple");
39 [
"The Beatles",
"Abbey Road",
"Come Together",
"ROCK"],
40 [
"The Beatles",
"Abbey Road",
"Sun King",
"ROCK"],
41 [
"The Beatles",
"Let It Be",
"Get Back",
"POP"],
42 [
"The Beatles",
"Let It Be",
"Two Of Us",
"POP"],
43 [
"The Doors",
"L.A. Woman",
"L.A. Woman",
"ROCK"],
44 [
"The Doors",
"L.A. Woman",
"Love Her Madly",
"ROCK"]
47 function makeItem(
i) {
48 var item = library.createMediaItem(
49 newURI(
"http://foo/" +
i +
".mp3"),
50 SBProperties.createArray([
51 [SBProperties.artistName,items[
i][0]],
52 [SBProperties.albumName, items[i][1]],
53 [SBProperties.trackName, items[i][2]],
54 [SBProperties.genre, items[i][3]]
59 var item1 = makeItem(0);
60 var item2 = makeItem(1);
61 var item3 = makeItem(2);
62 var item4 = makeItem(3);
63 var item5 = makeItem(4);
64 var item6 = makeItem(5);
66 var view = library.createView();
68 var
listener =
new TestMediaListViewListener();
69 view.addListener(listener,
false);
74 [SBProperties.isList, [
"0"]]
77 [SBProperties.hidden, [
"0"]]
86 view.filterConstraint =
null;
95 [SBProperties.artistName, [
"The Doors"]]
104 view.searchConstraint =
null;
111 view.setSort(SBProperties.createArray([
112 [SBProperties.artistName,
"d"]
127 var cfs = view.cascadeFilterSet;
129 cfs.appendSearch([
"*"], 1);
130 cfs.appendFilter(SBProperties.genre);
131 cfs.appendFilter(SBProperties.artistName);
132 cfs.appendFilter(SBProperties.albumName);
135 cfs.set(1, [
"ROCK"], 1);
150 cfs.set(0, [
"Beat"], 1);
164 view.removeListener(listener);
167 view.addListener(listener,
true);
170 view.addListener(listener);
174 [SBProperties.isList, [
"0"]]
177 [SBProperties.hidden, [
"0"]]
187 Components.utils.forceGC();
190 view.filterConstraint =
null;
function assertTrue(aTest, aMessage)
function createLibrary(databaseGuid, databaseLocation)
function newURI(aURLString)
function assertFalse(aTest, aMessage)
function runTest()
Advanced DataRemote unit tests.
Javascript wrappers for common library tasks.
_getSelectedPageStyle s i