Bug 1090929 - Enable the break-on-dom-tests;r=mratcliffe
authorEddy Bruël <ejpbruel@gmail.com>
Thu, 06 Nov 2014 10:18:10 +0100
changeset 214273 a93bb566e665dde4e3a23ee0f219adb19472b452
parent 214272 fb95313f0643a4132fbb1b608542add24176a158
child 214274 f8bcb09a02b3c2a2247f789aed8b11954e7ae710
push id51461
push userejpbruel@mozilla.com
push dateThu, 06 Nov 2014 09:18:03 +0000
treeherdermozilla-inbound@a93bb566e665 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmratcliffe
bugs1090929
milestone36.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
Bug 1090929 - Enable the break-on-dom-tests;r=mratcliffe
browser/devtools/debugger/test/browser.ini
browser/devtools/debugger/test/browser_dbg_break-on-dom-02.js
browser/devtools/debugger/test/browser_dbg_break-on-dom-03.js
browser/devtools/debugger/test/browser_dbg_break-on-dom-04.js
browser/devtools/debugger/test/browser_dbg_break-on-dom-05.js
browser/devtools/debugger/test/browser_dbg_break-on-dom-06.js
browser/devtools/debugger/test/browser_dbg_break-on-dom-07.js
browser/devtools/debugger/test/browser_dbg_break-on-dom-08.js
browser/devtools/debugger/test/code_frame-script.js
browser/devtools/debugger/test/head.js
--- a/browser/devtools/debugger/test/browser.ini
+++ b/browser/devtools/debugger/test/browser.ini
@@ -129,29 +129,29 @@ skip-if = e10s && debug
 skip-if = e10s && debug
 [browser_dbg_blackboxing-06.js]
 skip-if = e10s && debug
 [browser_dbg_breadcrumbs-access.js]
 skip-if = e10s
 [browser_dbg_break-on-dom-01.js]
 skip-if = e10s
 [browser_dbg_break-on-dom-02.js]
-skip-if = e10s
+skip-if = e10s && debug
 [browser_dbg_break-on-dom-03.js]
-skip-if = e10s
+skip-if = e10s && debug
 [browser_dbg_break-on-dom-04.js]
-skip-if = e10s
+skip-if = e10s && debug
 [browser_dbg_break-on-dom-05.js]
-skip-if = e10s
+skip-if = e10s && debug
 [browser_dbg_break-on-dom-06.js]
-skip-if = e10s
+skip-if = e10s && debug
 [browser_dbg_break-on-dom-07.js]
-skip-if = e10s
+skip-if = e10s && debug
 [browser_dbg_break-on-dom-08.js]
-skip-if = e10s
+skip-if = e10s && debug
 [browser_dbg_break-on-dom-event-01.js]
 skip-if = e10s || os == "mac" || e10s # Bug 895426
 [browser_dbg_break-on-dom-event-02.js]
 skip-if = e10s
 [browser_dbg_breakpoints-actual-location.js]
 skip-if = e10s
 [browser_dbg_breakpoints-actual-location2.js]
 skip-if = e10s
--- a/browser/devtools/debugger/test/browser_dbg_break-on-dom-02.js
+++ b/browser/devtools/debugger/test/browser_dbg_break-on-dom-02.js
@@ -4,17 +4,17 @@
 /**
  * Tests that event listeners are fetched when the events tab is selected
  * or while sources are fetched and the events tab is focused.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_event-listeners-02.html";
 
 function test() {
-  initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
+  initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
     let gDebugger = aPanel.panelWin;
     let gView = gDebugger.DebuggerView;
     let gEvents = gView.EventListeners;
 
     Task.spawn(function() {
       yield waitForSourceShown(aPanel, ".html");
       yield testFetchOnFocus();
       yield testFetchOnReloadWhenFocused();
--- a/browser/devtools/debugger/test/browser_dbg_break-on-dom-03.js
+++ b/browser/devtools/debugger/test/browser_dbg_break-on-dom-03.js
@@ -3,17 +3,17 @@
 
 /**
  * Tests that event listeners are properly displayed in the view.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_event-listeners-02.html";
 
 function test() {
-  initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
+  initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
     let gDebugger = aPanel.panelWin;
     let gView = gDebugger.DebuggerView;
     let gEvents = gView.EventListeners;
 
     Task.spawn(function() {
       yield waitForSourceShown(aPanel, ".html");
 
       let fetched = waitForDebuggerEvents(aPanel, gDebugger.EVENTS.EVENT_LISTENERS_FETCHED);
--- a/browser/devtools/debugger/test/browser_dbg_break-on-dom-04.js
+++ b/browser/devtools/debugger/test/browser_dbg_break-on-dom-04.js
@@ -4,17 +4,17 @@
 /**
  * Tests that checking/unchecking an event listener in the view correctly
  * causes the active thread to get updated with the new event breakpoints.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_event-listeners-02.html";
 
 function test() {
-  initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
+  initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
     let gDebugger = aPanel.panelWin;
     let gView = gDebugger.DebuggerView;
     let gController = gDebugger.DebuggerController
     let gEvents = gView.EventListeners;
     let gBreakpoints = gController.Breakpoints;
 
     Task.spawn(function() {
       yield waitForSourceShown(aPanel, ".html");
--- a/browser/devtools/debugger/test/browser_dbg_break-on-dom-05.js
+++ b/browser/devtools/debugger/test/browser_dbg_break-on-dom-05.js
@@ -5,17 +5,17 @@
  * Tests that checking/unchecking an event listener's group in the view will
  * cause the active thread to get updated with the new event breakpoints for
  * all children inside that group.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_event-listeners-02.html";
 
 function test() {
-  initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
+  initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
     let gDebugger = aPanel.panelWin;
     let gView = gDebugger.DebuggerView;
     let gController = gDebugger.DebuggerController
     let gEvents = gView.EventListeners;
     let gBreakpoints = gController.Breakpoints;
 
     Task.spawn(function() {
       yield waitForSourceShown(aPanel, ".html");
--- a/browser/devtools/debugger/test/browser_dbg_break-on-dom-06.js
+++ b/browser/devtools/debugger/test/browser_dbg_break-on-dom-06.js
@@ -4,17 +4,17 @@
 /**
  * Tests that the event listener states are preserved in the view after the
  * target navigates.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_event-listeners-02.html";
 
 function test() {
-  initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
+  initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
     let gDebugger = aPanel.panelWin;
     let gView = gDebugger.DebuggerView;
     let gController = gDebugger.DebuggerController
     let gEvents = gView.EventListeners;
     let gBreakpoints = gController.Breakpoints;
 
     Task.spawn(function() {
       yield waitForSourceShown(aPanel, ".html");
--- a/browser/devtools/debugger/test/browser_dbg_break-on-dom-07.js
+++ b/browser/devtools/debugger/test/browser_dbg_break-on-dom-07.js
@@ -1,17 +1,17 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Tests that system event listeners don't get duplicated in the view.
  */
 
 function test() {
-  initDebugger("about:blank").then(([aTab, aDebuggee, aPanel]) => {
+  initDebugger("about:blank").then(([aTab,, aPanel]) => {
     let gDebugger = aPanel.panelWin;
     let gView = gDebugger.DebuggerView;
     let gEvents = gView.EventListeners;
     let gL10N = gDebugger.L10N;
 
     is(gEvents.itemCount, 0,
       "There are no events displayed in the corresponding pane yet.");
 
--- a/browser/devtools/debugger/test/browser_dbg_break-on-dom-08.js
+++ b/browser/devtools/debugger/test/browser_dbg_break-on-dom-08.js
@@ -3,24 +3,25 @@
 
 /**
  * Tests that breaking on an event selects the variables view tab.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_event-listeners-02.html";
 
 function test() {
-  initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
+  initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
+    let gTab = aTab;
     let gDebugger = aPanel.panelWin;
     let gView = gDebugger.DebuggerView;
     let gEvents = gView.EventListeners;
 
     Task.spawn(function() {
       yield waitForSourceShown(aPanel, ".html");
-      aDebuggee.addBodyClickEventListener();
+      yield callInTab(gTab, "addBodyClickEventListener");
 
       let fetched = waitForDebuggerEvents(aPanel, gDebugger.EVENTS.EVENT_LISTENERS_FETCHED);
       gView.toggleInstrumentsPane({ visible: true, animated: false }, 1);
       yield fetched;
       yield ensureThreadClientState(aPanel, "resumed");
 
       is(gView.instrumentsPaneHidden, false,
         "The instruments pane should be visible.");
@@ -28,21 +29,17 @@ function test() {
         "The events tab should be selected.");
 
       let updated = waitForDebuggerEvents(aPanel, gDebugger.EVENTS.EVENT_BREAKPOINTS_UPDATED);
       EventUtils.sendMouseEvent({ type: "click" }, getItemCheckboxNode(1), gDebugger);
       yield updated;
       yield ensureThreadClientState(aPanel, "resumed");
 
       let paused = waitForCaretAndScopes(aPanel, 48);
-      // Spin the event loop before causing the debuggee to pause, to allow
-      // this function to yield first.
-      executeSoon(() => {
-        EventUtils.sendMouseEvent({ type: "click" }, aDebuggee.document.body, aDebuggee);
-      });
+      sendMouseClickToTab(gTab, content.document.body);
       yield paused;
       yield ensureThreadClientState(aPanel, "paused");
 
       is(gView.instrumentsPaneHidden, false,
         "The instruments pane should be visible.");
       is(gView.instrumentsPaneTab, "variables-tab",
         "The variables tab should be selected.");
 
--- a/browser/devtools/debugger/test/code_frame-script.js
+++ b/browser/devtools/debugger/test/code_frame-script.js
@@ -1,9 +1,25 @@
 "use strict";
 
+const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
+const { loadSubScript } = Cc['@mozilla.org/moz/jssubscript-loader;1'].
+                          getService(Ci.mozIJSSubScriptLoader);
+
+const EventUtils = {};
+loadSubScript("chrome://marionette/content/EventUtils.js", EventUtils);
+
 dump("Frame script loaded.\n");
 
 addMessageListener("test:call", function (message) {
   dump("Calling function with name " + message.data + ".\n");
 
   XPCNativeWrapper.unwrap(content)[message.data]();
+  sendAsyncMessage("test:call");
 });
+
+addMessageListener("test:click", function (message) {
+  dump("Sending mouse click.\n");
+
+  let target = message.objects.target;
+  EventUtils.synthesizeMouseAtCenter(target, {},
+                                     target.ownerDocument.defaultView);
+});
--- a/browser/devtools/debugger/test/head.js
+++ b/browser/devtools/debugger/test/head.js
@@ -959,9 +959,18 @@ function waitForMessageFromTab(tab, name
     });
   });
 }
 
 function callInTab(tab, name) {
   info("Calling function with name " + name + " in tab.");
 
   sendMessageToTab(tab, "test:call", name);
+  waitForMessageFromTab(tab, "test:call");
 }
+
+function sendMouseClickToTab(tab, target) {
+  info("Sending mouse click to tab.");
+
+  sendMessageToTab(tab, "test:click", undefined, {
+    target: target
+  });
+}