Bug 1096490 - Fix test failures in browser_devtools_api.js;r=vporof
authorEddy Bruël <ejpbruel@gmail.com>
Thu, 20 Nov 2014 05:31:06 +0100
changeset 216584 9986a68aa635ee7845a23cb4adb14d48d0edb013
parent 216583 46a5a5a5f9125fe67ca80e296380e78a4232c6ef
child 216585 88315012b6cc251a867c36941d5296a29b77ca83
push idunknown
push userunknown
push dateunknown
reviewersvporof
bugs1096490
milestone36.0a1
Bug 1096490 - Fix test failures in browser_devtools_api.js;r=vporof These test failures occur when you replace the deprecated-sync-thenables in protocol.js with Promise.jsm.
browser/devtools/framework/test/browser_devtools_api.js
--- a/browser/devtools/framework/test/browser_devtools_api.js
+++ b/browser/devtools/framework/test/browser_devtools_api.js
@@ -71,17 +71,20 @@ function runTests1(aTab) {
     is(toolbox.target, target, "toolbox target is correct");
     is(toolbox._host.hostTab, gBrowser.selectedTab, "toolbox host is correct");
 
     ok(events["init"], "init event fired");
     ok(events["ready"], "ready event fired");
 
     gDevTools.unregisterTool(toolId1);
 
-    runTests2();
+    // Wait for unregisterTool to select the next tool before calling runTests2,
+    // otherwise we will receive the wrong select event when waiting for
+    // unregisterTool to select the next tool in continueTests below.
+    toolbox.once("select", runTests2);
   });
 }
 
 // Test scenario 2: the tool definition build method returns panel instance.
 function runTests2() {
   let toolDefinition = {
     id: toolId2,
     isTargetSupported: function() true,