зеркало из https://github.com/mozilla/gecko-dev.git
Bug 713747 - Use UniversalXPConnect and UniversalXPConnect only in test coverage. r=bz
This commit is contained in:
Родитель
5e53978372
Коммит
8a890a3676
|
@ -23,7 +23,7 @@ SimpleTest.waitForExplicitFinish();
|
|||
addLoadEvent(function() {
|
||||
// Need privs because the feed seems to have an about:feeds principal or some
|
||||
// such. It's not same-origin with us in any case.
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
is($("testFrame").contentDocument.documentElement.id, "feedHandler",
|
||||
"Feed served as text/xml without a channel/link should have been sniffed");
|
||||
});
|
||||
|
|
|
@ -23,7 +23,7 @@ SimpleTest.waitForExplicitFinish();
|
|||
addLoadEvent(function() {
|
||||
// Need privs because the feed seems to have an about:feeds principal or some
|
||||
// such. It's not same-origin with us in any case.
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
is($("testFrame").contentDocument.documentElement.id, "",
|
||||
"Text got sniffed as a feed?");
|
||||
});
|
||||
|
|
|
@ -21,7 +21,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=494328
|
|||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
addLoadEvent(function() {
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
var links = $("testFrame").contentDocument.getElementById("feedContent").querySelectorAll("div.enclosure > a");
|
||||
is(links[0].textContent, "Episode 1", "filename decoded incorrectly");
|
||||
is(links[1].textContent, "Episode #2", "filename decoded incorrectly");
|
||||
|
|
|
@ -409,10 +409,7 @@ user_pref("extensions.getAddons.search.url", "http://%(server)s/extensions-dummy
|
|||
|
||||
if useServerLocations == False:
|
||||
part = """
|
||||
user_pref("capability.principal.codebase.p1.granted",
|
||||
"UniversalXPConnect UniversalBrowserRead UniversalBrowserWrite \
|
||||
UniversalPreferencesRead UniversalPreferencesWrite \
|
||||
UniversalFileRead");
|
||||
user_pref("capability.principal.codebase.p1.granted", "UniversalXPConnect");
|
||||
user_pref("capability.principal.codebase.p1.id", "%(origin)s");
|
||||
user_pref("capability.principal.codebase.p1.subjectName", "");
|
||||
""" % { "origin": "http://" + self.webServer + ":" + str(self.httpPort) }
|
||||
|
@ -422,10 +419,7 @@ user_pref("capability.principal.codebase.p1.subjectName", "");
|
|||
privileged = filter(lambda loc: "privileged" in loc.options, locations)
|
||||
for (i, l) in itertools.izip(itertools.count(1), privileged):
|
||||
part = """
|
||||
user_pref("capability.principal.codebase.p%(i)d.granted",
|
||||
"UniversalXPConnect UniversalBrowserRead UniversalBrowserWrite \
|
||||
UniversalPreferencesRead UniversalPreferencesWrite \
|
||||
UniversalFileRead");
|
||||
user_pref("capability.principal.codebase.p%(i)d.granted", "UniversalXPConnect");
|
||||
user_pref("capability.principal.codebase.p%(i)d.id", "%(origin)s");
|
||||
user_pref("capability.principal.codebase.p%(i)d.subjectName", "");
|
||||
""" % { "i": i,
|
||||
|
|
|
@ -62,7 +62,7 @@ function afterReload() {
|
|||
"password field value forgotten");
|
||||
is(iframeDoc.getElementById("hidden").value, "gecko",
|
||||
"hidden field value preserved");
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalFileRead");
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
is(iframeDoc.getElementById("file").value, filePath,
|
||||
"file field value preserved");
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
request.send(null);
|
||||
|
||||
// Try reading headers in privileged context
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect UniversalBrowserRead");
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
is(request.getResponseHeader("Set-Cookie"), "test", "Reading Set-Cookie response header in privileged context");
|
||||
is(request.getResponseHeader("Set-Cookie2"), "test2", "Reading Set-Cookie2 response header in privileged context");
|
||||
is(request.getResponseHeader("X-Dummy"), "test", "Reading X-Dummy response header in privileged context");
|
||||
|
|
|
@ -55,7 +55,7 @@ for (i = 0; i < headers.length; i++)
|
|||
request.setRequestHeader(headers[i], "test" + i);
|
||||
|
||||
// Read out headers
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect UniversalBrowserWrite");
|
||||
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
|
||||
|
|
|
@ -21024,7 +21024,7 @@ img.onload = wrapFunction(function ()
|
|||
ctx667.drawImage(img, 0, 25);
|
||||
// (The alpha values do not really survive float->int conversion, so just
|
||||
// do approximate comparisons)
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalBrowserRead');
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
|
||||
isPixel(ctx667, 12,40, 1,3,254,255, 0);
|
||||
isPixel(ctx667, 37,40, 8,252,248,191, 2);
|
||||
isPixel(ctx667, 62,40, 6,10,250,127, 4);
|
||||
|
@ -21151,7 +21151,7 @@ deferTest();
|
|||
img.onload = wrapFunction(function ()
|
||||
{
|
||||
ctx672.drawImage(img, 0, 0);
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalBrowserRead');
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
|
||||
isPixel(ctx672, 12,20, 255,255,0,255, 0);
|
||||
isPixel(ctx672, 50,20, 0,255,255,255, 0);
|
||||
isPixel(ctx672, 87,20, 0,0,255,255, 0);
|
||||
|
|
|
@ -36,7 +36,7 @@ function initVals() {
|
|||
}
|
||||
|
||||
function initControl1() {
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalFileRead");
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
$("i1").value = fullPath;
|
||||
is($("i1").value, fullPath, "Should have set full path 1");
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ var inputChange = 0;
|
|||
var textareaChange = 0;
|
||||
|
||||
function testUserInput() {
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalBrowserWrite');
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
|
||||
var input = document.getElementById("input");
|
||||
var textarea = document.getElementById("textarea");
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ function doNavigationIfReady() {
|
|||
}
|
||||
|
||||
function doNavigation() {
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserWrite");
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
|
||||
// Test clicking on an unmodified <a>.
|
||||
doNavigationTest(1, "a_href_helper_01.svg");
|
||||
|
|
|
@ -36,7 +36,7 @@ xmlDoc.addEventListener("load", documentLoaded, false);
|
|||
|
||||
function execute()
|
||||
{
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
xmlDoc.load("http://green/heikki/login/data.xml");
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script>
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect UniversalBrowserRead UniversalBrowserWrite");
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
window.opener.opener.postMessage(window.opener.testNum + " - " + window.x, "http://mochi.test:8888");
|
||||
window.opener.close();
|
||||
window.close();
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script>
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect UniversalBrowserRead UniversalBrowserWrite");
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
window.parent.opener.postMessage(window.parent.testNum + " - " + window.x, "http://mochi.test:8888");
|
||||
window.parent.close();
|
||||
</script>
|
||||
|
|
|
@ -42,7 +42,7 @@ function handleCmd(evt) {
|
|||
}
|
||||
|
||||
// Grab privileges so we can access cross-domain windows
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect UniversalBrowserRead UniversalBrowserWrite");
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
|
||||
if ("load" in cmd) {
|
||||
var testNum = cmd.load;
|
||||
|
|
|
@ -38,7 +38,7 @@ function setOrRestoreTabFocus(newValue) {
|
|||
|
||||
function snapShot(element) {
|
||||
var rect = element.getBoundingClientRect();
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalBrowserRead');
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
|
||||
var canvas = document.createElementNS("http://www.w3.org/1999/xhtml", "canvas");
|
||||
canvas.setAttribute("width", rect.width + 12);
|
||||
canvas.setAttribute("height", rect.height + 12);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
function postMsg(message)
|
||||
{
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
var l = parent.window.location;
|
||||
parent.postMessage(message, l.protocol + "//" + l.host);
|
||||
}
|
||||
|
|
|
@ -16,7 +16,6 @@ window.addEventListener("message", onMessageReceived, false);
|
|||
function onMessageReceived(event)
|
||||
{
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
|
||||
|
||||
switch (event.data)
|
||||
{
|
||||
|
|
|
@ -54,7 +54,7 @@ RemoteCanvas.prototype.reload = function(cb, force) {
|
|||
}
|
||||
|
||||
RemoteCanvas.prototype.handleEvent = function() {
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
|
||||
// Look back up the iframe by id
|
||||
var ldrFrame = document.getElementById("test-iframe");
|
||||
|
|
|
@ -59,7 +59,7 @@ RemoteCanvas.prototype.reload = function(cb, force) {
|
|||
}
|
||||
|
||||
RemoteCanvas.prototype.handleEvent = function() {
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
|
||||
// Look back up the iframe by id
|
||||
var ldrFrame = document.getElementById("test-iframe-" + this.url);
|
||||
|
|
|
@ -21,7 +21,7 @@ SimpleTest.waitForExplicitFinish();
|
|||
|
||||
function checkFirst()
|
||||
{
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
|
||||
var iframeelem = document.getElementById('test-iframe');
|
||||
var canvas = document.getElementById('canvas');
|
||||
|
|
|
@ -3,9 +3,9 @@ user_pref("browser.dom.window.dump.enabled", true);
|
|||
user_pref("browser.sessionstore.resume_from_crash", false);
|
||||
user_pref("browser.shell.checkDefaultBrowser", false);
|
||||
user_pref("browser.xul.error_pages.enabled", true);
|
||||
user_pref("capability.principal.codebase.p0.granted", "UniversalPreferencesWrite UniversalXPConnect UniversalBrowserWrite UniversalPreferencesRead UniversalBrowserRead");
|
||||
user_pref("capability.principal.codebase.p0.granted", "UniversalXPConnect");
|
||||
user_pref("capability.principal.codebase.p0.id", "file://");
|
||||
user_pref("capability.principal.codebase.p1.granted", "UniversalPreferencesWrite UniversalXPConnect UniversalBrowserWrite UniversalPreferencesRead UniversalBrowserRead");
|
||||
user_pref("capability.principal.codebase.p1.granted", "UniversalXPConnect");
|
||||
user_pref("capability.principal.codebase.p1.id", "http://localhost:4444");
|
||||
user_pref("security.fileuri.strict_origin_policy", false);
|
||||
user_pref("dom.allow_scripts_to_close_windows", true);
|
||||
|
|
|
@ -32,7 +32,7 @@ RemoteCanvas.prototype.remotePageLoaded = function(callback) {
|
|||
};
|
||||
|
||||
function bidiNumeral(val) {
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalPreferencesRead UniversalPreferencesWrite UniversalXPConnect');
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
|
||||
var prefs = Components.classes["@mozilla.org/preferences-service;1"]
|
||||
.getService(Components.interfaces.nsIPrefBranch);
|
||||
|
||||
|
|
|
@ -83,8 +83,7 @@ function refTest(test,ref) {
|
|||
var caretBlinkTime = null;
|
||||
function endTest() {
|
||||
SimpleTest.finish();
|
||||
netscape.security.PrivilegeManager.enablePrivilege(
|
||||
'UniversalPreferencesRead UniversalPreferencesWrite UniversalXPConnect');
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
|
||||
var prefs = Components.classes["@mozilla.org/preferences-service;1"]
|
||||
.getService(Components.interfaces.nsIPrefBranch);
|
||||
if (caretBlinkTime !== null) {
|
||||
|
@ -161,8 +160,7 @@ function runTests() {
|
|||
try {
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
netscape.security.PrivilegeManager.enablePrivilege(
|
||||
'UniversalPreferencesRead UniversalPreferencesWrite UniversalXPConnect');
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
|
||||
var prefs = Components.classes["@mozilla.org/preferences-service;1"]
|
||||
.getService(Components.interfaces.nsIPrefBranch);
|
||||
try {
|
||||
|
|
|
@ -32,7 +32,7 @@ if (document.getElementById('iframe'))
|
|||
doc = document.getElementById('iframe').contentDocument;
|
||||
|
||||
function toggleIframe(){
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect UniversalBrowserRead");
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
var x=document.getElementById('iframe');
|
||||
x.style.display = x.style.display == 'none' ? x.style.display = '' : x.style.display = 'none';
|
||||
setTimeout(toggleIframe,100);
|
||||
|
|
|
@ -313,8 +313,7 @@ function run()
|
|||
gTestingIndex = 0;
|
||||
}
|
||||
|
||||
netscape.security.PrivilegeManager.enablePrivilege(
|
||||
'UniversalPreferencesRead UniversalPreferencesWrite UniversalXPConnect');
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
|
||||
|
||||
var prefs = Components.classes["@mozilla.org/preferences-service;1"]
|
||||
.getService(Components.interfaces.nsIPrefBranch);
|
||||
|
@ -392,8 +391,7 @@ function onLoad()
|
|||
return;
|
||||
}
|
||||
|
||||
netscape.security.PrivilegeManager.enablePrivilege(
|
||||
'UniversalPreferencesRead UniversalPreferencesWrite UniversalXPConnect');
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
|
||||
|
||||
var prefs = Components.classes["@mozilla.org/preferences-service;1"]
|
||||
.getService(Components.interfaces.nsIPrefBranch);
|
||||
|
@ -416,8 +414,7 @@ function onLoad()
|
|||
|
||||
function cleanup()
|
||||
{
|
||||
netscape.security.PrivilegeManager.enablePrivilege(
|
||||
'UniversalPreferencesRead UniversalPreferencesWrite UniversalXPConnect');
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
|
||||
|
||||
var prefs = Components.classes["@mozilla.org/preferences-service;1"]
|
||||
.getService(Components.interfaces.nsIPrefBranch);
|
||||
|
|
|
@ -349,7 +349,7 @@ user_pref("reftest.uri", "%s");
|
|||
#workaround for jsreftests.
|
||||
if options.enablePrivilege:
|
||||
fhandle.write("""
|
||||
user_pref("capability.principal.codebase.p2.granted", "UniversalPreferencesWrite UniversalXPConnect UniversalBrowserWrite UniversalPreferencesRead UniversalBrowserRead");
|
||||
user_pref("capability.principal.codebase.p2.granted", "UniversalXPConnect");
|
||||
user_pref("capability.principal.codebase.p2.id", "http://%s:%s");
|
||||
""" % (options.remoteWebServer, options.httpPort))
|
||||
|
||||
|
|
|
@ -221,7 +221,7 @@ class PermissionsManager(object):
|
|||
prefs = []
|
||||
privileged = filter(lambda loc: "privileged" in loc.options, self._locations)
|
||||
for (i, l) in itertools.izip(itertools.count(1), privileged):
|
||||
prefs.append(("capability.principal.codebase.p%s.granted" % i, "UniversalPreferencesWrite UniversalXPConnect UniversalPreferencesRead"))
|
||||
prefs.append(("capability.principal.codebase.p%s.granted" % i, "UniversalXPConnect"))
|
||||
|
||||
# TODO: do we need the port?
|
||||
prefs.append(("capability.principal.codebase.p%s.id" % i, l.scheme + "://" + l.host))
|
||||
|
|
|
@ -51,7 +51,7 @@ function runTest()
|
|||
}
|
||||
|
||||
var expectedFocus = expected[step - 1];
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalBrowserWrite');
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
|
||||
var win = window.openDialog("dialog_dialogfocus.xul", "_new", "chrome,dialog", step);
|
||||
|
||||
function checkDialogFocus(event)
|
||||
|
|
Загрузка…
Ссылка в новой задаче