From 8acd3141ecc88d94578a04c5c18a9d2a049d273d Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Wed, 3 Oct 2018 15:11:43 +0000 Subject: [PATCH] Bug 1493832 - marionette: cleanup dead code from server.js r=ato Differential Revision: https://phabricator.services.mozilla.com/D6732 --HG-- extra : moz-landing-system : lando --- testing/marionette/server.js | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/testing/marionette/server.js b/testing/marionette/server.js index 159e537aced5..bdc5da2a4b4d 100644 --- a/testing/marionette/server.js +++ b/testing/marionette/server.js @@ -184,9 +184,6 @@ class TCPConnection { this.driver = driverFactory(); this.driver.init(); - - // lookup of commands sent by server to client by message ID - this.commands_ = new Map(); } /** @@ -234,17 +231,13 @@ class TCPConnection { return; } - // look up previous command we received a response for - if (msg instanceof Response) { - let cmd = this.commands_.get(msg.id); - this.commands_.delete(msg.id); - cmd.onresponse(msg); - // execute new command - } else if (msg instanceof Command) { + if (msg instanceof Command) { (async () => { await this.execute(msg); })(); + } else { + logger.fatal("Cannot process messages other than Command"); } } @@ -357,11 +350,10 @@ class TCPConnection { */ send(msg) { msg.origin = Message.Origin.Server; - if (msg instanceof Command) { - this.commands_.set(msg.id, msg); - this.sendToEmulator(msg); - } else if (msg instanceof Response) { + if (msg instanceof Response) { this.sendToClient(msg); + } else { + logger.fatal("Cannot send messages other than Response"); } }