Bug 1090929 - Enable the variables-view-* tests;r=fitzgen
authorEddy Bruël <ejpbruel@gmail.com>
Thu, 13 Nov 2014 19:23:31 +0100
changeset 215636 574f00fee84d84f73c466077b0e7c931f5dd0bc0
parent 215542 292ed84594c153f7e246ef6d5e5d9089e5305760
child 215637 767ad1362a2dc628a054d6a8afb71a9b6036e0f2
push id27823
push usercbook@mozilla.com
push dateFri, 14 Nov 2014 11:59:57 +0000
treeherdermozilla-central@bbb68df450c2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfitzgen
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 variables-view-* tests;r=fitzgen
browser/devtools/debugger/test/browser.ini
browser/devtools/debugger/test/browser_dbg_variables-view-accessibility.js
browser/devtools/debugger/test/browser_dbg_variables-view-data.js
browser/devtools/debugger/test/browser_dbg_variables-view-edit-cancel.js
browser/devtools/debugger/test/browser_dbg_variables-view-edit-getset-01.js
browser/devtools/debugger/test/browser_dbg_variables-view-edit-getset-02.js
browser/devtools/debugger/test/browser_dbg_variables-view-edit-value.js
browser/devtools/debugger/test/browser_dbg_variables-view-edit-watch.js
browser/devtools/debugger/test/browser_dbg_variables-view-filter-pref.js
browser/devtools/debugger/test/browser_dbg_variables-view-filter-searchbox.js
browser/devtools/debugger/test/browser_dbg_variables-view-frame-parameters-01.js
browser/devtools/debugger/test/browser_dbg_variables-view-frame-parameters-02.js
browser/devtools/debugger/test/browser_dbg_variables-view-frame-parameters-03.js
browser/devtools/debugger/test/browser_dbg_variables-view-frame-with.js
browser/devtools/debugger/test/browser_dbg_variables-view-frozen-sealed-nonext.js
browser/devtools/debugger/test/browser_dbg_variables-view-hide-non-enums.js
browser/devtools/debugger/test/browser_dbg_variables-view-large-array-buffer.js
browser/devtools/debugger/test/browser_dbg_variables-view-override-01.js
browser/devtools/debugger/test/browser_dbg_variables-view-override-02.js
browser/devtools/debugger/test/browser_dbg_variables-view-reexpand-01.js
browser/devtools/debugger/test/browser_dbg_variables-view-reexpand-02.js
browser/devtools/debugger/test/browser_dbg_variables-view-reexpand-03.js
browser/devtools/debugger/test/browser_dbg_variables-view-webidl.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
@@ -453,63 +453,63 @@ skip-if = e10s && debug
 skip-if = e10s && debug
 [browser_dbg_variables-view-04.js]
 skip-if = e10s && debug
 [browser_dbg_variables-view-05.js]
 skip-if = e10s && debug
 [browser_dbg_variables-view-06.js]
 skip-if = e10s && debug
 [browser_dbg_variables-view-accessibility.js]
-skip-if = e10s
+skip-if = e10s && debug
 [browser_dbg_variables-view-data.js]
-skip-if = e10s
+skip-if = e10s && debug
 [browser_dbg_variables-view-edit-cancel.js]
-skip-if = e10s
+skip-if = e10s && debug
 [browser_dbg_variables-view-edit-click.js]
 skip-if = e10s || (os == 'mac' || os == 'win') && (debug == false) # Bug 986166
 [browser_dbg_variables-view-edit-getset-01.js]
-skip-if = e10s
+skip-if = e10s && debug
 [browser_dbg_variables-view-edit-getset-02.js]
-skip-if = e10s
+skip-if = e10s && debug
 [browser_dbg_variables-view-edit-value.js]
-skip-if = e10s
+skip-if = e10s && debug
 [browser_dbg_variables-view-edit-watch.js]
-skip-if = e10s
+skip-if = e10s && debug
 [browser_dbg_variables-view-filter-01.js]
 skip-if = e10s && debug
 [browser_dbg_variables-view-filter-02.js]
 skip-if = e10s && debug
 [browser_dbg_variables-view-filter-03.js]
 skip-if = e10s && debug
 [browser_dbg_variables-view-filter-04.js]
 skip-if = e10s && debug
 [browser_dbg_variables-view-filter-05.js]
 skip-if = e10s && debug
 [browser_dbg_variables-view-filter-pref.js]
-skip-if = e10s
+skip-if = e10s && debug
 [browser_dbg_variables-view-filter-searchbox.js]
-skip-if = e10s
+skip-if = e10s && debug
 [browser_dbg_variables-view-frame-parameters-01.js]
-skip-if = e10s
+skip-if = e10s && debug
 [browser_dbg_variables-view-frame-parameters-02.js]
-skip-if = e10s
+skip-if = e10s && debug
 [browser_dbg_variables-view-frame-parameters-03.js]
-skip-if = e10s
+skip-if = e10s && debug
 [browser_dbg_variables-view-frame-with.js]
-skip-if = e10s
+skip-if = e10s && debug
 [browser_dbg_variables-view-frozen-sealed-nonext.js]
-skip-if = e10s || buildapp == 'mulet'
+skip-if = e10s && debug || buildapp == 'mulet'
 [browser_dbg_variables-view-hide-non-enums.js]
-skip-if = e10s
+skip-if = e10s && debug
 [browser_dbg_variables-view-large-array-buffer.js]
-skip-if = e10s
+skip-if = e10s && debug
 [browser_dbg_variables-view-override-01.js]
-skip-if = e10s
+skip-if = e10s && debug
 [browser_dbg_variables-view-override-02.js]
-skip-if = e10s
+skip-if = e10s && debug
 [browser_dbg_variables-view-popup-01.js]
 skip-if = e10s && debug
 [browser_dbg_variables-view-popup-02.js]
 skip-if = e10s && debug
 [browser_dbg_variables-view-popup-03.js]
 skip-if = e10s && debug
 [browser_dbg_variables-view-popup-04.js]
 skip-if = e10s && debug
@@ -533,19 +533,19 @@ skip-if = e10s && debug
 skip-if = e10s && debug
 [browser_dbg_variables-view-popup-14.js]
 skip-if = e10s && debug
 [browser_dbg_variables-view-popup-15.js]
 skip-if = e10s && debug
 [browser_dbg_variables-view-popup-16.js]
 skip-if = e10s  && debug
 [browser_dbg_variables-view-reexpand-01.js]
-skip-if = e10s
+skip-if = e10s && debug
 [browser_dbg_variables-view-reexpand-02.js]
-skip-if = e10s
+skip-if = e10s && debug
 [browser_dbg_variables-view-reexpand-03.js]
-skip-if = e10s
+skip-if = e10s && debug
 [browser_dbg_variables-view-webidl.js]
-skip-if = e10s
+skip-if = e10s && debug
 [browser_dbg_watch-expressions-01.js]
 skip-if = e10s
 [browser_dbg_watch-expressions-02.js]
 skip-if = e10s
--- a/browser/devtools/debugger/test/browser_dbg_variables-view-accessibility.js
+++ b/browser/devtools/debugger/test/browser_dbg_variables-view-accessibility.js
@@ -1,22 +1,21 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Make sure that the variables view is keyboard accessible.
  */
 
-let gTab, gDebuggee, gPanel, gDebugger;
+let gTab, gPanel, gDebugger;
 let gVariablesView;
 
 function test() {
-  initDebugger("about:blank").then(([aTab, aDebuggee, aPanel]) => {
+  initDebugger("about:blank").then(([aTab,, aPanel]) => {
     gTab = aTab;
-    gDebuggee = aDebuggee;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gVariablesView = gDebugger.DebuggerView.Variables;
 
     performTest().then(null, aError => {
       ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
     });
   });
@@ -499,17 +498,16 @@ function performTest() {
     }
 
     yield closeDebuggerAndFinish(gPanel);
   });
 }
 
 registerCleanupFunction(function() {
   gTab = null;
-  gDebuggee = null;
   gPanel = null;
   gDebugger = null;
   gVariablesView = null;
 });
 
 function synthesizeKeyAndWaitForElement(aKey, aModifiers, aSelector, aExistence) {
   EventUtils.synthesizeKey(aKey, aModifiers, gDebugger);
   return waitForElement(aSelector, aExistence);
--- a/browser/devtools/debugger/test/browser_dbg_variables-view-data.js
+++ b/browser/devtools/debugger/test/browser_dbg_variables-view-data.js
@@ -1,23 +1,22 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Make sure that the variables view correctly populates itself
  * when given some raw data.
  */
 
-let gTab, gDebuggee, gPanel, gDebugger;
+let gTab, gPanel, gDebugger;
 let gVariablesView, gScope, gVariable;
 
 function test() {
-  initDebugger("about:blank").then(([aTab, aDebuggee, aPanel]) => {
+  initDebugger("about:blank").then(([aTab,, aPanel]) => {
     gTab = aTab;
-    gDebuggee = aDebuggee;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gVariablesView = gDebugger.DebuggerView.Variables;
 
     performTest();
   });
 }
 
@@ -597,15 +596,14 @@ function testClearHierarchy() {
   ok(!gVariablesView._prevHierarchy.size,
     "The previous hierarchy should have been cleared.");
   ok(!gVariablesView._currHierarchy.size,
     "The current hierarchy should have been cleared.");
 }
 
 registerCleanupFunction(function() {
   gTab = null;
-  gDebuggee = null;
   gPanel = null;
   gDebugger = null;
   gVariablesView = null;
   gScope = null;
   gVariable = null;
 });
--- a/browser/devtools/debugger/test/browser_dbg_variables-view-edit-cancel.js
+++ b/browser/devtools/debugger/test/browser_dbg_variables-view-edit-cancel.js
@@ -5,24 +5,23 @@
  * Make sure that canceling a name change correctly unhides the separator and
  * value elements.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_watch-expressions.html";
 
 function test() {
   Task.spawn(function*() {
-    let [tab, debuggee, panel] = yield initDebugger(TAB_URL);
+    let [tab,, panel] = yield initDebugger(TAB_URL);
     let win = panel.panelWin;
     let vars = win.DebuggerView.Variables;
 
     win.DebuggerView.WatchExpressions.addExpression("this");
 
-    // Allow this generator function to yield first.
-    executeSoon(() => debuggee.ermahgerd());
+    callInTab(tab, "ermahgerd");
     yield waitForDebuggerEvents(panel, win.EVENTS.FETCHED_WATCH_EXPRESSIONS);
 
     let exprScope = vars.getScopeAtIndex(0);
     let {target} = exprScope.get("this");
 
     let name = target.querySelector(".title > .name");
     let separator = target.querySelector(".separator");
     let value = target.querySelector(".value");
--- a/browser/devtools/debugger/test/browser_dbg_variables-view-edit-getset-01.js
+++ b/browser/devtools/debugger/test/browser_dbg_variables-view-edit-getset-01.js
@@ -2,26 +2,25 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Make sure that the variables view knows how to edit getters and setters.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_frame-parameters.html";
 
-let gTab, gDebuggee, gPanel, gDebugger;
+let gTab, gPanel, gDebugger;
 let gL10N, gEditor, gVars, gWatch;
 
 function test() {
   // Debug test slaves are a bit slow at this test.
   requestLongerTimeout(2);
 
-  initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
+  initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
     gTab = aTab;
-    gDebuggee = aDebuggee;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gL10N = gDebugger.L10N;
     gEditor = gDebugger.DebuggerView.editor;
     gVars = gDebugger.DebuggerView.Variables;
     gWatch = gDebugger.DebuggerView.WatchExpressions;
 
     gVars.switch = function() {};
@@ -110,19 +109,17 @@ function test() {
       }))
       .then(() => deleteLastWatchExpression("myVar.prop"))
       .then(() => testWatchExpressionsRemoved())
       .then(() => resumeDebuggerThenCloseAndFinish(gPanel))
       .then(null, aError => {
         ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
       });
 
-    EventUtils.sendMouseEvent({ type: "click" },
-      gDebuggee.document.querySelector("button"),
-      gDebuggee);
+    sendMouseClickToTab(gTab, content.document.querySelector("button"));
   });
 }
 
 function addWatchExpressions() {
   return promise.resolve(null)
     .then(() => {
       let finished = waitForDebuggerEvents(gPanel, gDebugger.EVENTS.FETCHED_WATCH_EXPRESSIONS);
       gWatch.addExpression("myVar.prop");
@@ -283,16 +280,15 @@ function testWatchExpressionsRemoved() {
   isnot(scope.name, gL10N.getStr("watchExpressionsScopeLabel"),
     "The scope's name should not be marked as 'Watch Expressions'.");
   isnot(scope._store.size, 0,
     "There should be some variables available.");
 }
 
 registerCleanupFunction(function() {
   gTab = null;
-  gDebuggee = null;
   gPanel = null;
   gDebugger = null;
   gL10N = null;
   gEditor = null;
   gVars = null;
   gWatch = null;
 });
--- a/browser/devtools/debugger/test/browser_dbg_variables-view-edit-getset-02.js
+++ b/browser/devtools/debugger/test/browser_dbg_variables-view-edit-getset-02.js
@@ -3,26 +3,25 @@
 
 /**
  * Make sure that the variables view is able to override getter properties
  * to plain value properties.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_frame-parameters.html";
 
-let gTab, gDebuggee, gPanel, gDebugger;
+let gTab, gPanel, gDebugger;
 let gL10N, gEditor, gVars, gWatch;
 
 function test() {
   // Debug test slaves are a bit slow at this test.
   requestLongerTimeout(2);
 
-  initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
+  initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
     gTab = aTab;
-    gDebuggee = aDebuggee;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gL10N = gDebugger.L10N;
     gEditor = gDebugger.DebuggerView.editor;
     gVars = gDebugger.DebuggerView.Variables;
     gWatch = gDebugger.DebuggerView.WatchExpressions;
 
     gVars.switch = function() {};
@@ -31,19 +30,17 @@ function test() {
     waitForSourceAndCaretAndScopes(gPanel, ".html", 24)
       .then(() => addWatchExpression())
       .then(() => testEdit("\"xlerb\"", "xlerb"))
       .then(() => resumeDebuggerThenCloseAndFinish(gPanel))
       .then(null, aError => {
         ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
       });
 
-    EventUtils.sendMouseEvent({ type: "click" },
-      gDebuggee.document.querySelector("button"),
-      gDebuggee);
+    sendMouseClickToTab(gTab, content.document.querySelector("button"));
   });
 }
 
 function addWatchExpression() {
   let finished = waitForDebuggerEvents(gPanel, gDebugger.EVENTS.FETCHED_WATCH_EXPRESSIONS);
 
   gWatch.addExpression("myVar.prop");
   gEditor.focus();
@@ -89,17 +86,16 @@ function testEdit(aString, aExpected) {
   myVar.expand();
   gVars.clearHierarchy();
 
   return finished;
 }
 
 registerCleanupFunction(function() {
   gTab = null;
-  gDebuggee = null;
   gPanel = null;
   gDebugger = null;
   gL10N = null;
   gEditor = null;
   gVars = null;
   gWatch = null;
 });
 
--- a/browser/devtools/debugger/test/browser_dbg_variables-view-edit-value.js
+++ b/browser/devtools/debugger/test/browser_dbg_variables-view-edit-value.js
@@ -2,23 +2,22 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Make sure that the editing variables or properties values works properly.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_frame-parameters.html";
 
-let gTab, gDebuggee, gPanel, gDebugger;
+let gTab, gPanel, gDebugger;
 let gVars;
 
 function test() {
-  initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
+  initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
     gTab = aTab;
-    gDebuggee = aDebuggee;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gVars = gDebugger.DebuggerView.Variables;
 
     waitForSourceAndCaretAndScopes(gPanel, ".html", 24)
       .then(() => initialChecks())
       .then(() => testModification("a", "1"))
       .then(() => testModification("{ a: 1 }", "Object"))
@@ -33,19 +32,17 @@ function test() {
       .then(() => testModification("-0", "-0"))
       .then(() => testModification("Object.keys({})", "Array[0]"))
       .then(() => testModification("document.title", '"Debugger test page"'))
       .then(() => resumeDebuggerThenCloseAndFinish(gPanel))
       .then(null, aError => {
         ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
       });
 
-    EventUtils.sendMouseEvent({ type: "click" },
-      gDebuggee.document.querySelector("button"),
-      gDebuggee);
+    sendMouseClickToTab(gTab, content.document.querySelector("button"));
   });
 }
 
 function initialChecks() {
   let localScope = gVars.getScopeAtIndex(0);
   let aVar = localScope.get("a");
 
   is(aVar.target.querySelector(".name").getAttribute("value"), "a",
@@ -77,13 +74,12 @@ function testModification(aNewValue, aNe
       "Should have the right name for 'a'.");
     is(aVar.target.querySelector(".value").getAttribute("value"), aNewResult,
       "Should have the right new value for 'a'.");
   });
 }
 
 registerCleanupFunction(function() {
   gTab = null;
-  gDebuggee = null;
   gPanel = null;
   gDebugger = null;
   gVars = null;
 });
--- a/browser/devtools/debugger/test/browser_dbg_variables-view-edit-watch.js
+++ b/browser/devtools/debugger/test/browser_dbg_variables-view-edit-watch.js
@@ -2,23 +2,22 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Make sure that the editing or removing watch expressions works properly.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_watch-expressions.html";
 
-let gTab, gDebuggee, gPanel, gDebugger;
+let gTab, gPanel, gDebugger;
 let gL10N, gEditor, gVars, gWatch;
 
 function test() {
-  initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
+  initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
     gTab = aTab;
-    gDebuggee = aDebuggee;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gL10N = gDebugger.L10N;
     gEditor = gDebugger.DebuggerView.editor;
     gVars = gDebugger.DebuggerView.Variables;
     gWatch = gDebugger.DebuggerView.WatchExpressions;
 
     waitForDebuggerEvents(gPanel, gDebugger.EVENTS.FETCHED_WATCH_EXPRESSIONS)
@@ -39,17 +38,17 @@ function test() {
       .then(() => testExprFinalDeletion("ermahgerd", "44"))
       .then(() => testIntegrity7())
       .then(() => resumeDebuggerThenCloseAndFinish(gPanel))
       .then(null, aError => {
         ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
       });
 
     addExpressions();
-    gDebuggee.ermahgerd();
+    callInTab(gTab, "ermahgerd");
   });
 }
 
 function addExpressions() {
   addExpression("this");
   addExpression("ermahgerd");
   addExpression("aArg");
   addExpression("document.title");
@@ -489,16 +488,15 @@ function addExpression(aString) {
 
 function addCmdExpression(aString) {
   gWatch._onCmdAddExpression(aString);
   gEditor.focus();
 }
 
 registerCleanupFunction(function() {
   gTab = null;
-  gDebuggee = null;
   gPanel = null;
   gDebugger = null;
   gL10N = null;
   gEditor = null;
   gVars = null;
   gWatch = null;
 });
--- a/browser/devtools/debugger/test/browser_dbg_variables-view-filter-pref.js
+++ b/browser/devtools/debugger/test/browser_dbg_variables-view-filter-pref.js
@@ -2,23 +2,22 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Make sure that the variables view filter prefs work properly.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_with-frame.html";
 
-let gTab, gDebuggee, gPanel, gDebugger;
+let gTab, gPanel, gDebugger;
 let gPrefs, gOptions, gVariables;
 
 function test() {
-  initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
+  initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
     gTab = aTab;
-    gDebuggee = aDebuggee;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gPrefs = gDebugger.Prefs;
     gOptions = gDebugger.DebuggerView.Options;
     gVariables = gDebugger.DebuggerView.Variables;
 
     waitForSourceShown(gPanel, ".html").then(performTest);
   });
@@ -67,15 +66,14 @@ function performTest() {
   isnot(gOptions._showVariablesFilterBoxItem.getAttribute("checked"), "true",
     "The options menu item should now be unchecked.");
 
   closeDebuggerAndFinish(gPanel);
 }
 
 registerCleanupFunction(function() {
   gTab = null;
-  gDebuggee = null;
   gPanel = null;
   gDebugger = null;
   gPrefs = null;
   gOptions = null;
   gVariables = null;
 });
--- a/browser/devtools/debugger/test/browser_dbg_variables-view-filter-searchbox.js
+++ b/browser/devtools/debugger/test/browser_dbg_variables-view-filter-searchbox.js
@@ -3,23 +3,22 @@
 
 /**
  * Make sure that the variables view correctly shows the searchbox
  * when prompted.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_with-frame.html";
 
-let gTab, gDebuggee, gPanel, gDebugger;
+let gTab, gPanel, gDebugger;
 let gVariables;
 
 function test() {
-  initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
+  initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
     gTab = aTab;
-    gDebuggee = aDebuggee;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gVariables = gDebugger.DebuggerView.Variables;
 
     waitForSourceShown(gPanel, ".html").then(performTest);
   });
 }
 
@@ -134,13 +133,12 @@ function performTest() {
   is(gVariables._searchboxNode.getAttribute("placeholder"),
     placeholder, "There correct placeholder should be applied to the searchbox again.");
 
   closeDebuggerAndFinish(gPanel);
 }
 
 registerCleanupFunction(function() {
   gTab = null;
-  gDebuggee = null;
   gPanel = null;
   gDebugger = null;
   gVariables = null;
 });
--- a/browser/devtools/debugger/test/browser_dbg_variables-view-frame-parameters-01.js
+++ b/browser/devtools/debugger/test/browser_dbg_variables-view-frame-parameters-01.js
@@ -3,41 +3,38 @@
 
 /**
  * Make sure that the variables view correctly displays the properties
  * of objects when debugger is paused.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_frame-parameters.html";
 
-let gTab, gDebuggee, gPanel, gDebugger;
+let gTab, gPanel, gDebugger;
 let gVariables;
 
 function test() {
   // Debug test slaves are a bit slow at this test.
   requestLongerTimeout(2);
 
-  initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
+  initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
     gTab = aTab;
-    gDebuggee = aDebuggee;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gVariables = gDebugger.DebuggerView.Variables;
 
     waitForSourceAndCaretAndScopes(gPanel, ".html", 24)
       .then(initialChecks)
       .then(testExpandVariables)
       .then(() => resumeDebuggerThenCloseAndFinish(gPanel))
       .then(null, aError => {
         ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
       });
 
-    EventUtils.sendMouseEvent({ type: "click" },
-      gDebuggee.document.querySelector("button"),
-      gDebuggee);
+    sendMouseClickToTab(gTab, content.document.querySelector("button"));
   });
 }
 
 function initialChecks() {
   let scopeNodes = gDebugger.document.querySelectorAll(".variables-view-scope");
   is(scopeNodes.length, 2,
     "There should be 2 scopes available.");
 
@@ -248,13 +245,12 @@ function testExpandVariables() {
   is(argsVar.expanded, true,
     "The argsVar should be immediately marked as expanded.");
   is(cVar.expanded, true,
     "The cVar should be immediately marked as expanded.");
 }
 
 registerCleanupFunction(function() {
   gTab = null;
-  gDebuggee = null;
   gPanel = null;
   gDebugger = null;
   gVariables = null;
 });
--- a/browser/devtools/debugger/test/browser_dbg_variables-view-frame-parameters-02.js
+++ b/browser/devtools/debugger/test/browser_dbg_variables-view-frame-parameters-02.js
@@ -3,26 +3,25 @@
 
 /**
  * Make sure that the variables view displays the right variables and
  * properties when debugger is paused.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_frame-parameters.html";
 
-let gTab, gDebuggee, gPanel, gDebugger;
+let gTab, gPanel, gDebugger;
 let gVariables;
 
 function test() {
   // Debug test slaves are a bit slow at this test.
   requestLongerTimeout(2);
 
-  initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
+  initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
     gTab = aTab;
-    gDebuggee = aDebuggee;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gVariables = gDebugger.DebuggerView.Variables;
 
     waitForSourceAndCaretAndScopes(gPanel, ".html", 24)
       .then(testScopeVariables)
       .then(testArgumentsProperties)
       .then(testSimpleObject)
@@ -30,19 +29,17 @@ function test() {
       .then(testArgumentObject)
       .then(testInnerArgumentObject)
       .then(testGetterSetterObject)
       .then(() => resumeDebuggerThenCloseAndFinish(gPanel))
       .then(null, aError => {
         ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
       });
 
-    EventUtils.sendMouseEvent({ type: "click" },
-      gDebuggee.document.querySelector("button"),
-      gDebuggee);
+    sendMouseClickToTab(gTab, content.document.querySelector("button"));
   });
 }
 
 function testScopeVariables() {
   let localScope = gVariables.getScopeAtIndex(0);
   is(localScope.expanded, true,
     "The local scope should be expanded by default.");
 
@@ -538,13 +535,12 @@ function testGetterSetterObject() {
   });
 
   myVar.expand();
   return deferred.promise;
 }
 
 registerCleanupFunction(function() {
   gTab = null;
-  gDebuggee = null;
   gPanel = null;
   gDebugger = null;
   gVariables = null;
 });
--- a/browser/devtools/debugger/test/browser_dbg_variables-view-frame-parameters-03.js
+++ b/browser/devtools/debugger/test/browser_dbg_variables-view-frame-parameters-03.js
@@ -3,43 +3,40 @@
 
 /**
  * Make sure that the variables view displays the right variables and
  * properties in the global scope when debugger is paused.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_frame-parameters.html";
 
-let gTab, gDebuggee, gPanel, gDebugger;
+let gTab, gPanel, gDebugger;
 let gVariables;
 
 function test() {
   // Debug test slaves are a bit slow at this test.
   requestLongerTimeout(2);
 
-  initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
+  initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
     gTab = aTab;
-    gDebuggee = aDebuggee;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gVariables = gDebugger.DebuggerView.Variables;
 
     waitForSourceAndCaretAndScopes(gPanel, ".html", 24)
       .then(expandGlobalScope)
       .then(testGlobalScope)
       .then(expandWindowVariable)
       .then(testWindowVariable)
       .then(() => resumeDebuggerThenCloseAndFinish(gPanel))
       .then(null, aError => {
         ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
       });
 
-    EventUtils.sendMouseEvent({ type: "click" },
-      gDebuggee.document.querySelector("button"),
-      gDebuggee);
+    sendMouseClickToTab(gTab, content.document.querySelector("button"));
   });
 }
 
 function expandGlobalScope() {
   let deferred = promise.defer();
 
   let globalScope = gVariables.getScopeAtIndex(1);
   is(globalScope.expanded, false,
@@ -143,13 +140,12 @@ function testWindowVariable() {
   is(windowVar.get("undefined").target.querySelector(".enum").childNodes.length, 0,
     "Should have no child enumerable properties for 'undefined'.");
   is(windowVar.get("undefined").target.querySelector(".nonenum").childNodes.length, 0,
     "Should have no child non-enumerable properties for 'undefined'.");
 }
 
 registerCleanupFunction(function() {
   gTab = null;
-  gDebuggee = null;
   gPanel = null;
   gDebugger = null;
   gVariables = null;
 });
--- a/browser/devtools/debugger/test/browser_dbg_variables-view-frame-with.js
+++ b/browser/devtools/debugger/test/browser_dbg_variables-view-frame-with.js
@@ -2,23 +2,22 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Make sure that the variables view is correctly populated in 'with' frames.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_with-frame.html";
 
-let gTab, gDebuggee, gPanel, gDebugger;
+let gTab, gPanel, gDebugger;
 let gVariables;
 
 function test() {
-  initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
+  initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
     gTab = aTab;
-    gDebuggee = aDebuggee;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gVariables = gDebugger.DebuggerView.Variables;
 
     // The first 'with' scope should be expanded by default, but the
     // variables haven't been fetched yet. This is how 'with' scopes work.
     promise.all([
       waitForSourceAndCaret(gPanel, ".html", 22),
@@ -29,19 +28,17 @@ function test() {
       .then(testSecondWithScope)
       .then(expandFunctionScope)
       .then(testFunctionScope)
       .then(() => resumeDebuggerThenCloseAndFinish(gPanel))
       .then(null, aError => {
         ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
       });
 
-    EventUtils.sendMouseEvent({ type: "click" },
-      gDebuggee.document.querySelector("button"),
-      gDebuggee);
+    sendMouseClickToTab(gTab, content.document.querySelector("button"));
   });
 }
 
 function testFirstWithScope() {
   let firstWithScope = gVariables.getScopeAtIndex(0);
   is(firstWithScope.expanded, true,
     "The first 'with' scope should be expanded by default.");
   ok(firstWithScope.target.querySelector(".name").getAttribute("value").contains("[Object]"),
@@ -199,13 +196,12 @@ function testFunctionScope() {
   is(funcScope.get("foo").target.querySelector(".value").getAttribute("value"), "6.283185307179586",
     "Should have the right property value for 'foo'.");
   ok(funcScope.get("foo").target.querySelector(".value").className.contains("token-number"),
     "Should have the right token class for 'foo'.");
 }
 
 registerCleanupFunction(function() {
   gTab = null;
-  gDebuggee = null;
   gPanel = null;
   gDebugger = null;
   gVariables = null;
 });
--- a/browser/devtools/debugger/test/browser_dbg_variables-view-frozen-sealed-nonext.js
+++ b/browser/devtools/debugger/test/browser_dbg_variables-view-frozen-sealed-nonext.js
@@ -3,33 +3,32 @@
 
 /**
  * This test checks that we properly set the frozen, sealed, and non-extensbile
  * attributes on variables so that the F/S/N is shown in the variables view.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_frame-parameters.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;
 
     prepareTest();
   });
 }
 
 function prepareTest() {
   gDebugger.once(gDebugger.EVENTS.FETCHED_SCOPES, runTest);
 
-  gDebuggee.eval("(" + function() {
+  evalInTab(gTab, "(" + function() {
     var frozen = Object.freeze({});
     var sealed = Object.seal({});
     var nonExtensible = Object.preventExtensions({});
     var extensible = {};
     var string = "foo bar baz";
 
     debugger;
   } + "())");
@@ -78,12 +77,11 @@ function runTest() {
   is(Object.keys(testers).length, 0,
     "We should have run and removed all the testers.");
 
   resumeDebuggerThenCloseAndFinish(gPanel);
 }
 
 registerCleanupFunction(function() {
   gTab = null;
-  gDebuggee = null;
   gPanel = null;
   gDebugger = null;
 });
--- a/browser/devtools/debugger/test/browser_dbg_variables-view-hide-non-enums.js
+++ b/browser/devtools/debugger/test/browser_dbg_variables-view-hide-non-enums.js
@@ -3,27 +3,26 @@
 
 /**
  * Test that non-enumerable variables and properties can be hidden
  * in the variables view.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_recursion-stack.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;
 
     waitForSourceAndCaretAndScopes(gPanel, ".html", 14).then(performTest);
-    gDebuggee.simpleCall();
+    callInTab(gTab, "simpleCall");
   });
 }
 
 function performTest() {
   let testScope = gDebugger.DebuggerView.Variables.addScope("test-scope");
   let testVar = testScope.addItem("foo");
 
   testVar.addItems({
@@ -96,12 +95,11 @@ function performTest() {
     gDebugger.DebuggerView.Options._toggleShowVariablesOnlyEnum();
 
     resumeDebuggerThenCloseAndFinish(gPanel);
   });
 }
 
 registerCleanupFunction(function() {
   gTab = null;
-  gDebuggee = null;
   gPanel = null;
   gDebugger = null;
 });
--- a/browser/devtools/debugger/test/browser_dbg_variables-view-large-array-buffer.js
+++ b/browser/devtools/debugger/test/browser_dbg_variables-view-large-array-buffer.js
@@ -3,40 +3,37 @@
 
 /**
  * Make sure that the variables view remains responsive when faced with
  * huge ammounts of data.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_large-array-buffer.html";
 
-let gTab, gDebuggee, gPanel, gDebugger;
+let gTab, gPanel, gDebugger;
 let gVariables, gEllipsis;
 
 function test() {
-  initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
+  initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
     gTab = aTab;
-    gDebuggee = aDebuggee;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gVariables = gDebugger.DebuggerView.Variables;
     gEllipsis = Services.prefs.getComplexValue("intl.ellipsis", Ci.nsIPrefLocalizedString).data;
 
     waitForSourceAndCaretAndScopes(gPanel, ".html", 23)
       .then(() => initialChecks())
       .then(() => verifyFirstLevel())
       .then(() => verifyNextLevels())
       .then(() => resumeDebuggerThenCloseAndFinish(gPanel))
       .then(null, aError => {
         ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
       });
 
-    EventUtils.sendMouseEvent({ type: "click" },
-      gDebuggee.document.querySelector("button"),
-      gDebuggee);
+    sendMouseClickToTab(gTab, content.document.querySelector("button"));
   });
 }
 
 function initialChecks() {
   let localScope = gVariables.getScopeAtIndex(0);
   let bufferVar = localScope.get("buffer");
   let arrayVar = localScope.get("largeArray");
   let objectVar = localScope.get("largeObject");
@@ -230,14 +227,13 @@ function verifyNextLevels() {
   is(lastPage3._enum.querySelectorAll(".variables-view-property .value")[398].getAttribute("value"),
     1, "The properties in this level have the correct value (3).");
   is(lastPage3._enum.querySelectorAll(".variables-view-property .value")[399].getAttribute("value"),
     0, "The properties in this level have the correct value (3).");
 }
 
 registerCleanupFunction(function() {
   gTab = null;
-  gDebuggee = null;
   gPanel = null;
   gDebugger = null;
   gVariables = null;
   gEllipsis = null;
 });
--- a/browser/devtools/debugger/test/browser_dbg_variables-view-override-01.js
+++ b/browser/devtools/debugger/test/browser_dbg_variables-view-override-01.js
@@ -5,23 +5,22 @@
  * Tests that VariablesView methods responsible for styling variables
  * as overridden work properly.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_scope-variable-2.html";
 
 function test() {
   Task.spawn(function() {
-    let [tab, debuggee, panel] = yield initDebugger(TAB_URL);
+    let [tab,, panel] = yield initDebugger(TAB_URL);
     let win = panel.panelWin;
     let events = win.EVENTS;
     let variables = win.DebuggerView.Variables;
 
-    // Allow this generator function to yield first.
-    executeSoon(() => debuggee.test());
+    callInTab(tab, "test");
     yield waitForSourceAndCaretAndScopes(panel, ".html", 23);
 
     let firstScope = variables.getScopeAtIndex(0);
     let secondScope = variables.getScopeAtIndex(1);
     let thirdScope = variables.getScopeAtIndex(2);
     let globalScope = variables.getScopeAtIndex(3);
 
     ok(firstScope, "The first scope is available.");
--- a/browser/devtools/debugger/test/browser_dbg_variables-view-override-02.js
+++ b/browser/devtools/debugger/test/browser_dbg_variables-view-override-02.js
@@ -4,27 +4,26 @@
 /**
  * Tests that overridden variables in the VariablesView are styled properly.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_scope-variable-2.html";
 
 function test() {
   Task.spawn(function() {
-    let [tab, debuggee, panel] = yield initDebugger(TAB_URL);
+    let [tab,, panel] = yield initDebugger(TAB_URL);
     let win = panel.panelWin;
     let events = win.EVENTS;
     let variables = win.DebuggerView.Variables;
 
     // Wait for the hierarchy to be committed by the VariablesViewController.
     let committedLocalScopeHierarchy = promise.defer();
     variables.oncommit = committedLocalScopeHierarchy.resolve;
 
-    // Allow this generator function to yield first.
-    executeSoon(() => debuggee.test());
+    callInTab(tab, "test");
     yield waitForSourceAndCaretAndScopes(panel, ".html", 23);
     yield committedLocalScopeHierarchy.promise;
 
     let firstScope = variables.getScopeAtIndex(0);
     let secondScope = variables.getScopeAtIndex(1);
     let thirdScope = variables.getScopeAtIndex(2);
 
     let someVar1 = firstScope.get("a");
--- a/browser/devtools/debugger/test/browser_dbg_variables-view-reexpand-01.js
+++ b/browser/devtools/debugger/test/browser_dbg_variables-view-reexpand-01.js
@@ -2,26 +2,25 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Make sure that the variables view correctly re-expands nodes after pauses.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_with-frame.html";
 
-let gTab, gDebuggee, gPanel, gDebugger;
+let gTab, gPanel, gDebugger;
 let gBreakpoints, gSources, gVariables;
 
 function test() {
   // Debug test slaves are a bit slow at this test.
   requestLongerTimeout(4);
 
-  initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
+  initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
     gTab = aTab;
-    gDebuggee = aDebuggee;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gBreakpoints = gDebugger.DebuggerController.Breakpoints;
     gSources = gDebugger.DebuggerView.Sources;
     gVariables = gDebugger.DebuggerView.Variables;
 
     // Always expand all items between pauses except 'window' variables.
     gVariables.commitHierarchyIgnoredItems = Object.create(null, { window: { value: true } });
@@ -40,23 +39,17 @@ function test() {
   });
 }
 
 function addBreakpoint() {
   return gBreakpoints.addBreakpoint({ url: gSources.selectedValue, line: 21 });
 }
 
 function pauseDebuggee() {
-  // Spin the event loop before causing the debuggee to pause, to allow
-  // this function to return first.
-  executeSoon(() => {
-    EventUtils.sendMouseEvent({ type: "click" },
-      gDebuggee.document.querySelector("button"),
-      gDebuggee);
-  });
+  sendMouseClickToTab(gTab, content.document.querySelector("button"));
 
   // The first 'with' scope should be expanded by default, but the
   // variables haven't been fetched yet. This is how 'with' scopes work.
   return promise.all([
     waitForDebuggerEvents(gPanel, gDebugger.EVENTS.FETCHED_SCOPES),
     waitForDebuggerEvents(gPanel, gDebugger.EVENTS.FETCHED_VARIABLES)
   ]);
 }
@@ -195,15 +188,14 @@ function prepareVariablesAndProperties()
   functionScope.expand();
   globalScope.expand();
 
   return deferred.promise;
 }
 
 registerCleanupFunction(function() {
   gTab = null;
-  gDebuggee = null;
   gPanel = null;
   gDebugger = null;
   gBreakpoints = null;
   gSources = null;
   gVariables = null;
 });
--- a/browser/devtools/debugger/test/browser_dbg_variables-view-reexpand-02.js
+++ b/browser/devtools/debugger/test/browser_dbg_variables-view-reexpand-02.js
@@ -3,26 +3,25 @@
 
 /**
  * Make sure that the variables view correctly re-expands nodes after pauses,
  * with the caveat that there are no ignored items in the hierarchy.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_with-frame.html";
 
-let gTab, gDebuggee, gPanel, gDebugger;
+let gTab, gPanel, gDebugger;
 let gBreakpoints, gSources, gVariables;
 
 function test() {
   // Debug test slaves are a bit slow at this test.
   requestLongerTimeout(4);
 
-  initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
+  initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
     gTab = aTab;
-    gDebuggee = aDebuggee;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gBreakpoints = gDebugger.DebuggerController.Breakpoints;
     gSources = gDebugger.DebuggerView.Sources;
     gVariables = gDebugger.DebuggerView.Variables;
 
     // Always expand all items between pauses.
     gVariables.commitHierarchyIgnoredItems = Object.create(null);
@@ -41,23 +40,17 @@ function test() {
   });
 }
 
 function addBreakpoint() {
   return gBreakpoints.addBreakpoint({ url: gSources.selectedValue, line: 21 });
 }
 
 function pauseDebuggee() {
-  // Spin the event loop before causing the debuggee to pause, to allow
-  // this function to return first.
-  executeSoon(() => {
-    EventUtils.sendMouseEvent({ type: "click" },
-      gDebuggee.document.querySelector("button"),
-      gDebuggee);
-  });
+  sendMouseClickToTab(gTab, content.document.querySelector("button"));
 
   // The first 'with' scope should be expanded by default, but the
   // variables haven't been fetched yet. This is how 'with' scopes work.
   return promise.all([
     waitForDebuggerEvents(gPanel, gDebugger.EVENTS.FETCHED_SCOPES),
     waitForDebuggerEvents(gPanel, gDebugger.EVENTS.FETCHED_VARIABLES)
   ]);
 }
@@ -210,15 +203,14 @@ function prepareVariablesAndProperties()
   functionScope.expand();
   globalScope.expand();
 
   return deferred.promise;
 }
 
 registerCleanupFunction(function() {
   gTab = null;
-  gDebuggee = null;
   gPanel = null;
   gDebugger = null;
   gBreakpoints = null;
   gSources = null;
   gVariables = null;
 });
--- a/browser/devtools/debugger/test/browser_dbg_variables-view-reexpand-03.js
+++ b/browser/devtools/debugger/test/browser_dbg_variables-view-reexpand-03.js
@@ -2,26 +2,25 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Make sure that the variables view correctly re-expands *scopes* after pauses.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_scope-variable-4.html";
 
-let gTab, gDebuggee, gPanel, gDebugger;
+let gTab, gPanel, gDebugger;
 let gBreakpoints, gSources, gVariables;
 
 function test() {
   // Debug test slaves are a bit slow at this test.
   requestLongerTimeout(4);
 
-  initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
+  initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
     gTab = aTab;
-    gDebuggee = aDebuggee;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gBreakpoints = gDebugger.DebuggerController.Breakpoints;
     gSources = gDebugger.DebuggerView.Sources;
     gVariables = gDebugger.DebuggerView.Variables;
 
     // Always expand all items between pauses.
     gVariables.commitHierarchyIgnoredItems = Object.create(null);
@@ -40,21 +39,17 @@ function test() {
   });
 }
 
 function addBreakpoint() {
   return gBreakpoints.addBreakpoint({ url: gSources.selectedValue, line: 18 });
 }
 
 function pauseDebuggee() {
-  // Spin the event loop before causing the debuggee to pause, to allow
-  // this function to return first.
-  executeSoon(() => {
-    gDebuggee.test();
-  });
+  callInTab(gTab, "test");
 
   return waitForDebuggerEvents(gPanel, gDebugger.EVENTS.FETCHED_SCOPES);
 }
 
 function resumeDebuggee() {
   // Spin the event loop before causing the debuggee to pause, to allow
   // this function to return first.
   executeSoon(() => {
@@ -115,15 +110,14 @@ function prepareScopes() {
   is(functionScope.expanded, true,
     "The functionScope should now be expanded.");
   is(globalScope.expanded, false,
     "The globalScope should still not be expanded.");
 }
 
 registerCleanupFunction(function() {
   gTab = null;
-  gDebuggee = null;
   gPanel = null;
   gDebugger = null;
   gBreakpoints = null;
   gSources = null;
   gVariables = null;
 });
--- a/browser/devtools/debugger/test/browser_dbg_variables-view-webidl.js
+++ b/browser/devtools/debugger/test/browser_dbg_variables-view-webidl.js
@@ -3,41 +3,38 @@
 
 /**
  * Make sure that the variables view correctly displays WebIDL attributes in DOM
  * objects.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_frame-parameters.html";
 
-let gTab, gDebuggee, gPanel, gDebugger;
+let gTab, gPanel, gDebugger;
 let gVariables;
 
 function test() {
   // Debug test slaves are a bit slow at this test.
   requestLongerTimeout(2);
 
-  initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
+  initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
     gTab = aTab;
-    gDebuggee = aDebuggee;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gVariables = gDebugger.DebuggerView.Variables;
 
     waitForSourceAndCaretAndScopes(gPanel, ".html", 24)
       .then(expandGlobalScope)
       .then(performTest)
       .then(() => resumeDebuggerThenCloseAndFinish(gPanel))
       .then(null, aError => {
         ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
       });
 
-    EventUtils.sendMouseEvent({ type: "click" },
-      gDebuggee.document.querySelector("button"),
-      gDebuggee);
+    sendMouseClickToTab(gTab, content.document.querySelector("button"));
   });
 }
 
 function expandGlobalScope() {
   let deferred = promise.defer();
 
   let globalScope = gVariables.getScopeAtIndex(1);
   is(globalScope.expanded, false,
@@ -248,13 +245,12 @@ function performTest() {
   is(documentVar.expanded, true,
     "The documentVar should be immediately marked as expanded.");
 
   return deferred.promise;
 }
 
 registerCleanupFunction(function() {
   gTab = null;
-  gDebuggee = null;
   gPanel = null;
   gDebugger = null;
   gVariables = null;
 });
--- a/browser/devtools/debugger/test/code_frame-script.js
+++ b/browser/devtools/debugger/test/code_frame-script.js
@@ -19,8 +19,15 @@ addMessageListener("test:call", function
 
 addMessageListener("test:click", function (message) {
   dump("Sending mouse click.\n");
 
   let target = message.objects.target;
   EventUtils.synthesizeMouseAtCenter(target, {},
                                      target.ownerDocument.defaultView);
 });
+
+addMessageListener("test:eval", function (message) {
+  dump("Evalling string " + message.data.string + ".\n");
+
+  content.eval(message.data.string);
+  sendAsyncMessage("test:eval");
+});
--- a/browser/devtools/debugger/test/head.js
+++ b/browser/devtools/debugger/test/head.js
@@ -965,15 +965,24 @@ function callInTab(tab, name) {
 
   sendMessageToTab(tab, "test:call", {
     name: name,
     args: Array.prototype.slice.call(arguments, 2)
   });
   waitForMessageFromTab(tab, "test:call");
 }
 
+function evalInTab(tab, string) {
+  info("Evalling string " + string + " in tab.");
+
+  sendMessageToTab(tab, "test:eval", {
+    string: string,
+  });
+  waitForMessageFromTab(tab, "test:eval");
+}
+
 function sendMouseClickToTab(tab, target) {
   info("Sending mouse click to tab.");
 
   sendMessageToTab(tab, "test:click", undefined, {
     target: target
   });
 }