33 Components.utils.import(
"resource://app/jsmodules/sbProperties.jsm");
36 var databaseGUID =
"test_library_statistics";
41 { artistName:
'A',
rating: 1 },
42 { artistName:
'A',
rating: 2 },
43 { artistName:
'A',
rating: 3 },
44 { artistName:
'A',
rating: 4 },
45 { artistName:
'A',
rating: 5 },
46 { artistName:
'A',
rating: 1 },
47 { artistName:
'A',
rating: 1 },
48 { artistName:
'A',
rating: 1 },
49 { artistName:
'A',
rating: 1 },
50 { artistName:
'A',
rating: 2 },
51 { artistName:
'B',
rating: 3 },
52 { artistName:
'B',
rating: 2 },
53 { artistName:
'B',
rating: 2 },
54 { artistName:
'C',
rating: 4 },
55 { artistName:
'C',
rating: 4 },
56 { artistName:
'C',
rating: 5 },
57 { artistName:
'C',
rating: 1 },
58 { artistName:
'C',
rating: 2 },
59 { artistName:
'D',
rating: 3 },
60 { artistName:
'E',
rating: 2 },
63 for (var
i in items) {
65 var item = library.createMediaItem(
newURI(
'about:test/'+
i));
66 for (var
p in props) {
67 item.setProperty(SBProperties[
p], props[p]);
76 function array2array(a) {
78 for (var
i=0;
i<a.length;
i++) {
79 a2.push(a.queryElementAt(
i, Components.interfaces.nsIVariant));
86 library.collectDistinctValues(SBProperties.artistName,
87 sbILibraryStatistics.COLLECT_SUM, SBProperties.rating,
true, 100)),
92 library.collectDistinctValues(SBProperties.artistName,
93 sbILibraryStatistics.COLLECT_SUM, SBProperties.rating,
false, 100)),
98 library.collectDistinctValues(SBProperties.artistName,
99 sbILibraryStatistics.COLLECT_SUM, SBProperties.rating,
false, 2)),
dataSBHighestRatedArtists SBProperties rating
Extract statistics from a media library.
function assertArraysEqual(a1, a2)
function runTest()
Test file.
function createLibrary(databaseGuid, databaseLocation)
function newURI(aURLString)
_getSelectedPageStyle s i