зеркало из https://github.com/mozilla/gecko-dev.git
Backout cfd6bf0fe1e9 as it includes an unwanted chunk
--HG-- extra : rebase_source : 9143a7752d7327a1c7693f9ad34ab02a25339aa6
This commit is contained in:
Родитель
7517eb77e4
Коммит
c24b07dfb1
|
@ -25,7 +25,7 @@ req.mozBackgroundRequest = true;
|
|||
req.open("GET", window.location.href);
|
||||
req.send(null);
|
||||
|
||||
ok(SpecialPowers.wrap(req).channel.loadGroup == null, "loadGroup is null");
|
||||
ok(req.channel.loadGroup == null, "loadGroup is null");
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
|
|
|
@ -23,7 +23,8 @@ req.open("POST", window.location.href);
|
|||
req.setRequestHeader("Content-Type", "text/plain; charset=us-ascii; boundary=01234567890");
|
||||
req.send("Some text");
|
||||
|
||||
is(SpecialPowers.wrap(req).channel
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
is(req.channel
|
||||
.QueryInterface(Components.interfaces.nsIHttpChannel)
|
||||
.getRequestHeader("Content-Type"),
|
||||
"text/plain; charset=UTF-8; boundary=01234567890",
|
||||
|
|
|
@ -24,7 +24,8 @@ req.open("POST", window.location.href);
|
|||
req.setRequestHeader("Content-Type", "text/plain; charset='uTf-8'");
|
||||
req.send("Some text");
|
||||
|
||||
is(SpecialPowers.wrap(req).channel
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
is(req.channel
|
||||
.QueryInterface(Components.interfaces.nsIHttpChannel)
|
||||
.getRequestHeader("Content-Type"),
|
||||
"text/plain; charset='uTf-8'",
|
||||
|
|
|
@ -23,7 +23,8 @@ req.open("POST", window.location.href);
|
|||
req.setRequestHeader("Content-Type", "text/plain; boundary=01234567890");
|
||||
req.send("Some text");
|
||||
|
||||
is(SpecialPowers.wrap(req).channel
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
is(req.channel
|
||||
.QueryInterface(Components.interfaces.nsIHttpChannel)
|
||||
.getRequestHeader("Content-Type"),
|
||||
"text/plain; charset=UTF-8; boundary=01234567890",
|
||||
|
|
|
@ -36,7 +36,7 @@ for each (var i in body) {
|
|||
var xhr = new XMLHttpRequest();
|
||||
xhr.open("POST", url, true);
|
||||
xhr.send(i);
|
||||
var chan = SpecialPowers.wrap(xhr).channel;
|
||||
var chan = xhr.channel;
|
||||
if (!(chan instanceof Components.interfaces.nsIUploadChannel))
|
||||
throw "Must be an upload channel";
|
||||
var stream = chan.uploadStream;
|
||||
|
|
|
@ -98,7 +98,8 @@ addLoadEvent(function() {
|
|||
var xhr = new XMLHttpRequest();
|
||||
xhr.open("POST", document.location.href);
|
||||
xhr.send(createDoc());
|
||||
is(SpecialPowers.wrap(xhr).channel.QueryInterface(Components.interfaces.nsIHttpChannel)
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
is(xhr.channel.QueryInterface(Components.interfaces.nsIHttpChannel)
|
||||
.getRequestHeader("Content-Type"),
|
||||
"application/xml; charset=UTF-8", "Testing correct type on the wire");
|
||||
xhr.abort();
|
||||
|
|
|
@ -17,7 +17,8 @@ var path = "http://mochi.test:8888/tests/content/base/test/";
|
|||
|
||||
function fromCache(xhr)
|
||||
{
|
||||
var ch = SpecialPowers.wrap(xhr).channel.QueryInterface(Components.interfaces.nsICachingChannel);
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
var ch = xhr.channel.QueryInterface(Components.interfaces.nsICachingChannel);
|
||||
return ch.isFromCache();
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,8 @@ for (i = 0; i < headers.length; i++)
|
|||
request.setRequestHeader(headers[i], "test" + i);
|
||||
|
||||
// Read out headers
|
||||
var channel = SpecialPowers.wrap(request).channel.QueryInterface(Components.interfaces.nsIHttpChannel);
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
var channel = request.channel.QueryInterface(Components.interfaces.nsIHttpChannel);
|
||||
for (i = 0; i < headers.length; i++) {
|
||||
// Retrieving Content-Length will throw an exception
|
||||
var value = null;
|
||||
|
@ -68,14 +69,13 @@ for (i = 0; i < headers.length; i++) {
|
|||
}
|
||||
|
||||
// Try setting headers in privileged context
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
request = new XMLHttpRequest();
|
||||
request.open("GET", window.location.href);
|
||||
for (i = 0; i < headers.length; i++)
|
||||
request.setRequestHeader(headers[i], "test" + i);
|
||||
|
||||
// Read out headers
|
||||
var channel = SpecialPowers.wrap(request).channel.QueryInterface(Components.interfaces.nsIHttpChannel);
|
||||
var channel = request.channel.QueryInterface(Components.interfaces.nsIHttpChannel);
|
||||
for (i = 0; i < headers.length; i++) {
|
||||
var value = channel.getRequestHeader(headers[i]);
|
||||
is(value, "test" + i, "Setting " + headers[i] + " header in privileged context");
|
||||
|
|
Загрузка…
Ссылка в новой задаче