Bug 1090929 - Enable the tracer tests;r=mratcliffe
authorEddy Bruël <ejpbruel@gmail.com>
Tue, 11 Nov 2014 08:44:27 +0100
changeset 214984 97cd2042865dd7455ead6ce8d8b40ec49a4b94f7
parent 214983 320f80475bd33f5323cd691feeca65c81db3a4dd
child 214985 c60fc2c11c0ea6794546fe108bb5bd7c29a294cc
child 215017 fadaae430cc8e2e58387028821379f4fabacf6cf
push id27802
push usercbook@mozilla.com
push dateTue, 11 Nov 2014 12:25:07 +0000
treeherdermozilla-central@c60fc2c11c0e [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 tracer tests;r=mratcliffe
browser/devtools/debugger/test/browser.ini
browser/devtools/debugger/test/browser_dbg_tracing-01.js
browser/devtools/debugger/test/browser_dbg_tracing-02.js
browser/devtools/debugger/test/browser_dbg_tracing-03.js
browser/devtools/debugger/test/browser_dbg_tracing-04.js
browser/devtools/debugger/test/browser_dbg_tracing-05.js
browser/devtools/debugger/test/browser_dbg_tracing-06.js
browser/devtools/debugger/test/browser_dbg_tracing-07.js
--- a/browser/devtools/debugger/test/browser.ini
+++ b/browser/devtools/debugger/test/browser.ini
@@ -425,31 +425,31 @@ skip-if = e10s
 skip-if = e10s
 [browser_dbg_tabactor-01.js]
 skip-if = e10s
 [browser_dbg_tabactor-02.js]
 skip-if = e10s
 [browser_dbg_terminate-on-tab-close.js]
 skip-if = e10s
 [browser_dbg_tracing-01.js]
-skip-if = e10s
+skip-if = e10s && debug
 [browser_dbg_tracing-02.js]
-skip-if = e10s
+skip-if = e10s && debug
 [browser_dbg_tracing-03.js]
-skip-if = e10s
+skip-if = e10s && debug
 [browser_dbg_tracing-04.js]
-skip-if = e10s
+skip-if = e10s && debug
 [browser_dbg_tracing-05.js]
-skip-if = e10s
+skip-if = e10s && debug
 [browser_dbg_tracing-06.js]
-skip-if = e10s
+skip-if = e10s && debug
 [browser_dbg_tracing-07.js]
-skip-if = e10s
+skip-if = e10s && debug
 [browser_dbg_tracing-08.js]
-skip-if = e10s
+skip-if = e10s && debug
 [browser_dbg_variables-view-01.js]
 skip-if = e10s && debug
 [browser_dbg_variables-view-02.js]
 skip-if = e10s && debug
 [browser_dbg_variables-view-03.js]
 skip-if = e10s && debug
 [browser_dbg_variables-view-04.js]
 skip-if = e10s && debug
--- a/browser/devtools/debugger/test/browser_dbg_tracing-01.js
+++ b/browser/devtools/debugger/test/browser_dbg_tracing-01.js
@@ -2,23 +2,22 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Test that we get the expected frame enter/exit logs in the tracer view.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_tracing-01.html";
 
-let gTab, gDebuggee, gPanel, gDebugger;
+let gTab, gPanel, gDebugger;
 
 function test() {
   SpecialPowers.pushPrefEnv({'set': [["devtools.debugger.tracer", true]]}, () => {
-    initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
+    initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
       gTab = aTab;
-      gDebuggee = aDebuggee;
       gPanel = aPanel;
       gDebugger = gPanel.panelWin;
 
       waitForSourceShown(gPanel, "code_tracing-01.js")
         .then(() => startTracing(gPanel))
         .then(clickButton)
         .then(() => waitForClientEvents(aPanel, "traces"))
         .then(testTraceLogs)
@@ -32,19 +31,17 @@ function test() {
         .then(null, aError => {
           ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
         });
     });
   });
 }
 
 function clickButton() {
-  EventUtils.sendMouseEvent({ type: "click" },
-                            gDebuggee.document.querySelector("button"),
-                            gDebuggee);
+  sendMouseClickToTab(gTab, content.document.querySelector("button"));
 }
 
 function testTraceLogs() {
   const onclickLogs = filterTraces(gPanel,
                                    t => t.querySelector(".trace-name[value=onclick]"));
   is(onclickLogs.length, 2, "Should have two logs from 'onclick'");
   ok(onclickLogs[0].querySelector(".trace-call"),
      "The first 'onclick' log should be a call.");
@@ -98,12 +95,11 @@ function testTraceLogs() {
   ok(throwerLogs[0].querySelector(".trace-call"),
      "The first 'thrower' log should be a call.");
   ok(throwerLogs[1].querySelector(".trace-throw",
      "The second 'thrower' log should be a throw."));
 }
 
 registerCleanupFunction(function() {
   gTab = null;
-  gDebuggee = null;
   gPanel = null;
   gDebugger = null;
 });
--- a/browser/devtools/debugger/test/browser_dbg_tracing-02.js
+++ b/browser/devtools/debugger/test/browser_dbg_tracing-02.js
@@ -2,23 +2,22 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Test that we highlight matching calls and returns on hover.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_tracing-01.html";
 
-let gTab, gDebuggee, gPanel, gDebugger;
+let gTab, gPanel, gDebugger;
 
 function test() {
   SpecialPowers.pushPrefEnv({'set': [["devtools.debugger.tracer", true]]}, () => {
-    initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
+    initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
       gTab = aTab;
-      gDebuggee = aDebuggee;
       gPanel = aPanel;
       gDebugger = gPanel.panelWin;
 
       waitForSourceShown(gPanel, "code_tracing-01.js")
         .then(() => startTracing(gPanel))
         .then(clickButton)
         .then(() => waitForClientEvents(aPanel, "traces"))
         .then(highlightCall)
@@ -35,19 +34,17 @@ function test() {
         .then(null, aError => {
           ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
         });
     });
   });
 }
 
 function clickButton() {
-  EventUtils.sendMouseEvent({ type: "click" },
-                            gDebuggee.document.querySelector("button"),
-                            gDebuggee);
+  sendMouseClickToTab(gTab, content.document.querySelector("button"));
 }
 
 function highlightCall() {
   const callTrace = filterTraces(gPanel, t => t.querySelector(".trace-name[value=main]"))[0];
   EventUtils.sendMouseEvent({ type: "mouseover" },
                             callTrace,
                             gDebugger);
 }
@@ -67,12 +64,11 @@ function unhighlightCall() {
 
 function testNoneHighlighted() {
   const highlightedTraces = filterTraces(gPanel, t => t.querySelector(".selected-matching"));
   is(highlightedTraces.length, 0, "Shouldn't have any highlighted traces");
 }
 
 registerCleanupFunction(function() {
   gTab = null;
-  gDebuggee = null;
   gPanel = null;
   gDebugger = null;
 });
--- a/browser/devtools/debugger/test/browser_dbg_tracing-03.js
+++ b/browser/devtools/debugger/test/browser_dbg_tracing-03.js
@@ -2,23 +2,22 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Test that we can jump to function definitions by clicking on logs.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_tracing-01.html";
 
-let gTab, gDebuggee, gPanel, gDebugger;
+let gTab, gPanel, gDebugger;
 
 function test() {
   SpecialPowers.pushPrefEnv({'set': [["devtools.debugger.tracer", true]]}, () => {
-    initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
+    initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
       gTab = aTab;
-      gDebuggee = aDebuggee;
       gPanel = aPanel;
       gDebugger = gPanel.panelWin;
 
       waitForSourceShown(gPanel, "code_tracing-01.js")
         .then(() => startTracing(gPanel))
         .then(clickButton)
         .then(() => waitForClientEvents(aPanel, "traces"))
         .then(() => {
@@ -43,28 +42,25 @@ function test() {
         .then(null, aError => {
           ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
         });
     });
   });
 }
 
 function clickButton() {
-  EventUtils.sendMouseEvent({ type: "click" },
-                            gDebuggee.document.querySelector("button"),
-                            gDebuggee);
+  sendMouseClickToTab(gTab, content.document.querySelector("button"));
 }
 
 function clickTraceLog() {
   filterTraces(gPanel, t => t.querySelector(".trace-name[value=main]"))[0].click();
 }
 
 function testCorrectLine() {
   is(gDebugger.DebuggerView.editor.getCursor().line, 18,
      "The editor should have the function definition site's line selected.");
 }
 
 registerCleanupFunction(function() {
   gTab = null;
-  gDebuggee = null;
   gPanel = null;
   gDebugger = null;
 });
--- a/browser/devtools/debugger/test/browser_dbg_tracing-04.js
+++ b/browser/devtools/debugger/test/browser_dbg_tracing-04.js
@@ -2,23 +2,22 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Test that when we click on logs, we get the parameters/return value in the variables view.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_tracing-01.html";
 
-let gTab, gDebuggee, gPanel, gDebugger;
+let gTab, gPanel, gDebugger;
 
 function test() {
   SpecialPowers.pushPrefEnv({'set': [["devtools.debugger.tracer", true]]}, () => {
-    initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
+    initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
       gTab = aTab;
-      gDebuggee = aDebuggee;
       gPanel = aPanel;
       gDebugger = gPanel.panelWin;
 
       waitForSourceShown(gPanel, "code_tracing-01.js")
         .then(() => startTracing(gPanel))
         .then(clickButton)
         .then(() => waitForClientEvents(aPanel, "traces"))
         .then(clickTraceCall)
@@ -36,19 +35,17 @@ function test() {
           DevToolsUtils.reportException("browser_dbg_tracing-04.js", aError);
           ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
         });
     });
   });
 }
 
 function clickButton() {
-  EventUtils.sendMouseEvent({ type: "click" },
-                            gDebuggee.document.querySelector("button"),
-                            gDebuggee);
+  sendMouseClickToTab(gTab, content.document.querySelector("button"));
 }
 
 function clickTraceCall() {
   filterTraces(gPanel, t => t.querySelector(".trace-name[value=factorial]"))[0]
     .click();
 }
 
 function testParams() {
@@ -73,12 +70,11 @@ function testReturn() {
 
   const value = gDebugger.document.querySelector(".variables-view-variable .value.token-number");
   ok(value, "Should have a variable value");
   is(value.getAttribute("value"), "120", "The variable value should be 120");
 }
 
 registerCleanupFunction(function() {
   gTab = null;
-  gDebuggee = null;
   gPanel = null;
   gDebugger = null;
 });
--- a/browser/devtools/debugger/test/browser_dbg_tracing-05.js
+++ b/browser/devtools/debugger/test/browser_dbg_tracing-05.js
@@ -2,24 +2,23 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Test that text describing the tracing state is correctly displayed.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_tracing-01.html";
 
-let gTab, gDebuggee, gPanel, gDebugger;
+let gTab, gPanel, gDebugger;
 let gTracer, gL10N;
 
 function test() {
   SpecialPowers.pushPrefEnv({'set': [["devtools.debugger.tracer", true]]}, () => {
-    initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
+    initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
       gTab = aTab;
-      gDebuggee = aDebuggee;
       gPanel = aPanel;
       gDebugger = gPanel.panelWin;
       gTracer = gDebugger.DebuggerView.Tracer;
       gL10N = gDebugger.L10N;
 
       waitForSourceShown(gPanel, "code_tracing-01.js")
         .then(testTracingNotStartedText)
         .then(() => gTracer._onStartTracing())
@@ -65,21 +64,18 @@ function testFunctionCallsUnavailableTex
 
 function testNoEmptyText() {
   let label = gDebugger.document.querySelector("#tracer-tabpanel .fast-list-widget-empty-text");
   ok(!label,
     "No label should be displayed in the tracer tabpanel.");
 }
 
 function clickButton() {
-  EventUtils.sendMouseEvent({ type: "click" },
-                            gDebuggee.document.querySelector("button"),
-                            gDebuggee);
+  sendMouseClickToTab(gTab, content.document.querySelector("button"));
 }
 
 registerCleanupFunction(function() {
   gTab = null;
-  gDebuggee = null;
   gPanel = null;
   gDebugger = null;
   gTracer = null;
   gL10N = null;
 });
--- a/browser/devtools/debugger/test/browser_dbg_tracing-06.js
+++ b/browser/devtools/debugger/test/browser_dbg_tracing-06.js
@@ -3,37 +3,35 @@
 
 /**
  * Test that the tracer doesn't connect to the backend when tracing is disabled.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_tracing-01.html";
 const TRACER_PREF = "devtools.debugger.tracer";
 
-let gTab, gDebuggee, gPanel, gDebugger;
+let gTab, gPanel, gDebugger;
 let gOriginalPref = Services.prefs.getBoolPref(TRACER_PREF);
 Services.prefs.setBoolPref(TRACER_PREF, false);
 
 function test() {
-  initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
+  initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
     gTab = aTab;
-    gDebuggee = aDebuggee;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
 
     waitForSourceShown(gPanel, "code_tracing-01.js")
       .then(() => {
         ok(!gDebugger.DebuggerController.traceClient, "Should not have a trace client");
         closeDebuggerAndFinish(gPanel);
       })
       .then(null, aError => {
         ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
       });
   });
 }
 
 registerCleanupFunction(function() {
   gTab = null;
-  gDebuggee = null;
   gPanel = null;
   gDebugger = null;
   Services.prefs.setBoolPref(TRACER_PREF, gOriginalPref);
 });
--- a/browser/devtools/debugger/test/browser_dbg_tracing-07.js
+++ b/browser/devtools/debugger/test/browser_dbg_tracing-07.js
@@ -3,23 +3,23 @@
 
 /**
  * Execute code both before and after blackboxing and test that we get
  * appropriately styled traces.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_tracing-01.html";
 
-let gTab, gDebuggee, gPanel;
+let gTab, gPanel;
 
 function test() {
   Task.async(function*() {
     yield pushPref();
 
-    [gTab, gDebuggee, gPanel] = yield initDebugger(TAB_URL);
+    [gTab,, gPanel] = yield initDebugger(TAB_URL);
 
     yield startTracing(gPanel);
     yield clickButton();
     yield waitForClientEvents(gPanel, "traces");
 
     /**
      * Test that there are some traces which are not blackboxed.
      */
@@ -55,19 +55,17 @@ function test() {
     finish();
   })().catch(e => {
     ok(false, "Got an error: " + e.message + "\n" + e.stack);
     finish();
   });
 }
 
 function clickButton() {
-  EventUtils.sendMouseEvent({ type: "click" },
-                            gDebuggee.document.querySelector("button"),
-                            gDebuggee);
+  sendMouseClickToTab(gTab, content.document.querySelector("button"));
 }
 
 function pushPref() {
   let deferred = promise.defer();
   SpecialPowers.pushPrefEnv({'set': [["devtools.debugger.tracer", true]]},
     deferred.resolve);
   return deferred.promise;
 }
@@ -75,12 +73,11 @@ function pushPref() {
 function popPref() {
   let deferred = promise.defer();
   SpecialPowers.popPrefEnv(deferred.resolve);
   return deferred.promise;
 }
 
 registerCleanupFunction(function() {
   gTab = null;
-  gDebuggee = null;
   gPanel = null;
 });