37 var
ww =
Cc[
"@mozilla.org/embedcomp/window-watcher;1"]
38 .getService(
Ci.nsIWindowWatcher);
41 testWindow.addEventListener(
"load",
function() {
42 continueFunction.apply(
this);
50 log(
"--------------------------------------------------------------------------------");
51 log(
"*********************** Setting All Access for RemoteAPI ***********************");
52 log(
"--------------------------------------------------------------------------------");
54 setRapiPref(
"playback_control_disable",
false);
55 setRapiPref(
"playback_read_disable",
false);
56 setRapiPref(
"library_read_disable",
false);
57 setRapiPref(
"library_write_disable",
false);
62 log(
"--------------------------------------------------------------------------------");
63 log(
"*********************** Setting No Access for RemoteAPI ************************");
64 log(
"--------------------------------------------------------------------------------");
66 setRapiPref(
"playback_control_disable",
true);
67 setRapiPref(
"playback_read_disable",
true);
68 setRapiPref(
"library_read_disable",
true);
69 setRapiPref(
"library_write_disable",
true);
74 log(
"--------------------------------------------------------------------------------");
75 log(
"******************** Setting Default Access for RemoteAPI **********************");
76 log(
"--------------------------------------------------------------------------------");
78 setRapiPref(
"playback_control_disable",
false);
79 setRapiPref(
"playback_read_disable",
false);
80 setRapiPref(
"library_read_disable",
true);
81 setRapiPref(
"library_write_disable",
true);
86 .getService(
Ci.sbILibraryManager);
87 libraryManager.mainLibrary.clear();
91 setRapiPref(
"promptForApproval",
true);
119 fn.apply(
this, parameters);
143 setRapiPref(
"promptForApproval",
false);
148 .createInstance(
Ci.nsIHttpServer);
152 var
url =
"data:application/vnd.mozilla.xul+xml," +
153 "<?xml-stylesheet href='chrome://global/skin' type='text/css'?>" +
154 "<?xml-stylesheet href='chrome://songbird/content/bindings/bindings.css' type='text/css'?>" +
155 "<window xmlns='http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul'/>";
164 const XUL_NS =
"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
172 var url =
"http://127.0.0.1:" + port +
"/" + page +
"?" + Math.random();
192 var
file =
Cc[
"@mozilla.org/file/directory_service;1"]
193 .getService(
Ci.nsIProperties)
194 .get(
"resource:app",
Ci.nsIFile);
196 file.append(
"testharness");
197 file.append(
"remoteapi");
198 file.append(fileName);
209 function(aProgress, aRequest, aFlag, aStatus)
211 if(aFlag &
Ci.nsIWebProgressListener.STATE_STOP && aRequest.name ==
this._url) {
212 this._func.apply(scope);
217 function(aProgress, aRequest, aURI) {}
226 if (aIID.equals(
Ci.nsIWebProgressListener) ||
227 aIID.equals(
Ci.nsISupportsWeakReference) ||
228 aIID.equals(
Ci.nsISupports))
230 throw Cr.NS_NOINTERFACE;
234 var
prefs =
Cc[
"@mozilla.org/preferences-service;1"]
235 .getService(
Ci.nsIPrefService);
236 prefs = prefs.getBranch(
"songbird.rapi.");
function safeSetTimeout(closure, timeout)
function beginRemoteAPITest(page, continueFunction)
function endWindowTest(e)
function ContinuingWebProgressListener(url, func)
function setupBrowser(page, port, continueFunction)
function beginWindowTest(url, continueFunction)
function getFile(fileName)
function setDefaultAccess()
function endRemoteAPITest(e)
function getTestServerPortNumber()
function continueWindowTest(fn, parameters)