Bug 992275 - avoid racy check in breakpoints-button-01.js debugger test a=test-only
authorJames Long <longster@gmail.com>
Wed, 23 Dec 2015 16:34:04 -0500
changeset 298155 5c29753a06cc99da2e8639691b392f0a54494771
parent 298154 bbe0d32cef61d7bc43eef35c78cadf322cc791b1
child 298156 1e1a3ce782585c3a6b8bdd536ddfff521b4f9bf9
push id8885
push userkwierso@gmail.com
push dateTue, 05 Jan 2016 21:31:31 +0000
treeherdermozilla-aurora@de13cf6ddb4a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstest-only
bugs992275
milestone45.0a2
Bug 992275 - avoid racy check in breakpoints-button-01.js debugger test a=test-only
devtools/client/debugger/test/mochitest/browser_dbg_breakpoints-button-01.js
devtools/client/debugger/test/mochitest/browser_dbg_breakpoints-button-02.js
--- 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);
     });
   });
 }