Bug 1337516 - Fix the connect page when connecting to xpcshell tests. r=jryans
MozReview-Commit-ID: KHCfhwaBcXp
--- a/devtools/client/framework/connect/connect.js
+++ b/devtools/client/framework/connect/connect.js
@@ -74,35 +74,43 @@ var submit = Task.async(function* () {
});
/**
* Connection is ready. List actors and build buttons.
*/
var onConnectionReady = Task.async(function* ([aType, aTraits]) {
clearTimeout(gConnectionTimeout);
- let response = yield gClient.listAddons();
+ let addons = [];
+ try {
+ let response = yield gClient.listAddons();
+ if (!response.error && response.addons.length > 0) {
+ addons = response.addons;
+ }
+ } catch(e) {
+ // listAddons throws if the runtime doesn't support addons
+ }
let parent = document.getElementById("addonActors");
- if (!response.error && response.addons.length > 0) {
+ if (addons.length > 0) {
// Add one entry for each add-on.
- for (let addon of response.addons) {
+ for (let addon of addons) {
if (!addon.debuggable) {
continue;
}
buildAddonLink(addon, parent);
}
}
else {
// Hide the section when there are no add-ons
parent.previousElementSibling.remove();
parent.remove();
}
- response = yield gClient.listTabs();
+ let response = yield gClient.listTabs();
parent = document.getElementById("tabActors");
// Add Global Process debugging...
let globals = Cu.cloneInto(response, {});
delete globals.tabs;
delete globals.selected;
// ...only if there are appropriate actors (a 'from' property will always