Add the paused listener before resuming to avoid an intermittent test failure (bug 895426); r=me
authorPanos Astithas <past@mozilla.com>
Fri, 19 Jul 2013 11:57:15 +0300
changeset 151594 a4e8ace8a4a92bbff8a58cf406ffd77d860096b0
parent 151593 c98c47341be672ac3b76cc05e2c60172c1ee6dab
child 151595 20848adc99809d3d24ae2425732017fd8d3ecb25
push id2859
push userakeybl@mozilla.com
push dateMon, 16 Sep 2013 19:14:59 +0000
treeherdermozilla-beta@87d3c51cd2bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs895426
milestone25.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Add the paused listener before resuming to avoid an intermittent test failure (bug 895426); r=me
browser/devtools/debugger/test/browser_dbg_break-on-dom-event.js
--- a/browser/devtools/debugger/test/browser_dbg_break-on-dom-event.js
+++ b/browser/devtools/debugger/test/browser_dbg_break-on-dom-event.js
@@ -34,44 +34,44 @@ function test()
 function testBreakOnAll()
 {
   gClient.addOneTimeListener("paused", function(event, packet) {
     is(packet.why.type, "debuggerStatement", "debugger statement was hit.");
     // Test calling pauseOnDOMEvents from a paused state.
     gThreadClient.pauseOnDOMEvents("*", function(packet) {
       is(packet, undefined, "The pause-on-any-event request completed successfully.");
 
-      gThreadClient.resume(function() {
-        gClient.addOneTimeListener("paused", function(event, packet) {
-          is(packet.why.type, "pauseOnDOMEvents", "A hidden breakpoint was hit.");
-          is(packet.frame.callee.name, "keyupHandler", "The keyupHandler is entered.");
+      gClient.addOneTimeListener("paused", function(event, packet) {
+        is(packet.why.type, "pauseOnDOMEvents", "A hidden breakpoint was hit.");
+        is(packet.frame.callee.name, "keyupHandler", "The keyupHandler is entered.");
 
-          gThreadClient.resume(function() {
-            gClient.addOneTimeListener("paused", function(event, packet) {
-              is(packet.why.type, "pauseOnDOMEvents", "A hidden breakpoint was hit.");
-              is(packet.frame.callee.name, "clickHandler", "The clickHandler is entered.");
+        gThreadClient.resume(function() {
+          gClient.addOneTimeListener("paused", function(event, packet) {
+            is(packet.why.type, "pauseOnDOMEvents", "A hidden breakpoint was hit.");
+            is(packet.frame.callee.name, "clickHandler", "The clickHandler is entered.");
+
+            gThreadClient.resume(function() {
+              gClient.addOneTimeListener("paused", function(event, packet) {
+                is(packet.why.type, "pauseOnDOMEvents", "A hidden breakpoint was hit.");
+                is(packet.frame.callee.name, "onchange", "The onchange handler is entered.");
 
-              gThreadClient.resume(function() {
-                gClient.addOneTimeListener("paused", function(event, packet) {
-                  is(packet.why.type, "pauseOnDOMEvents", "A hidden breakpoint was hit.");
-                  is(packet.frame.callee.name, "onchange", "The onchange handler is entered.");
-
-                  gThreadClient.resume(testBreakOnDisabled);
-                });
+                gThreadClient.resume(testBreakOnDisabled);
+              });
 
-                gInput.focus();
-                gInput.value = "foo";
-                gInput.blur();
-              });
+              gInput.focus();
+              gInput.value = "foo";
+              gInput.blur();
             });
+          });
 
-            EventUtils.sendMouseEvent({ type: "click" }, gButton);
-          });
+          EventUtils.sendMouseEvent({ type: "click" }, gButton);
         });
+      });
 
+      gThreadClient.resume(function() {
         gInput.focus();
         EventUtils.synthesizeKey("e", {}, content);
       });
     });
   });
 
   EventUtils.sendMouseEvent({ type: "click" }, gButton);
 }