Bug 1090929 - Enable the source-mapping tests;r=mratcliffe
authorEddy Bruël <ejpbruel@gmail.com>
Thu, 06 Nov 2014 19:56:49 +0100
changeset 214592 41c629664359574f257bd0c6ddec0d894477ddbd
parent 214591 663a6bc26926cce26c7b37088b35c5295774e547
child 214593 9b212f88273096043aa261b577d08b10d7f221bd
push id27788
push userryanvm@gmail.com
push dateFri, 07 Nov 2014 18:23:58 +0000
treeherdermozilla-central@c39ff12ad6eb [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 source-mapping tests;r=mratcliffe
browser/devtools/debugger/test/browser.ini
browser/devtools/debugger/test/browser_dbg_source-maps-01.js
browser/devtools/debugger/test/browser_dbg_source-maps-02.js
browser/devtools/debugger/test/browser_dbg_source-maps-03.js
browser/devtools/debugger/test/browser_dbg_source-maps-04.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
@@ -387,23 +387,23 @@ skip-if = e10s
 skip-if = e10s
 [browser_dbg_searchbox-help-popup-01.js]
 skip-if = e10s
 [browser_dbg_searchbox-help-popup-02.js]
 skip-if = e10s
 [browser_dbg_searchbox-parse.js]
 skip-if = e10s
 [browser_dbg_source-maps-01.js]
-skip-if = e10s
+skip-if = e10s && debug
 [browser_dbg_source-maps-02.js]
-skip-if = e10s
+skip-if = e10s && debug
 [browser_dbg_source-maps-03.js]
-skip-if = e10s
+skip-if = e10s && debug
 [browser_dbg_source-maps-04.js]
-skip-if = e10s
+skip-if = e10s # Bug 1093535
 [browser_dbg_sources-cache.js]
 skip-if = e10s
 [browser_dbg_sources-labels.js]
 skip-if = e10s
 [browser_dbg_sources-sorting.js]
 skip-if = e10s
 [browser_dbg_split-console-paused-reload.js]
 skip-if = e10s
--- a/browser/devtools/debugger/test/browser_dbg_source-maps-01.js
+++ b/browser/devtools/debugger/test/browser_dbg_source-maps-01.js
@@ -4,23 +4,22 @@
 /**
  * Test that we can set breakpoints and step through source mapped
  * coffee script.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_binary_search.html";
 const COFFEE_URL = EXAMPLE_URL + "code_binary_search.coffee";
 
-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;
 
     checkSourceMapsEnabled();
 
     waitForSourceShown(gPanel, ".coffee")
@@ -114,17 +113,17 @@ function testHitBreakpoint() {
       is(aPacket.frame.environment.bindings.variables.pivot.value.type, "undefined",
          "'pivot' hasn't been assigned to yet.");
 
       waitForCaretUpdated(gPanel, 5).then(deferred.resolve);
     });
 
     // This will cause the breakpoint to be hit, and put us back in the
     // paused state.
-    gDebuggee.binary_search([0, 2, 3, 5, 7, 10], 5);
+    callInTab(gTab, "binary_search", [0, 2, 3, 5, 7, 10], 5);
   });
 
   return deferred.promise;
 }
 
 function testStepping() {
   let deferred = promise.defer();
 
@@ -152,14 +151,13 @@ function testStepping() {
     });
   });
 
   return deferred.promise;
 }
 
 registerCleanupFunction(function() {
   gTab = null;
-  gDebuggee = null;
   gPanel = null;
   gDebugger = null;
   gEditor = null;
   gSources = null;
 });
--- a/browser/devtools/debugger/test/browser_dbg_source-maps-02.js
+++ b/browser/devtools/debugger/test/browser_dbg_source-maps-02.js
@@ -3,22 +3,22 @@
 
 /**
  * Test that we can toggle between the original and generated sources.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_binary_search.html";
 const JS_URL = EXAMPLE_URL + "code_binary_search.js";
 
-let gDebuggee, gPanel, gDebugger, gEditor;
+let gTab, gPanel, gDebugger, gEditor;
 let gSources, gFrames, gPrefs, gOptions;
 
 function test() {
-  initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
-    gDebuggee = aDebuggee;
+  initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
+    gTab = aTab;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gEditor = gDebugger.DebuggerView.editor;
     gSources = gDebugger.DebuggerView.Sources;
     gFrames = gDebugger.DebuggerView.StackFrames;
     gPrefs = gDebugger.Prefs;
     gOptions = gDebugger.DebuggerView.Options;
 
@@ -76,17 +76,17 @@ function testSetBreakpoint() {
         isnot(gFrames.getItemAtIndex(0).attachment.url.indexOf(".js"), -1,
           "First frame should be a JS frame.");
 
         deferred.resolve();
       });
 
       // This will cause the breakpoint to be hit, and put us back in the
       // paused state.
-      gDebuggee.binary_search([0, 2, 3, 5, 7, 10], 5);
+      callInTab(gTab, "binary_search", [0, 2, 3, 5, 7, 10], 5);
     });
   });
 
   return deferred.promise;
 }
 
 function testToggleOnPause() {
   let finished = waitForSourceAndCaretAndScopes(gPanel, ".coffee", 5).then(() => {
@@ -130,17 +130,17 @@ function testResume() {
 
     deferred.resolve();
   });
 
   return deferred.promise;
 }
 
 registerCleanupFunction(function() {
-  gDebuggee = null;
+  gTab = null;
   gPanel = null;
   gDebugger = null;
   gEditor = null;
   gSources = null;
   gFrames = null;
   gPrefs = null;
   gOptions = null;
 });
--- a/browser/devtools/debugger/test/browser_dbg_source-maps-03.js
+++ b/browser/devtools/debugger/test/browser_dbg_source-maps-03.js
@@ -3,22 +3,22 @@
 
 /**
  * Test that we can debug minified javascript with source maps.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_minified.html";
 const JS_URL = EXAMPLE_URL + "code_math.js";
 
-let gDebuggee, gPanel, gDebugger;
+let gTab, gPanel, gDebugger;
 let gEditor, gSources, gFrames;
 
 function test() {
-  initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
-    gDebuggee = aDebuggee;
+  initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
+    gTab = aTab;
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gEditor = gDebugger.DebuggerView.editor;
     gSources = gDebugger.DebuggerView.Sources;
     gFrames = gDebugger.DebuggerView.StackFrames;
 
     waitForSourceShown(gPanel, JS_URL)
       .then(checkInitialSource)
@@ -59,23 +59,23 @@ function testSetBreakpoint() {
         isnot(gFrames.getItemAtIndex(0).attachment.url.indexOf(".js"), -1,
           "First frame should be a JS frame.");
 
         deferred.resolve();
       });
 
       // This will cause the breakpoint to be hit, and put us back in the
       // paused state.
-      gDebuggee.arithmetic();
+      callInTab(gTab, "arithmetic");
     });
   });
 
   return deferred.promise;
 }
 
 registerCleanupFunction(function() {
-  gDebuggee = null;
+  gTab = null;
   gPanel = null;
   gDebugger = null;
   gEditor = null;
   gSources = null;
   gFrames = null;
 });
--- a/browser/devtools/debugger/test/browser_dbg_source-maps-04.js
+++ b/browser/devtools/debugger/test/browser_dbg_source-maps-04.js
@@ -11,17 +11,17 @@ const JS_URL = EXAMPLE_URL + "code_math_
 // This test causes an error to be logged in the console, which appears in TBPL
 // logs, so we are disabling that here.
 let { DevToolsUtils } = Cu.import("resource://gre/modules/devtools/DevToolsUtils.jsm", {});
 DevToolsUtils.reportingDisabled = true;
 
 let gPanel, gDebugger, gFrames, gSources, gPrefs, gOptions;
 
 function test() {
-  initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
+  initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
     gPanel = aPanel;
     gDebugger = gPanel.panelWin;
     gFrames = gDebugger.DebuggerView.StackFrames;
     gSources = gDebugger.DebuggerView.Sources;
     gPrefs = gDebugger.Prefs;
     gOptions = gDebugger.DebuggerView.Options;
 
     is(gPrefs.pauseOnExceptions, false,
--- a/browser/devtools/debugger/test/code_frame-script.js
+++ b/browser/devtools/debugger/test/code_frame-script.js
@@ -5,19 +5,20 @@ const { loadSubScript } = Cc['@mozilla.o
                           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");
+  dump("Calling function with name " + message.data.name + ".\n");
 
-  XPCNativeWrapper.unwrap(content)[message.data]();
+  let data = message.data;
+  XPCNativeWrapper.unwrap(content)[data.name].apply(undefined, data.args);
   sendAsyncMessage("test:call");
 });
 
 addMessageListener("test:click", function (message) {
   dump("Sending mouse click.\n");
 
   let target = message.objects.target;
   EventUtils.synthesizeMouseAtCenter(target, {},
--- a/browser/devtools/debugger/test/head.js
+++ b/browser/devtools/debugger/test/head.js
@@ -958,17 +958,20 @@ function waitForMessageFromTab(tab, name
       resolve(message);
     });
   });
 }
 
 function callInTab(tab, name) {
   info("Calling function with name " + name + " in tab.");
 
-  sendMessageToTab(tab, "test:call", name);
+  sendMessageToTab(tab, "test:call", {
+    name: name,
+    args: Array.prototype.slice.call(arguments, 2)
+  });
   waitForMessageFromTab(tab, "test:call");
 }
 
 function sendMouseClickToTab(tab, target) {
   info("Sending mouse click to tab.");
 
   sendMessageToTab(tab, "test:click", undefined, {
     target: target