37 if (platform ==
"Windows_NT") {
41 file:
"win_parse.m3u",
42 result:
"win_parsem3u_result.xml"
45 originalURI:
"http://www.foo.com/",
46 file:
"relative_remote.m3u",
47 result:
"relative_remote_result.xml"
50 originalURI:
"http://www.foo.com/mp3/",
51 file:
"absolute_remote.m3u",
52 result:
"absolute_remote_result.xml"
57 result:
"win_utf8_result.xml"
61 file:
"win_utf8.m3u8",
62 result:
"win_utf8_result.xml"
69 file:
"maclin_parse.m3u",
70 result:
"maclin_parsem3u_result.xml"
73 originalURI:
"http://www.foo.com/",
74 file:
"relative_remote.m3u",
75 result:
"relative_remote_result.xml"
78 originalURI:
"http://www.foo.com/mp3/",
79 file:
"absolute_remote.m3u",
80 result:
"absolute_remote_result.xml"
84 file:
"maclin_utf8.m3u",
85 result:
"maclin_utf8_result.xml"
89 file:
"maclin_utf8.m3u8",
90 result:
"maclin_utf8_result.xml"
93 enabled: platform ==
"Darwin",
95 file:
"maclin_unf.m3u",
96 result:
"maclin_unf_nfd_result.xml"
99 enabled: platform !=
"Darwin",
101 file:
"maclin_unf.m3u",
102 result:
"maclin_unf_nfc_result.xml"
107 for (var
i = 0;
i < tests.length;
i++) {
109 if ((
"enabled" in t) && !t.enabled)
111 log(
"testing file " + t.file);
113 var
handler =
Cc[
"@songbirdnest.com/Songbird/Playlist/Reader/M3U;1"]
114 .createInstance(
Ci.sbIPlaylistReader);
118 handler.originalURI =
newURI(t.originalURI);
120 handler.read(file, library,
false);
126 var
handler =
Cc[
"@songbirdnest.com/Songbird/Playlist/Reader/M3U;1"]
127 .createInstance(
Ci.sbIPlaylistReader);
130 if (platform ==
"Windows_NT") {
131 fileName =
"win_relative_local.m3u";
133 fileName =
"maclin_relative_local.m3u";
135 log(
"testing file " + fileName);
138 handler.read(file, library,
false);
141 var file1 = mp3dir.clone();
142 file1.append(
"file1.mp3");
143 var file2 = mp3dir.clone();
144 file2.append(
"file2.mp3");
145 var musicdir =
getFile(
"music");
146 var file3 = musicdir.clone();
147 file3.append(
"file3.mp3");
148 var files = [file1, file2, file3];
150 var prop =
"http://songbirdnest.com/data/1.0#contentURL";
151 for (var
i in files) {
155 fail(
"item with property '" + prop +
"' equal to '" + result +
"' not found");
162 var mediaList = library.createMediaList(
"simple");
163 var handler =
Cc[
"@songbirdnest.com/Songbird/Playlist/Reader/M3U;1"]
164 .createInstance(
Ci.sbIPlaylistReader);
166 var file =
getFile(
"relative_remote.m3u");
167 handler.originalURI =
newURI(
"http://www.foo.com");
169 handler.read(file, mediaList,
false);
172 handler.read(file, mediaList,
false);
177 handler.read(file, mediaList,
true);
function getFirstItemByProperty(aMediaList, aProperty, aValue)
function assertEqual(aExpected, aActual, aMessage)
function getFile(fileName)
function newFileURI(file)
function createLibrary(databaseGuid, databaseLocation)
function newURI(aURLString)
function assertMediaList(aMediaList, aItemTestsFile, aPort)
_getSelectedPageStyle s i