Bug 1090929 - Enable the pretty-print tests;r=mratcliffe
authorEddy Bruël <ejpbruel@gmail.com>
Thu, 06 Nov 2014 10:27:45 +0100
changeset 214278 0c68932bcf9f9b8182ed58a39c19727e1a885800
parent 214277 1d094e17ff5d1a94c27db1b4d484052b2b1ef8f0
child 214279 7822514901e6008021b06bad4d862fa7c62b7bcf
push id51464
push userejpbruel@mozilla.com
push dateThu, 06 Nov 2014 09:29:14 +0000
treeherdermozilla-inbound@0c68932bcf9f [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 pretty-print tests;r=mratcliffe
browser/devtools/debugger/test/browser.ini
browser/devtools/debugger/test/browser_dbg_pretty-print-01.js
browser/devtools/debugger/test/browser_dbg_pretty-print-02.js
browser/devtools/debugger/test/browser_dbg_pretty-print-03.js
browser/devtools/debugger/test/browser_dbg_pretty-print-04.js
browser/devtools/debugger/test/browser_dbg_pretty-print-05.js
browser/devtools/debugger/test/browser_dbg_pretty-print-06.js
browser/devtools/debugger/test/browser_dbg_pretty-print-07.js
browser/devtools/debugger/test/browser_dbg_pretty-print-08.js
browser/devtools/debugger/test/browser_dbg_pretty-print-09.js
browser/devtools/debugger/test/browser_dbg_pretty-print-10.js
browser/devtools/debugger/test/browser_dbg_pretty-print-11.js
browser/devtools/debugger/test/browser_dbg_pretty-print-12.js
browser/devtools/debugger/test/browser_dbg_pretty-print-13.js
browser/devtools/debugger/test/browser_dbg_pretty-print-on-paused.js
browser/devtools/debugger/test/doc_pretty-print-2.html
--- a/browser/devtools/debugger/test/browser.ini
+++ b/browser/devtools/debugger/test/browser.ini
@@ -303,43 +303,43 @@ skip-if = e10s
 skip-if = e10s
 [browser_dbg_pause-resume.js]
 skip-if = e10s
 [browser_dbg_pause-warning.js]
 skip-if = e10s
 [browser_dbg_paused-keybindings.js]
 skip-if = e10s
 [browser_dbg_pretty-print-01.js]
-skip-if = e10s
+skip-if = e10s && debug
 [browser_dbg_pretty-print-02.js]
-skip-if = e10s
+skip-if = e10s && debug
 [browser_dbg_pretty-print-03.js]
-skip-if = e10s
+skip-if = e10s && debug
 [browser_dbg_pretty-print-04.js]
-skip-if = e10s
+skip-if = e10s && debug
 [browser_dbg_pretty-print-05.js]
-skip-if = e10s
+skip-if = e10s && debug
 [browser_dbg_pretty-print-06.js]
-skip-if = e10s
+skip-if = e10s && debug
 [browser_dbg_pretty-print-07.js]
-skip-if = e10s
+skip-if = e10s && debug
 [browser_dbg_pretty-print-08.js]
-skip-if = e10s
+skip-if = e10s && debug
 [browser_dbg_pretty-print-09.js]
-skip-if = e10s
+skip-if = e10s && debug
 [browser_dbg_pretty-print-10.js]
-skip-if = e10s
+skip-if = e10s && debug
 [browser_dbg_pretty-print-11.js]
-skip-if = e10s
+skip-if = e10s && debug
 [browser_dbg_pretty-print-12.js]
-skip-if = e10s
+skip-if = e10s && debug
 [browser_dbg_pretty-print-13.js]
-skip-if = e10s
+skip-if = e10s && debug
 [browser_dbg_pretty-print-on-paused.js]
-skip-if = e10s
+skip-if = e10s && debug
 [browser_dbg_progress-listener-bug.js]
 skip-if = e10s
 [browser_dbg_reload-preferred-script-01.js]
 skip-if = e10s
 [browser_dbg_reload-preferred-script-02.js]
 skip-if = e10s
 [browser_dbg_reload-preferred-script-03.js]
 skip-if = e10s
--- a/browser/devtools/debugger/test/browser_dbg_pretty-print-01.js
+++ b/browser/devtools/debugger/test/browser_dbg_pretty-print-01.js
@@ -2,23 +2,22 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Make sure that clicking the pretty print button prettifies the source.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_pretty-print.html";
 
-let gTab, gDebuggee, gPanel, gDebugger;
+let gTab, gPanel, gDebugger;
 let gEditor, gSources;
 
 function test() {
-  initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
+  initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
     gTab = aTab;
-    gDebuggee = aDebuggee;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gEditor = gDebugger.DebuggerView.editor;
     gSources = gDebugger.DebuggerView.Sources;
 
     waitForSourceShown(gPanel, "code_ugly.js")
       .then(testSourceIsUgly)
       .then(() => {
@@ -71,14 +70,13 @@ function testSourceIsStillPretty() {
     deferred.resolve();
   });
 
   return deferred.promise;
 }
 
 registerCleanupFunction(function() {
   gTab = null;
-  gDebuggee = null;
   gPanel = null;
   gDebugger = null;
   gEditor = null;
   gSources = null;
 });
--- a/browser/devtools/debugger/test/browser_dbg_pretty-print-02.js
+++ b/browser/devtools/debugger/test/browser_dbg_pretty-print-02.js
@@ -3,23 +3,22 @@
 
 /**
  * Make sure that right clicking and selecting the pretty print context menu
  * item prettifies the source.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_pretty-print.html";
 
-let gTab, gDebuggee, gPanel, gDebugger;
+let gTab, gPanel, gDebugger;
 let gEditor, gContextMenu;
 
 function test() {
-  initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
+  initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
     gTab = aTab;
-    gDebuggee = aDebuggee;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gEditor = gDebugger.DebuggerView.editor;
     gContextMenu = gDebugger.document.getElementById("sourceEditorContextMenu");
 
     waitForSourceShown(gPanel, "code_ugly.js")
       .then(() => {
         const finished = waitForSourceShown(gPanel, "code_ugly.js");
@@ -44,14 +43,13 @@ function selectContextMenuItem() {
 
 function testSourceIsPretty() {
   ok(gEditor.getText().contains("\n  "),
      "The source should be pretty printed.")
 }
 
 registerCleanupFunction(function() {
   gTab = null;
-  gDebuggee = null;
   gPanel = null;
   gDebugger = null;
   gEditor = null;
   gContextMenu = null;
 });
--- a/browser/devtools/debugger/test/browser_dbg_pretty-print-03.js
+++ b/browser/devtools/debugger/test/browser_dbg_pretty-print-03.js
@@ -2,22 +2,21 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Make sure that we have the correct line selected after pretty printing.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_pretty-print.html";
 
-let gTab, gDebuggee, gPanel, gDebugger;
+let gTab, gPanel, gDebugger;
 
 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_ugly.js")
       .then(runCodeAndPause)
       .then(() => {
         const sourceShown = waitForSourceShown(gPanel, "code_ugly.js");
         const caretUpdated = waitForCaretUpdated(gPanel, 7);
@@ -30,23 +29,21 @@ function test() {
         ok(false, "Got an error: " + DevToolsUtils.safeErrorString(aError));
       });
   });
 }
 
 function runCodeAndPause() {
   const deferred = promise.defer();
   once(gDebugger.gThreadClient, "paused").then(deferred.resolve);
-  // Have to executeSoon so that we don't pause before this function returns.
-  executeSoon(gDebuggee.foo);
+  callInTab(gTab, "foo");
   return deferred.promise;
 }
 
 function clickPrettyPrintButton() {
   gDebugger.document.getElementById("pretty-print").click();
 }
 
 registerCleanupFunction(function() {
   gTab = null;
-  gDebuggee = null;
   gPanel = null;
   gDebugger = null;
 });
--- a/browser/devtools/debugger/test/browser_dbg_pretty-print-04.js
+++ b/browser/devtools/debugger/test/browser_dbg_pretty-print-04.js
@@ -2,23 +2,22 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Tests that the function searching works with pretty printed sources.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_pretty-print.html";
 
-let gTab, gDebuggee, gPanel, gDebugger;
+let gTab, gPanel, gDebugger;
 let gSearchBox;
 
 function test() {
-  initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
+  initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
     gTab = aTab;
-    gDebuggee = aDebuggee;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gSearchBox = gDebugger.DebuggerView.Filtering._searchbox;
 
     waitForSourceShown(gPanel, "code_ugly.js")
       .then(testUglySearch)
       .then(() => {
         const finished = waitForSourceShown(gPanel, "code_ugly.js");
@@ -60,13 +59,12 @@ function testPrettyPrintedSearch() {
   });
 
   setText(gSearchBox, "@bar");
   return deferred.promise;
 }
 
 registerCleanupFunction(function() {
   gTab = null;
-  gDebuggee = null;
   gPanel = null;
   gDebugger = null;
   gSearchBox = null;
 });
--- a/browser/devtools/debugger/test/browser_dbg_pretty-print-05.js
+++ b/browser/devtools/debugger/test/browser_dbg_pretty-print-05.js
@@ -2,23 +2,22 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Make sure that prettifying HTML sources doesn't do anything.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_included-script.html";
 
-let gTab, gDebuggee, gPanel, gDebugger;
+let gTab, gPanel, gDebugger;
 let gEditor, gSources, gControllerSources;
 
 function test() {
-  initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
+  initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
     gTab = aTab;
-    gDebuggee = aDebuggee;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gEditor = gDebugger.DebuggerView.editor;
     gSources = gDebugger.DebuggerView.Sources;
     gControllerSources = gDebugger.DebuggerController.SourceScripts;
 
     Task.spawn(function() {
       yield waitForSourceShown(gPanel, TAB_URL);
@@ -63,15 +62,14 @@ function clickPrettyPrintButton() {
 }
 
 function prepareDebugger(aPanel) {
   aPanel._view.Sources.preferredSource = TAB_URL;
 }
 
 registerCleanupFunction(function() {
   gTab = null;
-  gDebuggee = null;
   gPanel = null;
   gDebugger = null;
   gEditor = null;
   gSources = null;
   gControllerSources = null;
 });
--- a/browser/devtools/debugger/test/browser_dbg_pretty-print-06.js
+++ b/browser/devtools/debugger/test/browser_dbg_pretty-print-06.js
@@ -3,23 +3,22 @@
 
 /**
  * Make sure that prettifying JS sources with type errors works as expected.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_included-script.html";
 const JS_URL = EXAMPLE_URL + "code_location-changes.js";
 
-let gTab, gDebuggee, gPanel, gDebugger, gClient;
+let gTab, gPanel, gDebugger, gClient;
 let gEditor, gSources, gControllerSources, gPrettyPrinted;
 
 function test() {
-  initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
+  initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
     gTab = aTab;
-    gDebuggee = aDebuggee;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gClient = gDebugger.gClient;
     gEditor = gDebugger.DebuggerView.editor;
     gSources = gDebugger.DebuggerView.Sources;
     gControllerSources = gDebugger.DebuggerController.SourceScripts;
 
     // We can't feed javascript files with syntax errors to the debugger,
@@ -78,17 +77,16 @@ function test() {
 }
 
 function clickPrettyPrintButton() {
   gDebugger.document.getElementById("pretty-print").click();
 }
 
 registerCleanupFunction(function() {
   gTab = null;
-  gDebuggee = null;
   gPanel = null;
   gDebugger = null;
   gClient = null;
   gEditor = null;
   gSources = null;
   gControllerSources = null;
   gPrettyPrinted = null;
 });
--- a/browser/devtools/debugger/test/browser_dbg_pretty-print-07.js
+++ b/browser/devtools/debugger/test/browser_dbg_pretty-print-07.js
@@ -1,23 +1,22 @@
 /* -*- js-indent-level: 2; indent-tabs-mode: nil -*- */
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 // Test basic pretty printing functionality. Would be an xpcshell test, except
 // for bug 921252.
 
-let gTab, gDebuggee, gPanel, gClient, gThreadClient, gSource;
+let gTab, gPanel, gClient, gThreadClient, gSource;
 
 const TAB_URL = EXAMPLE_URL + "doc_pretty-print-2.html";
 
 function test() {
-  initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
+  initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
     gTab = aTab;
-    gDebuggee = aDebuggee;
     gPanel = aPanel;
     gClient = gPanel.panelWin.gClient;
     gThreadClient = gPanel.panelWin.DebuggerController.activeThread;
 
     findSource();
   });
 }
 
@@ -47,10 +46,10 @@ function disablePrettyPrint() {
 
 function testUgly({ error, source }) {
   ok(!error);
   ok(!source.contains("\n    "));
   closeDebuggerAndFinish(gPanel);
 }
 
 registerCleanupFunction(function() {
-  gTab = gDebuggee = gPanel = gClient = gThreadClient = gSource = null;
+  gTab = gPanel = gClient = gThreadClient = gSource = null;
 });
--- a/browser/devtools/debugger/test/browser_dbg_pretty-print-08.js
+++ b/browser/devtools/debugger/test/browser_dbg_pretty-print-08.js
@@ -1,27 +1,25 @@
 /* -*- js-indent-level: 2; indent-tabs-mode: nil -*- */
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 // Test stepping through pretty printed sources.
 
-let gTab, gDebuggee, gPanel, gClient, gThreadClient, gSource;
+let gTab, gPanel, gClient, gThreadClient, gSource;
 
 const TAB_URL = EXAMPLE_URL + "doc_pretty-print-2.html";
 
 function test() {
-  initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
+  initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
     gTab = aTab;
-    gDebuggee = aDebuggee;
     gPanel = aPanel;
     gClient = gPanel.panelWin.gClient;
     gThreadClient = gPanel.panelWin.DebuggerController.activeThread;
 
-    gDebuggee.noop = x => x;
     findSource();
   });
 }
 
 let CODE_URL;
 
 const BP_LOCATION = {
   line: 5,
@@ -42,17 +40,17 @@ function findSource() {
 
 function prettyPrintSource(source) {
   gThreadClient.source(gSource).prettyPrint(2, runCode);
 }
 
 function runCode({ error }) {
   ok(!error);
   gClient.addOneTimeListener("paused", testDbgStatement);
-  gDebuggee.main3();
+  callInTab(gTab, "main3");
 }
 
 function testDbgStatement(event, { why, frame }) {
   is(why.type, "debuggerStatement");
   const { url, line, column } = frame.where;
   is(url, CODE_URL);
   is(line, 3);
   setBreakpoint();
@@ -85,10 +83,10 @@ function testHitBreakpoint() {
     is(line, BP_LOCATION.line);
 
     resumeDebuggerThenCloseAndFinish(gPanel);
   });
   gThreadClient.resume();
 }
 
 registerCleanupFunction(function() {
-  gTab = gDebuggee = gPanel = gClient = gThreadClient = gSource = null;
+  gTab = gPanel = gClient = gThreadClient = gSource = null;
 });
--- a/browser/devtools/debugger/test/browser_dbg_pretty-print-09.js
+++ b/browser/devtools/debugger/test/browser_dbg_pretty-print-09.js
@@ -1,27 +1,25 @@
 /* -*- js-indent-level: 2; indent-tabs-mode: nil -*- */
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 // Test pretty printing source mapped sources.
 
-var gDebuggee;
 var gClient;
 var gThreadClient;
 var gSource;
 
-let gTab, gDebuggee, gPanel, gClient, gThreadClient, gSource;
+let gTab, gPanel, gClient, gThreadClient, gSource;
 
 const TAB_URL = EXAMPLE_URL + "doc_pretty-print-2.html";
 
 function test() {
-  initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
+  initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
     gTab = aTab;
-    gDebuggee = aDebuggee;
     gPanel = aPanel;
     gClient = gPanel.panelWin.gClient;
     gThreadClient = gPanel.panelWin.DebuggerController.activeThread;
 
     findSource();
   });
 }
 
@@ -45,17 +43,17 @@ function findSource() {
 
 function prettyPrint() {
   gThreadClient.source(gSource).prettyPrint(2, runCode);
 }
 
 function runCode({ error }) {
   ok(!error);
   gClient.addOneTimeListener("paused", testDbgStatement);
-  gDebuggee.a();
+  callInTab(gTab, "a");
 }
 
 function testDbgStatement(event, { frame, why }) {
   is(why.type, "debuggerStatement");
   const { url, line } = frame.where;
   is(url, B_URL);
   is(line, 2);
 
@@ -80,10 +78,10 @@ function testFrame({ frames: [frame] }) 
   const { url, line } = frame.where;
   is(url, B_URL);
   is(line, 1);
 
   resumeDebuggerThenCloseAndFinish(gPanel);
 }
 
 registerCleanupFunction(function() {
-  gTab = gDebuggee = gPanel = gClient = gThreadClient = null;
+  gTab = gPanel = gClient = gThreadClient = null;
 });
--- a/browser/devtools/debugger/test/browser_dbg_pretty-print-10.js
+++ b/browser/devtools/debugger/test/browser_dbg_pretty-print-10.js
@@ -3,23 +3,22 @@
 
 /**
  * Make sure that we disable the pretty print button for black boxed sources,
  * and that clicking it doesn't do anything.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_pretty-print.html";
 
-let gTab, gDebuggee, gPanel, gDebugger;
+let gTab, gPanel, gDebugger;
 let gEditor, gSources;
 
 function test() {
-  initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
+  initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
     gTab = aTab;
-    gDebuggee = aDebuggee;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gEditor = gDebugger.DebuggerView.editor;
     gSources = gDebugger.DebuggerView.Sources;
 
     waitForSourceShown(gPanel, "code_ugly.js")
       .then(testSourceIsUgly)
       .then(toggleBlackBoxing.bind(null, gPanel))
@@ -50,14 +49,13 @@ function testSourceIsStillUgly() {
   const { source } = gSources.selectedItem.attachment;
   return gDebugger.DebuggerController.SourceScripts.getText(source).then(([, text]) => {
     ok(!text.contains("\n    "));
   });
 }
 
 registerCleanupFunction(function() {
   gTab = null;
-  gDebuggee = null;
   gPanel = null;
   gDebugger = null;
   gEditor = null;
   gSources = null;
 });
--- a/browser/devtools/debugger/test/browser_dbg_pretty-print-11.js
+++ b/browser/devtools/debugger/test/browser_dbg_pretty-print-11.js
@@ -2,23 +2,22 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Make sure that pretty printing is maintained across refreshes.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_pretty-print.html";
 
-let gTab, gDebuggee, gPanel, gDebugger;
+let gTab, gPanel, gDebugger;
 let gEditor, gSources;
 
 function test() {
-  initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
+  initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
     gTab = aTab;
-    gDebuggee = aDebuggee;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gEditor = gDebugger.DebuggerView.editor;
     gSources = gDebugger.DebuggerView.Sources;
 
     waitForSourceShown(gPanel, "code_ugly.js")
       .then(testSourceIsUgly)
       .then(() => {
@@ -47,14 +46,13 @@ function clickPrettyPrintButton() {
 
 function testSourceIsPretty() {
   ok(gEditor.getText().contains("\n  "),
      "The source should be pretty printed.")
 }
 
 registerCleanupFunction(function() {
   gTab = null;
-  gDebuggee = null;
   gPanel = null;
   gDebugger = null;
   gEditor = null;
   gSources = null;
 });
--- a/browser/devtools/debugger/test/browser_dbg_pretty-print-12.js
+++ b/browser/devtools/debugger/test/browser_dbg_pretty-print-12.js
@@ -3,23 +3,22 @@
 
 /**
  * Make sure that we don't leave the pretty print button checked when we fail to
  * pretty print a source (because it isn't a JS file, for example).
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_blackboxing.html";
 
-let gTab, gDebuggee, gPanel, gDebugger;
+let gTab, gPanel, gDebugger;
 let gEditor, gSources;
 
 function test() {
-  initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
+  initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
     gTab = aTab;
-    gDebuggee = aDebuggee;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gEditor = gDebugger.DebuggerView.editor;
     gSources = gDebugger.DebuggerView.Sources;
 
     waitForSourceShown(gPanel, "")
       .then(() => {
         let shown = ensureSourceIs(gPanel, TAB_URL, true)
@@ -41,14 +40,13 @@ function clickPrettyPrintButton() {
 
 function testButtonIsntChecked() {
   is(gDebugger.document.getElementById("pretty-print").checked, false,
      "The button shouldn't be checked after trying to pretty print a non-js file.");
 }
 
 registerCleanupFunction(function() {
   gTab = null;
-  gDebuggee = null;
   gPanel = null;
   gDebugger = null;
   gEditor = null;
   gSources = null;
 });
--- a/browser/devtools/debugger/test/browser_dbg_pretty-print-13.js
+++ b/browser/devtools/debugger/test/browser_dbg_pretty-print-13.js
@@ -4,23 +4,22 @@
 /**
  * Make sure that clicking the pretty print button prettifies the source, even
  * when the source URL does not end in ".js", but the content type is
  * JavaScript.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_pretty-print-3.html";
 
-let gTab, gDebuggee, gPanel, gDebugger;
+let gTab, gPanel, gDebugger;
 let gEditor, gSources;
 
 function test() {
-  initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
+  initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
     gTab = aTab;
-    gDebuggee = aDebuggee;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gEditor = gDebugger.DebuggerView.editor;
     gSources = gDebugger.DebuggerView.Sources;
 
     promise.all([waitForSourceShown(gPanel, "code_ugly-8"),
                  waitForEditorLocationSet(gPanel)])
       .then(testSourceIsUgly)
@@ -74,14 +73,13 @@ function testSourceIsStillPretty() {
     deferred.resolve();
   });
 
   return deferred.promise;
 }
 
 registerCleanupFunction(function() {
   gTab = null;
-  gDebuggee = null;
   gPanel = null;
   gDebugger = null;
   gEditor = null;
   gSources = null;
 });
--- a/browser/devtools/debugger/test/browser_dbg_pretty-print-on-paused.js
+++ b/browser/devtools/debugger/test/browser_dbg_pretty-print-on-paused.js
@@ -3,24 +3,23 @@
 
 /**
  * Test that pretty printing when the debugger is paused does not switch away
  * from the selected source.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_pretty-print-on-paused.html";
 
-let gTab, gDebuggee, gPanel, gDebugger, gThreadClient, gSources;
+let gTab, gPanel, gDebugger, gThreadClient, gSources;
 
 const SECOND_SOURCE_VALUE = EXAMPLE_URL + "code_ugly-2.js";
 
 function test(){
-  initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
+  initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
     gTab = aTab;
-    gDebuggee = aDebuggee;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gThreadClient = gDebugger.gThreadClient;
     gSources = gDebugger.DebuggerView.Sources;
 
     Task.spawn(function* () {
       try {
         yield ensureSourceIs(gPanel, "code_script-switching-02.js", true);
@@ -28,19 +27,17 @@ function test(){
         yield doInterrupt(gPanel);
         yield rdpInvoke(gThreadClient, gThreadClient.setBreakpoint, {
           url: gSources.selectedValue,
           line: 6
         });
         yield doResume(gPanel);
 
         const bpHit = waitForCaretAndScopes(gPanel, 6);
-        // Get the debuggee call off this tick so that we aren't accidentally
-        // blocking the yielding of bpHit which causes a deadlock.
-        executeSoon(() => gDebuggee.secondCall());
+        callInTab(gTab, "secondCall");
         yield bpHit;
 
         info("Switch to the second source.");
         const sourceShown = waitForSourceShown(gPanel, SECOND_SOURCE_VALUE);
         gSources.selectedValue = SECOND_SOURCE_VALUE;
         yield sourceShown;
 
         info("Pretty print the source.");
@@ -54,14 +51,13 @@ function test(){
         ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
       }
     });
   });
 }
 
 registerCleanupFunction(function() {
   gTab = null;
-  gDebuggee = null;
   gPanel = null;
   gDebugger = null;
   gThreadClient = null;
   gSources = null;
 });
--- a/browser/devtools/debugger/test/doc_pretty-print-2.html
+++ b/browser/devtools/debugger/test/doc_pretty-print-2.html
@@ -3,8 +3,13 @@
 <!DOCTYPE html>
 <head>
   <meta charset="utf-8"/>
   <title>Debugger Pretty Printing Test Page</title>
 </head>
 <script src="code_ugly-2.js"></script>
 <script src="code_ugly-3.js"></script>
 <script src="code_ugly-4.js"></script>
+<script>
+  function noop(x) {
+    return x;
+  }
+</script>