33 var databaseGUID =
"test_guidarray_distinct";
35 var listId = library.QueryInterface(
Ci.sbILocalDatabaseLibrary).getMediaItemIdForGuid(
"7e8dcc95-7a1d-4bb3-9b14-d4906a9952cb");
39 array.isDistinct =
true;
40 array.baseTable =
"media_items";
41 array.addSort(
"http://songbirdnest.com/data/1.0#artistName",
true);
46 array.isDistinct =
true;
47 array.baseTable =
"media_items";
48 array.addSort(
"http://songbirdnest.com/data/1.0#contentLength",
true);
53 array.isDistinct =
true;
54 array.baseTable =
"simple_media_lists";
55 array.baseConstraintColumn =
"media_item_id";
56 array.baseConstraintValue = listId;
57 array.addSort(
"http://songbirdnest.com/data/1.0#albumName",
true);
65 var a = data.split(
"\n");
67 if(a.length - 1 !=
array.length) {
68 fail(
"distinct failed, length wrong, got " +
array.length +
" expected " + (a.length - 1));
71 for(var
i = 0;
i < a.length - 1;
i++) {
72 var b = a[
i].split(
"\t");
73 if(
array.getSortPropertyValueByIndex(
i) != b[0]) {
74 fail(
"distinct failed, index " +
i +
" got " +
array.getSortPropertyValueByIndex(
i) +
" expected " + b[0]);
function assertDistinct(array, dataFile)
function runTest()
Test file.
function createLibrary(databaseGuid, databaseLocation)
function readFile(fileName)
_getSelectedPageStyle s i