Merge mozilla-central and fx-team
authorEd Morley <emorley@mozilla.com>
Tue, 23 Jul 2013 14:01:57 +0100
changeset 151859 70df083d054752a73386a631421184ad9840bbd3
parent 151840 b717a7945dfbc1af6c51eccb67be0d640766e44c (current diff)
parent 151858 d9db157a64cada5c17b9e9a2b65e1008fb6a3ced (diff)
child 151860 7c20e8e4e56e8b7c8def7d13ed42399f8ff8024d
child 152054 978b2693a7a452dd35372925bfeff6d5b7644342
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)
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
Merge mozilla-central and fx-team
--- a/browser/devtools/debugger/test/browser_dbg_break-on-dom-event.js
+++ b/browser/devtools/debugger/test/browser_dbg_break-on-dom-event.js
@@ -62,18 +62,31 @@ function testBreakOnAll()
         });
 
         gThreadClient.resume(function() {
           EventUtils.sendMouseEvent({ type: "click" }, gButton);
         });
       });
 
       gThreadClient.resume(function() {
+        // Make sure that the focus is not on the input box so that a focus event
+        // will be triggered.
+        window.focus();
+        gBrowser.selectedBrowser.focus();
+        gButton.focus();
+
+        // Focus the element and wait for focus event.
+        gInput.addEventListener("focus", function onfocus() {
+          gInput.removeEventListener("focus", onfocus, false);
+          executeSoon(function() {
+            EventUtils.synthesizeKey("e", { shiftKey: 1 }, content);
+          });
+        }, false);
+
         gInput.focus();
-        EventUtils.synthesizeKey("e", { shiftKey: 1 }, content);
       });
     });
   });
 
   EventUtils.sendMouseEvent({ type: "click" }, gButton);
 }
 
 // Test that removing events from the array disables them.
@@ -89,18 +102,31 @@ function testBreakOnDisabled()
     // capturing one had a chance to execute and modify window.foobar.
     gInput.addEventListener("keyup", function tempHandler() {
       gInput.removeEventListener("keyup", tempHandler, false);
       is(content.wrappedJSObject.foobar, "keyupHandler", "No hidden breakpoint was hit.");
       gClient.removeListener("paused", unexpectedListener);
       testBreakOnNone();
     }, false);
 
+    // Make sure that the focus is not on the input box so that a focus event
+    // will be triggered.
+    window.focus();
+    gBrowser.selectedBrowser.focus();
+    gButton.focus();
+
+    // Focus the element and wait for focus event.
+    gInput.addEventListener("focus", function onfocus() {
+      gInput.removeEventListener("focus", onfocus, false);
+      executeSoon(function() {
+        EventUtils.synthesizeKey("e", { shiftKey: 1 }, content);
+      });
+    }, false);
+
     gInput.focus();
-    EventUtils.synthesizeKey("e", { shiftKey: 1 }, content);
   });
 }
 
 // Test that specifying an empty event array clears all hidden breakpoints.
 function testBreakOnNone()
 {
   // Test calling pauseOnDOMEvents from a running state.
   gThreadClient.pauseOnDOMEvents([], function(packet) {
@@ -112,18 +138,31 @@ function testBreakOnNone()
     // capturing one had a chance to execute and modify window.foobar.
     gInput.addEventListener("keyup", function tempHandler() {
       gInput.removeEventListener("keyup", tempHandler, false);
       is(content.wrappedJSObject.foobar, "keyupHandler", "No hidden breakpoint was hit.");
       gClient.removeListener("paused", unexpectedListener);
       testBreakOnClick();
     }, false);
 
+    // Make sure that the focus is not on the input box so that a focus event
+    // will be triggered.
+    window.focus();
+    gBrowser.selectedBrowser.focus();
+    gButton.focus();
+
+    // Focus the element and wait for focus event.
+    gInput.addEventListener("focus", function onfocus() {
+      gInput.removeEventListener("focus", onfocus, false);
+      executeSoon(function() {
+        EventUtils.synthesizeKey("g", { shiftKey: 1 }, content);
+      });
+    }, false);
+
     gInput.focus();
-    EventUtils.synthesizeKey("g", { shiftKey: 1 }, content);
   });
 }
 
 function unexpectedListener(event, packet, callback) {
   gClient.removeListener("paused", unexpectedListener);
   ok(false, "An unexpected hidden breakpoint was hit.");
   gThreadClient.resume(testBreakOnClick);
 }