test_remotemedialist_add2.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 var gWebLib;
41 var foobar;
43 var gPrefix = "http://localhost:" + gServerPort + "/";
44 
45 function runTest () {
46  setAllAccess();
47 
48  // have to do this here to avoid the security checks
49  gLibraryManager = Cc["@songbirdnest.com/Songbird/library/Manager;1"]
50  .getService(Ci.sbILibraryManager);
51  gLibraryManager.mainLibrary.clear();
52 
53  // get the web library - sigh
54  foobar = Cc["@mozilla.org/preferences-service;1"]
55  .getService(Ci.nsIPrefBranch2);
56 
57  var webListGUID = foobar.getComplexValue( "songbird.library.web",
58  Ci.nsISupportsString );
59  gWebLib = gLibraryManager.getLibrary(webListGUID);
60  gWebLib.clear();
61  var ioService = Cc["@mozilla.org/network/io-service;1"].
62  getService(Ci.nsIIOService);
63 
64  var item1URI = ioService.newURI(gPrefix + "test13.mp3", null, null);
65  var item2URI = ioService.newURI(gPrefix + "test14.mp3", null, null);
66  var item3URI = ioService.newURI(gPrefix + "test15.mp3", null, null);
67  var item4URI = ioService.newURI(gPrefix + "test16.mp3", null, null);
68 
69  gWebItem1 = gWebLib.createMediaItem(item1URI);
70  gWebItem2 = gWebLib.createMediaItem(item2URI);
71  gWebItem3 = gWebLib.createMediaItem(item3URI);
72  gWebItem4 = gWebLib.createMediaItem(item4URI);
73 
74  gWebItemGUID1 = gWebItem1.getProperty("http://songbirdnest.com/data/1.0#GUID");
75  gWebItemGUID2 = gWebItem1.getProperty("http://songbirdnest.com/data/1.0#GUID");
76  gWebItemGUID3 = gWebItem1.getProperty("http://songbirdnest.com/data/1.0#GUID");
77  gWebItemGUID4 = gWebItem1.getProperty("http://songbirdnest.com/data/1.0#GUID");
78 
79 
80  beginRemoteAPITest("test_remotemedialist_add2_page.html", startTesting);
81 }
82 
83 function startTesting() {
84 
85  testBrowserWindow.runPageTest(this);
86 }
87 
function beginRemoteAPITest(page, continueFunction)
const Cc
var gWebLib
Test file.
var ioService
getService(Ci.sbIFaceplateManager)
function setAllAccess()
var gLibraryManager
var testBrowserWindow
return null
Definition: FeedWriter.js:1143
const Ci
function startTesting()
function getTestServerPortNumber()
function runTest()
Advanced DataRemote unit tests.