53 gFiles[
"MP3_NoTags.mp3"] = {};
62 gFiles[
"MP3_ID3v1_Shift_JIS.mp3"] = {};
63 gFiles[
"MP3_ID3v1_Shift_JIS.mp3"][SBProperties.artistName] =
"\u7406\u591A";
64 gFiles[
"MP3_ID3v1_Shift_JIS.mp3"][SBProperties.albumName] =
"Monologue -\u3082\u306E\u308D\u3049\u3050-";
81 var
gTestMediaItems = Components.classes[
"@songbirdnest.com/moz/xpcom/threadsafe-array;1"]
82 .createInstance(Components.interfaces.nsIMutableArray);
92 var unicodeFile = testFolder.clone();
93 unicodeFile.append(
"MP3_ID3v23.mp3");
94 unicodeFile =
getCopyOfFile(unicodeFile,
"\u2606\u2606\u2606\u2606\u2606\u2606.mp3", testFolder);
97 gServer =
Cc[
"@mozilla.org/server/jshttp;1"]
98 .createInstance(
Ci.nsIHttpServer);
102 gServer.registerDirectory(
"/", testFolder.clone());
104 for (var fileName in
gFiles) {
105 log(
"MetadataJob_Reading: enqueueing file " + fileName);
110 var localPath = testFolder.clone();
111 localPath.append(fileName);
116 var localPathMI = gTestLibrary.createMediaItem( localPathURI,
null,
true );
119 gTestMediaItems.appendElement( localPathMI,
false );
124 var remotePathMI = gTestLibrary.createMediaItem( remotePathURI );
127 gTestMediaItems.appendElement( remotePathMI,
false );
132 .getService(Components.interfaces.sbIFileMetadataService);
135 if (job.status == Components.interfaces.sbIJobProgress.STATUS_SUCCEEDED) {
145 if (job.status == Components.interfaces.sbIJobProgress.STATUS_RUNNING) {
162 var expectedProperties =
gFiles[fileName];
163 var localProperties =
165 var remoteProperties =
168 log(
"\n\n--------------------------------------------------------------");
169 log(
"MetadataJob_Reading: results for " + fileName);
170 log(
"Expected properties: " + expectedProperties.toSource());
171 log(
"\nLocal properties: " + localProperties.toSource());
172 log(
"\nRemote properties: " + remoteProperties.toSource());
178 var expectedProperties =
gFiles[fileName];
180 log(
"MetadataJob_Reading: comparing local properties for " + fileName);
186 log(
"MetadataJob_Reading: comparing remote properties for " + fileName);
function sleep(ms, suppressOutput)
function newAppRelativeFile(path)
function assertNotEqual(aExpected, aActual, aMessage)
function assertTrue(aTest, aMessage)
function newFileURI(file)
function newURI(aURLString)
function getCopyOfFolder(folder, tempName)
Copy the given folder to tempName, returning an nsIFile for the new location.
function getTestServerPortNumber()
_getSelectedPageStyle s i