From 836f7732eb37e4547c2500870dcf7f1b0588bf8f Mon Sep 17 00:00:00 2001 From: Yoshi Huang Date: Wed, 30 Sep 2015 18:14:12 -0700 Subject: [PATCH] Bug 1210459: Add originAttributes for tests that implement nsILoadContext. r=bholley --- dom/apps/AppsUtils.jsm | 4 ++++ dom/apps/Webapps.jsm | 4 ++++ extensions/cookie/test/channel_utils.js | 4 ++++ netwerk/test/unit/test_bug826063.js | 1 + netwerk/test/unit/test_cacheflags.js | 1 + toolkit/mozapps/downloads/DownloadLastDir.jsm | 3 ++- 6 files changed, 16 insertions(+), 1 deletion(-) diff --git a/dom/apps/AppsUtils.jsm b/dom/apps/AppsUtils.jsm index 722555d80dce..23a2a070d890 100644 --- a/dom/apps/AppsUtils.jsm +++ b/dom/apps/AppsUtils.jsm @@ -151,6 +151,10 @@ this.AppsUtils = { topWindow : null, appId: aAppId, isInBrowserElement: aIsBrowser, + originAttributes: { + appId: aAppId, + inBrowser: aIsBrowser + }, usePrivateBrowsing: false, isContent: false, diff --git a/dom/apps/Webapps.jsm b/dom/apps/Webapps.jsm index 7a05801ae794..e244d0ad72dd 100644 --- a/dom/apps/Webapps.jsm +++ b/dom/apps/Webapps.jsm @@ -3468,6 +3468,10 @@ this.DOMApplicationRegistry = { // nsILoadContext appId: aOldApp.installerAppId, isInBrowserElement: aOldApp.installerIsBrowser, + originAttributes: { + appId: aOldApp.installerAppId, + inBrowser: aOldApp.installerIsBrowser + }, usePrivateBrowsing: false, isContent: false, associatedWindow: null, diff --git a/extensions/cookie/test/channel_utils.js b/extensions/cookie/test/channel_utils.js index 4f97e4df946c..595abee8b970 100644 --- a/extensions/cookie/test/channel_utils.js +++ b/extensions/cookie/test/channel_utils.js @@ -171,6 +171,10 @@ function LoadContextCallback(appId, inBrowserElement, isPrivate, isContent) { this.isInBrowserElement = inBrowserElement; this.usePrivateBrowsing = isPrivate; this.isContent = isContent; + this.originAttributes = { + appId: appId, + inBrowser: inBrowserElement + }; } LoadContextCallback.prototype = { diff --git a/netwerk/test/unit/test_bug826063.js b/netwerk/test/unit/test_bug826063.js index 5abee9fba1ff..ec886a09b42a 100644 --- a/netwerk/test/unit/test_bug826063.js +++ b/netwerk/test/unit/test_bug826063.js @@ -19,6 +19,7 @@ function LoadContext(usePrivateBrowsing) { this.usePrivateBrowsing = usePrivateBrowsing; } LoadContext.prototype = { + originAttributes: {}, QueryInterface: XPCOMUtils.generateQI([Ci.nsILoadContext, Ci.nsIInterfaceRequestor]), getInterface: XPCOMUtils.generateQI([Ci.nsILoadContext]) }; diff --git a/netwerk/test/unit/test_cacheflags.js b/netwerk/test/unit/test_cacheflags.js index 050546edea80..84e9362a1511 100644 --- a/netwerk/test/unit/test_cacheflags.js +++ b/netwerk/test/unit/test_cacheflags.js @@ -20,6 +20,7 @@ function LoadContext(usePrivateBrowsing) { } LoadContext.prototype = { + originAttributes: {}, usePrivateBrowsing: false, // don't bother defining rest of nsILoadContext fields: don't need 'em diff --git a/toolkit/mozapps/downloads/DownloadLastDir.jsm b/toolkit/mozapps/downloads/DownloadLastDir.jsm index 0d7af5130b65..a053710f8d8b 100644 --- a/toolkit/mozapps/downloads/DownloadLastDir.jsm +++ b/toolkit/mozapps/downloads/DownloadLastDir.jsm @@ -97,7 +97,8 @@ this.DownloadLastDir = function DownloadLastDir(aWindow) { // load context isn't of interest to the content pref service. this.fakeContext = { QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsILoadContext]), - usePrivateBrowsing: loadContext.usePrivateBrowsing + usePrivateBrowsing: loadContext.usePrivateBrowsing, + originAttributes: {}, }; }