test_asxhandler.js
Go to the documentation of this file.
1 /*
2 //
3 // BEGIN SONGBIRD GPL
4 //
5 // This file is part of the Songbird web player.
6 //
7 // Copyright(c) 2005-2008 POTI, Inc.
8 // http://songbirdnest.com
9 //
10 // This file may be licensed under the terms of of the
11 // GNU General Public License Version 2 (the "GPL").
12 //
13 // Software distributed under the License is distributed
14 // on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
15 // express or implied. See the GPL for the specific language
16 // governing rights and limitations.
17 //
18 // You should have received a copy of the GPL along with this
19 // program. If not, go to http://www.gnu.org/licenses/gpl.html
20 // or write to the Free Software Foundation, Inc.,
21 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 //
23 // END SONGBIRD GPL
24 //
25 */
26 
31 function runTest () {
32 
33  var library = createLibrary("test_playlistreader");
34 
35  var tests;
36  var platform = getPlatform();
37  if (platform == "Windows_NT") {
38  tests = [
39  {
40  originalURI: null,
41  file: "kqedradio.asx",
42  result: "kqedradio_result.xml"
43  },
44  ];
45  }
46  else {
47  tests = [];
48  }
49 
50  for (var i = 0; i < tests.length; i++) {
51  var t = tests[i];
52  log("testing file " + t.file);
53  library.clear();
54  var handler = Cc["@songbirdnest.com/Songbird/Playlist/Reader/ASX;1"]
55  .createInstance(Ci.sbIPlaylistReader);
56 
57  var file = getFile(t.file);
58  if (t.originalURI) {
59  handler.originalURI = newURI(t.originalURI);
60  }
61  handler.read(file, library, false);
62  assertMediaList(library, getFile(t.result));
63  }
64 
65 }
66 
const Cc
function getPlatform()
function log(s)
function runTest()
Test file.
function getFile(fileName)
var t
return null
Definition: FeedWriter.js:1143
function createLibrary(databaseGuid, databaseLocation)
Definition: test_load.js:151
function newURI(aURLString)
const Ci
function assertMediaList(aMediaList, aItemTestsFile, aPort)
_getSelectedPageStyle s i
GstMessage gpointer data sbGStreamerMessageHandler * handler
var file