From 6070bcee96a07fa79c5e9ece15d8797fba4e3a05 Mon Sep 17 00:00:00 2001 From: Ben Delevingne Date: Fri, 23 Oct 2020 11:04:29 +0000 Subject: [PATCH] Bug 1672220 - remove defer from browser_dbg_listtabs-01. r=Honza Differential Revision: https://phabricator.services.mozilla.com/D94130 --- .../shared/test/browser_dbg_listtabs-01.js | 38 +++++++++---------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/devtools/client/shared/test/browser_dbg_listtabs-01.js b/devtools/client/shared/test/browser_dbg_listtabs-01.js index 86508265e18d..73bb2de611c8 100644 --- a/devtools/client/shared/test/browser_dbg_listtabs-01.js +++ b/devtools/client/shared/test/browser_dbg_listtabs-01.js @@ -73,28 +73,26 @@ function testRemoveTab() { function testAttachRemovedTab() { return removeTab(gTab2).then(() => { - const deferred = promise.defer(); + return new Promise((resolve, reject) => { + gClient.on("paused", () => { + ok( + false, + "Attaching to an exited target actor shouldn't generate a pause." + ); + reject(); + }); - gClient.on("paused", () => { - ok( - false, - "Attaching to an exited target actor shouldn't generate a pause." - ); - deferred.reject(); + const { actorID } = gTab2Front; + gTab2Front.reconfigure({}).then(null, error => { + ok( + error.message.includes( + `Connection closed, pending request to ${actorID}, type reconfigure failed` + ), + "Actor is gone since the tab was removed." + ); + resolve(); + }); }); - - const { actorID } = gTab2Front; - gTab2Front.reconfigure({}).then(null, error => { - ok( - error.message.includes( - `Connection closed, pending request to ${actorID}, type reconfigure failed` - ), - "Actor is gone since the tab was removed." - ); - deferred.resolve(); - }); - - return deferred.promise; }); }