Bug 992275 - avoid racy check in breakpoints-button-01.js debugger test a=test-only
--- a/devtools/client/debugger/test/mochitest/browser_dbg_breakpoints-button-01.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_breakpoints-button-01.js
@@ -37,13 +37,15 @@ function test() {
yield waitForDispatch(gPanel, gDebugger.constants.REMOVE_BREAKPOINT, 3);
checkBreakpointsDisabled(true)
const finished = waitForDebuggerEvents(gPanel, gDebugger.EVENTS.BREAKPOINT_ADDED, 3);
gSources.toggleBreakpoints();
yield waitForDispatch(gPanel, gDebugger.constants.ADD_BREAKPOINT, 3);
checkBreakpointsDisabled(false);
- yield ensureThreadClientState(gPanel, "resumed");
+ if (gDebugger.gThreadClient.state !== "attached") {
+ yield waitForThreadEvents(gPanel, "resumed");
+ }
closeDebuggerAndFinish(gPanel)
});
});
}
--- a/devtools/client/debugger/test/mochitest/browser_dbg_breakpoints-button-02.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_breakpoints-button-02.js
@@ -29,32 +29,32 @@ function test() {
Task.spawn(function*() {
yield waitForSourceShown(gPanel, "-01.js");
yield promise.all([
actions.addBreakpoint({ actor: gSources.values[0], line: 5 }),
actions.addBreakpoint({ actor: gSources.values[1], line: 6 }),
actions.addBreakpoint({ actor: gSources.values[1], line: 7 })
]);
- if(gDebugger.gThreadClient.state !== "attached") {
+ if (gDebugger.gThreadClient.state !== "attached") {
yield waitForThreadEvents(gPanel, "resumed");
}
yield promise.all([
actions.disableBreakpoint({ actor: gSources.values[0], line: 5 }),
actions.disableBreakpoint({ actor: gSources.values[1], line: 6 })
]);
gSources.toggleBreakpoints();
yield waitForDispatch(gPanel, gDebugger.constants.REMOVE_BREAKPOINT, 1);
checkBreakpointsDisabled(true);
gSources.toggleBreakpoints();
yield waitForDispatch(gPanel, gDebugger.constants.ADD_BREAKPOINT, 3);
checkBreakpointsDisabled(false);
- if(gDebugger.gThreadClient.state !== "attached") {
+ if (gDebugger.gThreadClient.state !== "attached") {
yield waitForThreadEvents(gPanel, "resumed");
}
closeDebuggerAndFinish(gPanel);
});
});
}