33 var manager =
Cc[
"@songbirdnest.com/Songbird/PlaylistWriterManager;1"]
34 .getService(
Ci.sbIPlaylistWriterManager);
38 var mimeTypesCount = {};
39 var mimeTypes = manager.supportedMIMETypes(mimeTypesCount);
40 var
expected = [
"audio/mpegurl",
"audio/x-mpegurl"];
42 for (var
i in expected) {
44 mimeTypes.some(
function(a) {
return a == expected[
i]}),
45 "Could not find support for mimetype " + expected[i]);
48 for (var
i in mimeTypes) {
50 expected.some(
function(a) {
return a == mimeTypes[
i]}),
51 "Found unexpected support for mimetype " + mimeTypes[i]);
56 var exts = manager.supportedFileExtensions(extCount);
61 exts.some(
function(a) {
return a == expected[
i]}),
62 "Could not find support for mimetype " + expected[i]);
67 expected.some(
function(a) {
return a == exts[
i]}),
68 "Found unexpected support for extension " + exts[i]);
72 var
ioService =
Cc[
"@mozilla.org/network/io-service;1"]
73 .getService(
Ci.nsIIOService);
74 var temporaryFileService =
75 Cc[
"@songbirdnest.com/Songbird/TemporaryFileService;1"]
76 .getService(
Ci.sbITemporaryFileService);
77 var testDir = temporaryFileService.createFile(
Ci.nsIFile.DIRECTORY_TYPE);
81 var item1File = testDir.clone();
82 item1File.append(
"item1.mp3");
83 var item1 = library.createMediaItem(ioService.newFileURI(item1File));
84 testMediaList.add(item1);
86 var item2File = testDir.clone();
87 item2File.append(
"item2Dir");
88 item2File.append(
"item2.mp3");
89 var item2 = library.createMediaItem(ioService.newFileURI(item2File));
90 testMediaList.add(item2);
93 var playlistFile1 = testDir.clone();
94 playlistFile1.append(
"playlist1.m3u");
95 manager.write(playlistFile1, testMediaList,
null);
99 var playlistFile2 = testDir.clone();
100 playlistFile2.append(
"playlist2");
101 manager.write(playlistFile2, testMediaList,
"audio/mpegurl");
106 var ioService =
Cc[
"@mozilla.org/network/io-service;1"].
108 return ioService.newFileURI(aFile);
function assertTrue(aTest, aMessage)
getService(Ci.sbIFaceplateManager)
function getFile(fileName)
function assertFilesEqual(aFile1, aFile2, aMessage)
function createLibrary(databaseGuid, databaseLocation)
_getSelectedPageStyle s i