33 var databaseGUID =
"test_guidarray_sort";
35 var listId = library.QueryInterface(
Ci.sbILocalDatabaseLibrary).getMediaItemIdForGuid(
"7e8dcc95-7a1d-4bb3-9b14-d4906a9952cb");
40 array.baseTable =
"media_items";
41 array.addSort(
"http://songbirdnest.com/data/1.0#trackName",
true);
43 assertSort(array,
"data_sort_trackname_asc.txt");
47 array.baseTable =
"media_items";
48 array.addSort(
"http://songbirdnest.com/data/1.0#trackName",
false);
50 assertSort(array,
"data_sort_trackname_desc.txt");
54 array.baseTable =
"media_items";
55 array.addSort(
"http://songbirdnest.com/data/1.0#trackName",
true);
57 assertSort(array,
"data_sort_trackname_asc.txt");
61 array.baseTable =
"media_items";
62 array.addSort(
"http://songbirdnest.com/data/1.0#trackName",
false);
63 array.fetchSize = 200;
64 assertSort(array,
"data_sort_trackname_desc.txt");
68 array.baseTable =
"media_items";
69 array.addSort(
"http://songbirdnest.com/data/1.0#playCount",
true);
71 assertSort(array,
"data_sort_playcount_asc.txt");
75 array.baseTable =
"media_items";
76 array.addSort(
"http://songbirdnest.com/data/1.0#playCount",
false);
78 assertSort(array,
"data_sort_playcount_desc.txt");
82 array.baseTable =
"media_items";
83 array.addSort(
"http://songbirdnest.com/data/1.0#contentURL",
true);
85 assertSort(array,
"data_sort_contenturl_asc.txt");
89 array.baseTable =
"media_items";
90 array.addSort(
"http://songbirdnest.com/data/1.0#contentURL",
false);
92 assertSort(array,
"data_sort_contenturl_desc.txt");
96 array.baseTable =
"simple_media_lists";
97 array.baseConstraintColumn =
"media_item_id";
98 array.baseConstraintValue = listId;
99 array.addSort(
"http://songbirdnest.com/data/1.0#ordinal",
true);
100 array.fetchSize = 40;
101 assertSort(array,
"data_sort_sml101_ordinal_asc.txt");
104 array.baseTable =
"simple_media_lists";
105 array.baseConstraintColumn =
"media_item_id";
106 array.baseConstraintValue = listId;
107 array.addSort(
"http://songbirdnest.com/data/1.0#ordinal",
false);
108 array.fetchSize = 40;
109 assertSort(array,
"data_sort_sml101_ordinal_desc.txt");
function createLibrary(databaseGuid, databaseLocation)
function runTest()
Test file.
function assertSort(array, dataFile)