From c24b07dfb13f2b4e5262e26549f2276687038888 Mon Sep 17 00:00:00 2001 From: Peter Van der Beken Date: Fri, 30 Mar 2012 09:53:50 -0700 Subject: [PATCH] Backout cfd6bf0fe1e9 as it includes an unwanted chunk --HG-- extra : rebase_source : 9143a7752d7327a1c7693f9ad34ab02a25339aa6 --- content/base/test/test_bug383430.html | 2 +- content/base/test/test_bug393968.html | 3 ++- content/base/test/test_bug397234.html | 3 ++- content/base/test/test_bug413974.html | 3 ++- content/base/test/test_bug422537.html | 2 +- content/base/test/test_bug431701.html | 3 ++- content/base/test/test_bug475156.html | 3 ++- content/base/test/test_xhr_forbidden_headers.html | 6 +++--- 8 files changed, 15 insertions(+), 10 deletions(-) diff --git a/content/base/test/test_bug383430.html b/content/base/test/test_bug383430.html index 7ce997175233..e855f7ffe56f 100644 --- a/content/base/test/test_bug383430.html +++ b/content/base/test/test_bug383430.html @@ -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"); diff --git a/content/base/test/test_bug393968.html b/content/base/test/test_bug393968.html index cbc49b6e7fcb..57038b9fb400 100644 --- a/content/base/test/test_bug393968.html +++ b/content/base/test/test_bug393968.html @@ -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", diff --git a/content/base/test/test_bug397234.html b/content/base/test/test_bug397234.html index 8893e17d3259..ab122eb6dc39 100644 --- a/content/base/test/test_bug397234.html +++ b/content/base/test/test_bug397234.html @@ -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'", diff --git a/content/base/test/test_bug413974.html b/content/base/test/test_bug413974.html index d03eb08b5cef..b1431808984f 100644 --- a/content/base/test/test_bug413974.html +++ b/content/base/test/test_bug413974.html @@ -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", diff --git a/content/base/test/test_bug422537.html b/content/base/test/test_bug422537.html index 7e625adf8999..c4411c2de1a6 100644 --- a/content/base/test/test_bug422537.html +++ b/content/base/test/test_bug422537.html @@ -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; diff --git a/content/base/test/test_bug431701.html b/content/base/test/test_bug431701.html index bc99acd20f5a..16ad7805f8f3 100644 --- a/content/base/test/test_bug431701.html +++ b/content/base/test/test_bug431701.html @@ -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(); diff --git a/content/base/test/test_bug475156.html b/content/base/test/test_bug475156.html index 3184b55dc73a..04a1b7e84826 100644 --- a/content/base/test/test_bug475156.html +++ b/content/base/test/test_bug475156.html @@ -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(); } diff --git a/content/base/test/test_xhr_forbidden_headers.html b/content/base/test/test_xhr_forbidden_headers.html index 5f66dd18f6ae..c4cb6f4a788a 100644 --- a/content/base/test/test_xhr_forbidden_headers.html +++ b/content/base/test/test_xhr_forbidden_headers.html @@ -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");