зеркало из https://github.com/mozilla/gecko-dev.git
Fix for bug 740397 (Make tests that try to get XHR.channel use SpecialPowers). r=bholley.
--HG-- extra : rebase_source : 0bd78094debfea9d179f17396626c3802a6b5a21
This commit is contained in:
Родитель
fa77ed1232
Коммит
0c7d3df11e
|
@ -32,8 +32,6 @@ function fail(evt)
|
|||
}
|
||||
|
||||
applicationCache.oncached = function() {
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
|
||||
// ok, we've successfully loaded from the initial cache.
|
||||
try {
|
||||
applicationCache.swapCache();
|
||||
|
@ -51,7 +49,7 @@ applicationCache.oncached = function() {
|
|||
// Make the obsoleting.sjs return 404 NOT FOUND code
|
||||
var req = new XMLHttpRequest();
|
||||
req.open("GET", "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/obsoletingManifest.sjs?state=");
|
||||
var channel = req.channel
|
||||
var channel = SpecialPowers.wrap(req).channel
|
||||
.QueryInterface(Components.interfaces.nsIApplicationCacheChannel);
|
||||
channel.chooseApplicationCache = false;
|
||||
channel.inheritApplicationCache = false;
|
||||
|
|
|
@ -326,8 +326,7 @@ setSJSState: function(sjsPath, stateQuery)
|
|||
var client = new XMLHttpRequest();
|
||||
client.open("GET", sjsPath + "?state=" + stateQuery, false);
|
||||
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
var appcachechannel = client.channel.QueryInterface(Ci.nsIApplicationCacheChannel);
|
||||
var appcachechannel = SpecialPowers.wrap(client).channel.QueryInterface(Ci.nsIApplicationCacheChannel);
|
||||
appcachechannel.chooseApplicationCache = false;
|
||||
appcachechannel.inheritApplicationCache = false;
|
||||
appcachechannel.applicationCache = null;
|
||||
|
|
|
@ -66,7 +66,7 @@ function onWindowLoad()
|
|||
try
|
||||
{
|
||||
req.open("GET", "https://www.bank1.com/", false);
|
||||
SpecialPowers.setPrivilegedProps(req, "channel.notificationCallbacks", certListener);
|
||||
SpecialPowers.wrap(req).channel.notificationCallbacks = certListener;
|
||||
req.send(null);
|
||||
}
|
||||
catch(ex)
|
||||
|
|
|
@ -49,8 +49,7 @@ function onWindowLoad()
|
|||
try
|
||||
{
|
||||
req.open("GET", "https://www.bank2.com/", false);
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
req.channel.notificationCallbacks = certListener;
|
||||
SpecialPowers.wrap(req).channel.notificationCallbacks = certListener;
|
||||
req.send(null);
|
||||
}
|
||||
catch(ex)
|
||||
|
|
|
@ -940,23 +940,6 @@ SpecialPowersAPI.prototype = {
|
|||
}
|
||||
return obj;
|
||||
},
|
||||
setPrivilegedProps: function(obj, props, val) {
|
||||
var parts = props.split('.');
|
||||
|
||||
if (parts.length == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (var i = 0; i < parts.length - 1; i++) {
|
||||
var p = parts[i];
|
||||
if (obj[p]) {
|
||||
obj = obj[p];
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
obj[parts[i]] = val;
|
||||
},
|
||||
|
||||
get focusManager() {
|
||||
if (this._fm != null)
|
||||
|
|
Загрузка…
Ссылка в новой задаче