Bug 1438174 - Fix race during test shutdown in browser_browser_toolbox_debugger.js. r=jryans
The breakpoint is set in a function called every second.
We have to unregister it before test finishes, otherwise it gets randomly called during test shutdown.
MozReview-Commit-ID: IEHxnVjk1xW
--- a/devtools/client/framework/test/test_browser_toolbox_debugger.js
+++ b/devtools/client/framework/test/test_browser_toolbox_debugger.js
@@ -36,13 +36,18 @@ Task.spawn(function* () {
yield onPaused;
assertPausedLocation(dbg, "browser-toolbox-test.js", 2);
yield stepIn(dbg);
assertPausedLocation(dbg, "browser-toolbox-test.js", 3);
+ // Remove the breakpoint before resuming in order to prevent hitting the breakpoint
+ // again during test closing.
+ let source = findSource(dbg, "browser-toolbox-test.js");
+ yield removeBreakpoint(dbg, source.id, 2);
+
yield resume(dbg);
info("Close the browser toolbox");
toolbox.destroy();
});