Bug 1291399 remove references to getExtensionUUID, r?aswan
MozReview-Commit-ID: BMJSjCbk6iU
--- a/devtools/client/debugger/test/mochitest/browser_dbg_sources-webext-contentscript.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_sources-webext-contentscript.js
@@ -5,17 +5,17 @@
/**
* Make sure eval scripts appear in the source list
*/
const ADDON_PATH = "addon-webext-contentscript.xpi";
const TAB_URL = EXAMPLE_URL + "doc_script_webext_contentscript.html";
-let {getExtensionUUID} = Cu.import("resource://gre/modules/Extension.jsm", {});
+const {WebExtensionPolicy} = Cu.getGlobalForObject(Cu.import("resource://gre/modules/Extension.jsm", {}));
function test() {
let gPanel, gDebugger;
let gSources, gAddon;
let cleanup = function* (e) {
if (gAddon) {
// Remove the addon, if any.
@@ -27,20 +27,20 @@ function test() {
} else {
// If no debugger panel was opened, call finish directly.
finish();
}
};
return Task.spawn(function* () {
gAddon = yield addTemporaryAddon(ADDON_PATH);
- let uuid = getExtensionUUID(gAddon.id);
+ let {mozExtensionHostname} = WebExtensionPolicy.getByID(gAddon.id);
let options = {
- source: `moz-extension://${uuid}/webext-content-script.js`,
+ source: `moz-extension://${mozExtensionHostname}/webext-content-script.js`,
line: 1
};
[,, gPanel] = yield initDebugger(TAB_URL, options);
gDebugger = gPanel.panelWin;
gSources = gDebugger.DebuggerView.Sources;
is(gSources.values.length, 2, "Should have 2 sources");
--- a/toolkit/components/extensions/Extension.jsm
+++ b/toolkit/components/extensions/Extension.jsm
@@ -216,23 +216,16 @@ var UUIDMap = {
remove(id) {
let map = this._read();
delete map[id];
this._write(map);
},
};
-// This is the old interface that UUIDMap replaced, to be removed when
-// the references listed in bug 1291399 are updated.
-/* exported getExtensionUUID */
-function getExtensionUUID(id) {
- return UUIDMap.get(id, true);
-}
-
// For extensions that have called setUninstallURL(), send an event
// so the browser can display the URL.
var UninstallObserver = {
initialized: false,
init() {
if (!this.initialized) {
AddonManager.addAddonListener(this);