Merge fx-team to m-c.
authorRyan VanderMeulen <ryanvm@gmail.com>
Tue, 23 Jul 2013 16:12:03 -0400
changeset 151860 7c20e8e4e56e8b7c8def7d13ed42399f8ff8024d
parent 151857 1121bb73e739a9571ce961d178777b44d24033b0 (current diff)
parent 151859 70df083d054752a73386a631421184ad9840bbd3 (diff)
child 151931 2983ca6d4d1aa0b425db2bfbd49e9efe338685da
child 151967 03bd96d6d76998aa52253124a5b68ec8122c87d5
child 152056 6cf1c69e3fcfa8b1dab2f49882a77f11b28f0c5d
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 fx-team to m-c.
--- 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);
 }