From fc85aebec87a77b4126cc29e6da9ff0fb447e336 Mon Sep 17 00:00:00 2001 From: Alexandre Poirot Date: Tue, 3 Nov 2015 13:35:12 -0800 Subject: [PATCH] Bug 1198877 - Enable mulet's support in webapps actors. r=jryans --- devtools/server/actors/webapps.js | 11 +++++++---- devtools/shared/apps/tests/unit/head_apps.js | 4 ++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/devtools/server/actors/webapps.js b/devtools/server/actors/webapps.js index 95b5c5f7e26..92c58d12436 100644 --- a/devtools/server/actors/webapps.js +++ b/devtools/server/actors/webapps.js @@ -230,6 +230,12 @@ function WebappsActor(aConnection) { WebappsActor.prototype = { actorPrefix: "webapps", + // For now, launch and close requests are only supported on B2G products + // like devices, mulet/simulators, graphene and b2gdroid. + // We set that attribute on the prototype in order to allow test + // to enable this feature. + supportsLaunch: require("devtools/shared/system").constants.MOZ_B2G, + disconnect: function () { try { this.unwatchApps(); @@ -873,10 +879,7 @@ WebappsActor.prototype = { let deferred = promise.defer(); - if (Services.appinfo.ID && - Services.appinfo.ID != "{3c2e2abc-06d4-11e1-ac3b-374f68613e61}" && - Services.appinfo.ID != "{d1bfe7d9-c01e-4237-998b-7b5f960a4314}" && - Services.appinfo.ID != "{f7b06d8d-139c-459a-85fa-46bc6c52e2b7}") { + if (!this.supportsLaunch) { return { error: "notSupported", message: "Not B2G. Can't launch app." }; } diff --git a/devtools/shared/apps/tests/unit/head_apps.js b/devtools/shared/apps/tests/unit/head_apps.js index 33422217e95..f24cc8bd0d5 100644 --- a/devtools/shared/apps/tests/unit/head_apps.js +++ b/devtools/shared/apps/tests/unit/head_apps.js @@ -90,6 +90,10 @@ function setup() { WebappOSUtils.getPackagePath = function(aApp) { return aApp.basePath + "/" + aApp.id; } + + // Enable launch/close method of the webapps actor + let {WebappsActor} = require("devtools/server/actors/webapps"); + WebappsActor.prototype.supportsLaunch = true; } function do_get_webappsdir() {