summaryrefslogtreecommitdiffstats
path: root/toolkit/mozapps/extensions/test/browser/browser_openDialog.js
diff options
context:
space:
mode:
Diffstat (limited to 'toolkit/mozapps/extensions/test/browser/browser_openDialog.js')
-rw-r--r--toolkit/mozapps/extensions/test/browser/browser_openDialog.js21
1 files changed, 12 insertions, 9 deletions
diff --git a/toolkit/mozapps/extensions/test/browser/browser_openDialog.js b/toolkit/mozapps/extensions/test/browser/browser_openDialog.js
index f95365a4c..bdbe9caee 100644
--- a/toolkit/mozapps/extensions/test/browser/browser_openDialog.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_openDialog.js
@@ -5,7 +5,7 @@
// Tests the dialog open by the Options button for addons that provide a
// custom chrome-like protocol for optionsURL.
-var CustomChromeProtocol = {
+let CustomChromeProtocol = {
scheme: "khrome",
defaultPort: -1,
protocolFlags: Ci.nsIProtocolHandler.URI_DANGEROUS_TO_LOAD |
@@ -20,17 +20,20 @@ var CustomChromeProtocol = {
return uri;
},
- newChannel2: function CCP_newChannel2(aURI, aLoadInfo) {
- let url = Services.io.newURI("chrome:" + aURI.path, null, null);
- let ch = Services.io.newChannelFromURIWithLoadInfo(url, aLoadInfo);
+ newChannel: function CCP_newChannel(aURI) {
+ let url = "chrome:" + aURI.path;
+ let ch = NetUtil.newChannel2(url,
+ null,
+ null,
+ null, // aLoadingNode
+ Services.scriptSecurityManager.getSystemPrincipal(),
+ null, // aTriggeringPrincipal
+ Ci.nsILoadInfo.SEC_NORMAL,
+ Ci.nsIContentPolicy.TYPE_OTHER);
ch.originalURI = aURI;
return ch;
},
- newChannel: function CCP_newChannel(aURI) {
- return this.newChannel2(aURI, null);
- },
-
allowPort: function CCP_allowPort(aPort, aScheme) {
return false;
},
@@ -83,7 +86,7 @@ function test() {
info("Registering custom chrome-like protocol.");
CustomChromeProtocol.factory.register();
- registerCleanupFunction(() => CustomChromeProtocol.factory.unregister());
+ registerCleanupFunction(function () CustomChromeProtocol.factory.unregister());
const ADDONS_LIST = [
{ id: "test1@tests.mozilla.org",