34 Components.utils.import(
"resource://gre/modules/XPCOMUtils.jsm");
42 testXML =
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
43 testXML +=
"<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n";
44 testXML +=
"<plist version=\"1.0\">\n";
46 testXML +=
" <key>Major Version</key><integer>1</integer>\n";
47 testXML +=
" <key>Minor Version</key><integer>1</integer>\n";
48 testXML +=
" <key>Application Version</key><string>8.1</string>\n";
49 testXML +=
" <key>Features</key><integer>5</integer>\n";
50 testXML +=
" <key>Show Content Ratings</key><true/>\n";
51 testXML +=
" <key>Music Folder</key><string>file://localhost/C:/Users/dbradley/Music/iTunes/iTunes%20Music/</string>\n";
52 testXML +=
" <key>Library Persistent ID</key><string>4901D1E2BA4B2D9B</string>\n";
53 testXML +=
" <key>Tracks</key>\n";
57 testXML +=
" <key>Track ID</key><integer>60</integer>\n";
58 testXML +=
" <key>Name</key><string>ESRB</string>\n";
59 testXML +=
" <key>Kind</key><string>QuickTime movie file</string>\n";
60 testXML +=
" <key>Size</key><integer>2306052</integer>\n";
61 testXML +=
" <key>Total Time</key><integer>6000</integer>\n";
62 testXML +=
" <key>Date Modified</key><date>2007-02-12T15:53:10Z</date>\n";
63 testXML +=
" <key>Date Added</key><date>2009-02-13T03:04:07Z</date>\n";
64 testXML +=
" <key>Artwork Count</key><integer>1</integer>\n";
65 testXML +=
" <key>Persistent ID</key><string>042FEFDD9488F280</string>\n";
66 testXML +=
" <key>Track Type</key><string>File</string>\n";
67 testXML +=
" <key>Has Video</key><true/>\n";
68 testXML +=
" <key>HD</key><false/>\n";
69 testXML +=
" <key>Movie</key><true/>\n";
70 testXML +=
" <key>Location</key><string>file://localhost/C:/Users/dbradley/Music/ESRB.mpg</string>\n";
71 testXML +=
" <key>File Folder Count</key><integer>-1</integer>\n";
72 testXML +=
" <key>Library Folder Count</key><integer>-1</integer>\n";
76 testXML +=
" <key>Track ID</key><integer>62</integer>\n";
77 testXML +=
" <key>Name</key><string>The Swarm</string>\n";
78 testXML +=
" <key>Artist</key><string>Noble Society</string>\n";
79 testXML +=
" <key>Album Artist</key><string>Various Artists</string>\n";
80 testXML +=
" <key>Album</key><string>The Swarm Riddim</string>\n";
81 testXML +=
" <key>Genre</key><string>Reggae</string>\n";
82 testXML +=
" <key>Kind</key><string>Purchased AAC audio file</string>\n";
83 testXML +=
" <key>Size</key><integer>8118815</integer>\n";
84 testXML +=
" <key>Total Time</key><integer>240160</integer>\n";
85 testXML +=
" <key>Disc Number</key><integer>1</integer>\n";
86 testXML +=
" <key>Disc Count</key><integer>1</integer>\n";
87 testXML +=
" <key>Track Number</key><integer>1</integer>\n";
88 testXML +=
" <key>Track Count</key><integer>13</integer>\n";
89 testXML +=
" <key>Year</key><integer>2007</integer>\n";
90 testXML +=
" <key>Date Modified</key><date>2008-01-29T08:58:06Z</date>\n";
91 testXML +=
" <key>Date Added</key><date>2009-02-13T03:33:07Z</date>\n";
92 testXML +=
" <key>Bit Rate</key><integer>256</integer>\n";;
93 testXML +=
" <key>Sample Rate</key><integer>44100</integer>\n";;
94 testXML +=
" <key>Release Date</key><date>2007-09-18T07:00:00Z</date>\n";
95 testXML +=
" <key>Compilation</key><true/>\n";
96 testXML +=
" <key>Artwork Count</key><integer>1</integer>\n";
97 testXML +=
" <key>Sort Album</key><string>Swarm Riddim</string>\n";
98 testXML +=
" <key>Sort Name</key><string>Swarm</string>\n";
99 testXML +=
" <key>Persistent ID</key><string>D948F4FD9537100C</string>\n";
100 testXML +=
" <key>Explicit</key><true/>\n";
101 testXML +=
" <key>Track Type</key><string>File</string>\n";
102 testXML +=
" <key>Purchased</key><true/>\n";
103 testXML +=
" <key>Location</key><string>file://localhost/C:/Users/dbradley/Music/01%20The%20Swarm.m4a</string>\n";
104 testXML +=
" <key>File Folder Count</key><integer>-1</integer>\n";
105 testXML +=
" <key>Library Folder Count</key><integer>-1</integer>\n";
109 testXML +=
" <key>Track ID</key><integer>80</integer>\n";
110 testXML +=
" <key>Name</key><string>Analog Girl</string>\n";
111 testXML +=
" <key>Artist</key><string>Guy Clark</string>\n";
112 testXML +=
" <key>Album Artist</key><string>Guy Clark</string>\n";
113 testXML +=
" <key>Album</key><string>Workbench Songs</string>\n";
114 testXML +=
" <key>Genre</key><string>2</string>\n";
115 testXML +=
" <key>Kind</key><string>MPEG audio file</string>\n";
116 testXML +=
" <key>Size</key><integer>2052686</integer>\n";
117 testXML +=
" <key>Total Time</key><integer>51095</integer>\n";
118 testXML +=
" <key>Year</key><integer>2006</integer>\n";
119 testXML +=
" <key>Date Modified</key><date>2009-02-13T03:29:16Z</date>\n";
120 testXML +=
" <key>Date Added</key><date>2009-02-13T03:33:08Z</date>\n";
121 testXML +=
" <key>Bit Rate</key><integer>320</integer>\n";
122 testXML +=
" <key>Sample Rate</key><integer>44100</integer>\n";
123 testXML +=
" <key>Persistent ID</key><string>D948F4FD95371018</string>\n";
124 testXML +=
" <key>Track Type</key><string>File</string>\n";
125 testXML +=
" <key>Location</key><string>file://localhost/C:/Users/dbradley/Music/Guy-Clark-Analog-Girl.mp3</string>\n";
126 testXML +=
" <key>File Folder Count</key><integer>-1</integer>\n";
127 testXML +=
" <key>Library Folder Count</key><integer>-1</integer>\n";
130 testXML +=
" <key>Playlists</key>\n";
133 testXML +=
" <key>Name</key><string>Library</string>\n";
134 testXML +=
" <key>Master</key><true/>\n";
135 testXML +=
" <key>Playlist ID</key><integer>126</integer>\n";
136 testXML +=
" <key>Playlist Persistent ID</key><string>4901D1E2BA4B2D9C</string>\n";
137 testXML +=
" <key>Visible</key><false/>\n";
138 testXML +=
" <key>All Items</key><true/>\n";
139 testXML +=
" <key>Playlist Items</key>\n";
142 testXML +=
" <key>Track ID</key><integer>80</integer>\n";
145 testXML +=
" <key>Track ID</key><integer>62</integer>\n";
148 testXML +=
" <key>Track ID</key><integer>60</integer>\n";
153 testXML +=
" <key>Name</key><string>Music</string>\n";
154 testXML +=
" <key>Playlist ID</key><integer>194</integer>\n";
155 testXML +=
" <key>Playlist Persistent ID</key><string>4901D1E2BA4B2DA6</string>\n";
156 testXML +=
" <key>Distinguished Kind</key><integer>4</integer>\n";
157 testXML +=
" <key>Music</key><true/>\n";
158 testXML +=
" <key>All Items</key><true/>\n";
159 testXML +=
" <key>Smart Info</key>\n";
161 testXML +=
" AQEAAwAAAAIAAAAZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n";
162 testXML +=
" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n";
165 testXML +=
" <key>Smart Criteria</key>\n";
167 testXML +=
" U0xzdAABAAEAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n";
168 testXML +=
" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n";
169 testXML +=
" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADwAAAQAAAAAAAAAAAAAAAAAAAAAAAAA\n";
170 testXML +=
" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABEAAAAAAABIbEAAAAAAAAAAAAAAAAAAAAB\n";
171 testXML +=
" AAAAAAABIbEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAA=\n";
173 testXML +=
" <key>Playlist Items</key>\n";
176 testXML +=
" <key>Track ID</key><integer>80</integer>\n";
179 testXML +=
" <key>Track ID</key><integer>62</integer>\n";
184 testXML +=
" <key>Name</key><string>Movies</string>\n";
185 testXML +=
" <key>Playlist ID</key><integer>229</integer>\n";
186 testXML +=
" <key>Playlist Persistent ID</key><string>4901D1E2BA4B2DA7</string>\n";
187 testXML +=
" <key>Distinguished Kind</key><integer>2</integer>\n";
188 testXML +=
" <key>Movies</key><true/>\n";
189 testXML +=
" <key>All Items</key><true/>\n";
190 testXML +=
" <key>Smart Info</key>\n";
192 testXML +=
" AQEAAwAAAAIAAAAZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n";
193 testXML +=
" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n";
196 testXML +=
" <key>Smart Criteria</key>\n";
198 testXML +=
" U0xzdAABAAEAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n";
199 testXML +=
" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n";
200 testXML +=
" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADwAAAgAAAAAAAAAAAAAAAAAAAAAAAAA\n";
201 testXML +=
" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABEAAAAAAAAgAYAAAAAAAAAAAAAAAAAAAAB\n";
202 testXML +=
" AAAAAAAAAAIAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAA=\n";
204 testXML +=
" <key>Playlist Items</key>\n";
207 testXML +=
" <key>Track ID</key><integer>60</integer>\n";
212 testXML +=
" <key>Name</key><string>TV Shows</string>\n";
213 testXML +=
" <key>Playlist ID</key><integer>233</integer>\n";
214 testXML +=
" <key>Playlist Persistent ID</key><string>4901D1E2BA4B2DA8</string>\n";
215 testXML +=
" <key>Distinguished Kind</key><integer>3</integer>\n";
216 testXML +=
" <key>TV Shows</key><true/>\n";
217 testXML +=
" <key>All Items</key><true/>\n";
218 testXML +=
" <key>Smart Info</key>\n";
220 testXML +=
" AQEAAwAAAAIAAAAZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n";
221 testXML +=
" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n";
224 testXML +=
" <key>Smart Criteria</key>\n";
226 testXML +=
" U0xzdAABAAEAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n";
227 testXML +=
" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n";
228 testXML +=
" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADwAAAgAAAAAAAAAAAAAAAAAAAAAAAAA\n";
229 testXML +=
" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABEAAAAAAAAgEQAAAAAAAAAAAAAAAAAAAAB\n";
230 testXML +=
" AAAAAAAAAEAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAA=\n";
234 testXML +=
" <key>Name</key><string>Podcasts</string>\n";
235 testXML +=
" <key>Playlist ID</key><integer>187</integer>\n";
236 testXML +=
" <key>Playlist Persistent ID</key><string>4901D1E2BA4B2DA5</string>\n";
237 testXML +=
" <key>Distinguished Kind</key><integer>10</integer>\n";
238 testXML +=
" <key>Podcasts</key><true/>\n";
239 testXML +=
" <key>All Items</key><true/>\n";
242 testXML +=
" <key>Name</key><string>Audiobooks</string>\n";
243 testXML +=
" <key>Playlist ID</key><integer>236</integer>\n";
244 testXML +=
" <key>Playlist Persistent ID</key><string>4901D1E2BA4B2DA9</string>\n";
245 testXML +=
" <key>Distinguished Kind</key><integer>5</integer>\n";
246 testXML +=
" <key>Audiobooks</key><true/>\n";
247 testXML +=
" <key>All Items</key><true/>\n";
248 testXML +=
" <key>Smart Info</key>\n";
250 testXML +=
" AQEAAwAAAAIAAAAZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n";
251 testXML +=
" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n";
254 testXML +=
" <key>Smart Criteria</key>\n";
256 testXML +=
" U0xzdAABAAEAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n";
257 testXML +=
" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n";
258 testXML +=
" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADwAAAgAAAAAAAAAAAAAAAAAAAAAAAAA\n";
259 testXML +=
" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABEAAAAAAAAgAwAAAAAAAAAAAAAAAAAAAAB\n";
260 testXML +=
" AAAAAAAAAAgAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAA=\n";
264 testXML +=
" <key>Name</key><string>iTunes DJ</string>\n";
265 testXML +=
" <key>Playlist ID</key><integer>184</integer>\n";
266 testXML +=
" <key>Playlist Persistent ID</key><string>4901D1E2BA4B2DA3</string>\n";
267 testXML +=
" <key>Distinguished Kind</key><integer>22</integer>\n";
268 testXML +=
" <key>Party Shuffle</key><true/>\n";
269 testXML +=
" <key>All Items</key><true/>\n";
272 testXML +=
" <key>Name</key><string>Genius</string>\n";
273 testXML +=
" <key>Playlist ID</key><integer>245</integer>\n";
274 testXML +=
" <key>Playlist Persistent ID</key><string>4901D1E2BA4B2DAC</string>\n";
275 testXML +=
" <key>Distinguished Kind</key><integer>26</integer>\n";
276 testXML +=
" <key>All Items</key><true/>\n";
279 testXML +=
" <key>Name</key><string>90's Music</string>\n";
280 testXML +=
" <key>Playlist ID</key><integer>162</integer>\n";
281 testXML +=
" <key>Playlist Persistent ID</key><string>4901D1E2BA4B2D9D</string>\n";
282 testXML +=
" <key>All Items</key><true/>\n";
283 testXML +=
" <key>Smart Info</key>\n";
285 testXML +=
" AQEAAwAAAAIAAAAZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n";
286 testXML +=
" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n";
289 testXML +=
" <key>Smart Criteria</key>\n";
291 testXML +=
" U0xzdAABAAEAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n";
292 testXML +=
" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n";
293 testXML +=
" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcAAAEAAAAAAAAAAAAAAAAAAAAAAAAA\n";
294 testXML +=
" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABEAAAAAAAAB8YAAAAAAAAAAAAAAAAAAAAB\n";
295 testXML +=
" AAAAAAAAB88AAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA5AgAAAQAA\n";
296 testXML +=
" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAB\n";
297 testXML +=
" AAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAA\n";
302 testXML +=
" <key>Name</key><string>Music Videos</string>\n";
303 testXML +=
" <key>Playlist ID</key><integer>181</integer>\n";
304 testXML +=
" <key>Playlist Persistent ID</key><string>4901D1E2BA4B2DA2</string>\n";
305 testXML +=
" <key>All Items</key><true/>\n";
306 testXML +=
" <key>Smart Info</key>\n";
308 testXML +=
" AQEAAwAAAAIAAAAZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n";
309 testXML +=
" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n";
312 testXML +=
" <key>Smart Criteria</key>\n";
314 testXML +=
" U0xzdAABAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n";
315 testXML +=
" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n";
316 testXML +=
" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADwAAAQAAAAAAAAAAAAAAAAAAAAAAAAA\n";
317 testXML +=
" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABEAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAB\n";
318 testXML +=
" AAAAAAAAACAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAA=\n";
322 testXML +=
" <key>Name</key><string>My Top Rated</string>\n";
323 testXML +=
" <key>Playlist ID</key><integer>165</integer>\n";
324 testXML +=
" <key>Playlist Persistent ID</key><string>4901D1E2BA4B2D9E</string>\n";
325 testXML +=
" <key>All Items</key><true/>\n";
326 testXML +=
" <key>Smart Info</key>\n";
328 testXML +=
" AQEAAwAAAAIAAAAZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n";
329 testXML +=
" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n";
332 testXML +=
" <key>Smart Criteria</key>\n";
334 testXML +=
" U0xzdAABAAEAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n";
335 testXML +=
" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n";
336 testXML +=
" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkAAAAQAAAAAAAAAAAAAAAAAAAAAAAA\n";
337 testXML +=
" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABEAAAAAAAAADwAAAAAAAAAAAAAAAAAAAAB\n";
338 testXML +=
" AAAAAAAAADwAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAA=\n";
342 testXML +=
" <key>Name</key><string>Recently Added</string>\n";
343 testXML +=
" <key>Playlist ID</key><integer>174</integer>\n";
344 testXML +=
" <key>Playlist Persistent ID</key><string>4901D1E2BA4B2DA1</string>\n";
345 testXML +=
" <key>All Items</key><true/>\n";
346 testXML +=
" <key>Smart Info</key>\n";
348 testXML +=
" AQEAAwAAAAIAAAAZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n";
349 testXML +=
" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n";
352 testXML +=
" <key>Smart Criteria</key>\n";
354 testXML +=
" U0xzdAABAAEAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n";
355 testXML +=
" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n";
356 testXML +=
" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAIAAAAAAAAAAAAAAAAAAAAAAAAA\n";
357 testXML +=
" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABELa4tri2uLa7//////////gAAAAAACTqA\n";
358 testXML +=
" La4tri2uLa4AAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA5AgAAAQAA\n";
359 testXML +=
" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAB\n";
360 testXML +=
" AAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAA\n";
363 testXML +=
" <key>Playlist Items</key>\n";
368 testXML +=
" <key>Name</key><string>Recently Played</string>\n";
369 testXML +=
" <key>Playlist ID</key><integer>171</integer>\n";
370 testXML +=
" <key>Playlist Persistent ID</key><string>4901D1E2BA4B2DA0</string>\n";
371 testXML +=
" <key>All Items</key><true/>\n";
372 testXML +=
" <key>Smart Info</key>\n";
374 testXML +=
" AQEAAwAAAAIAAAAZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n";
375 testXML +=
" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n";
378 testXML +=
" <key>Smart Criteria</key>\n";
380 testXML +=
" U0xzdAABAAEAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n";
381 testXML +=
" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n";
382 testXML +=
" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABcAAAIAAAAAAAAAAAAAAAAAAAAAAAAA\n";
383 testXML +=
" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABELa4tri2uLa7//////////gAAAAAACTqA\n";
384 testXML +=
" La4tri2uLa4AAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA5AgAAAQAA\n";
385 testXML +=
" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAB\n";
386 testXML +=
" AAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAA\n";
391 testXML +=
" <key>Name</key><string>Top 25 Most Played</string>\n";
392 testXML +=
" <key>Playlist ID</key><integer>168</integer>\n";
393 testXML +=
" <key>Playlist Persistent ID</key><string>4901D1E2BA4B2D9F</string>\n";
394 testXML +=
" <key>All Items</key><true/>\n";
395 testXML +=
" <key>Smart Info</key>\n";
397 testXML +=
" AQEBAwAAABkAAAAZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n";
398 testXML +=
" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n";
401 testXML +=
" <key>Smart Criteria</key>\n";
403 testXML +=
" U0xzdAABAAEAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n";
404 testXML +=
" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n";
405 testXML +=
" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADkCAAABAAAAAAAAAAAAAAAAAAAAAAAA\n";
406 testXML +=
" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAB\n";
407 testXML +=
" AAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWAAAAEAAA\n";
408 testXML +=
" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAA\n";
409 testXML +=
" AAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAA\n";
431 Cc[
"@mozilla.org/io/string-input-stream;1"]
432 .createInstance(
Ci.nsIStringInputStream);
433 stream.setData(aString, -1);
442 expectedTopLevelProperties : [
"Major Version",
444 "Application Version",
446 "Show Content Ratings",
448 "Library Persistent ID" ],
449 onTopLevelProperties :
function(aProperties) {
450 var length = this.expectedTopLevelProperties.length;
451 this.topLevelPropertyCount = 0;
452 for (var index =0; index < length; ++index) {
454 if (aProperties.get(
this.expectedTopLevelProperties[index]).length > 0) {
455 ++this.topLevelPropertyCount;
462 onTrack :
function(aProperties) {
465 onTracksComplete :
function() {
466 ++this.onTracksCompleteCount;
468 onPlaylist :
function(aProperties, tracks) {
469 ++this.onPlaylistCount;
471 onPlaylistsComplete :
function () {
472 ++this.onPlaylistsCompleteCount;
473 assertEqual(this.topLevelPropertyCount, 7,
"Top level properties do not match");
474 assertEqual(this.onTrackCount, 2,
"Invalid track count");
475 assertEqual(this.onTracksCompleteCount, 1,
"Invalid track complete count");
476 assertEqual(this.onPlaylistCount, 14,
"Invalid playlist count");
477 assertEqual(this.onPlaylistsCompleteCount, 1,
"Invalid playlist complete count");
478 assertEqual(this.onErrorCount, 0,
"Invalid error count");
481 onError :
function(aErrorMessage) {
483 fail(
"onError called on non-error test case");
485 onProgress :
function() { },
486 topLevelPropertyCount : 0,
488 onTracksCompleteCount : 0,
490 onPlaylistsCompleteCount : 0,
497 var parser =
Cc[
"@songbirdnest.com/Songbird/sbiTunesXMLParser;1"]
498 .getService(
Ci.sbIiTunesXMLParser);
499 assertTrue(parser,
"iTunes importer component is not available.");
502 parser =
Cc[
"@songbirdnest.com/Songbird/sbiTunesXMLParser;1"]
503 .getService(
Ci.sbIiTunesXMLParser);
504 assertTrue(parser,
"iTunes importer component is not available.");
sbOSDControlService prototype QueryInterface
function assertTrue(aTest, aMessage)
function assertEqual(aExpected, aActual, aMessage)
function stringToStream(aString)
function runTest()
Advanced DataRemote unit tests.