Merge fx-team to m-c.

This commit is contained in:
Ryan VanderMeulen 2013-06-19 19:22:22 -04:00
commit 486b7fc04f
5 changed files with 65 additions and 21 deletions

View File

@ -1410,13 +1410,6 @@
b._fastFind = this.fastFind;
b.droppedLinkHandler = handleDroppedLink;
// Dispatch a new tab notification. We do this once we're
// entirely done, so that things are in a consistent state
// even if the event listener opens or closes tabs.
var evt = document.createEvent("Events");
evt.initEvent("TabOpen", true, false);
t.dispatchEvent(evt);
// If we just created a new tab that loads the default
// newtab url, swap in a preloaded page if possible.
// Do nothing if we're a private window.
@ -1426,6 +1419,13 @@
docShellsSwapped = gBrowserNewTabPreloader.newTab(t);
}
// Dispatch a new tab notification. We do this once we're
// entirely done, so that things are in a consistent state
// even if the event listener opens or closes tabs.
var evt = document.createEvent("Events");
evt.initEvent("TabOpen", true, false);
t.dispatchEvent(evt);
// If we didn't swap docShells with a preloaded browser
// then let's just continue loading the page normally.
if (!docShellsSwapped && !uriIsAboutBlank) {

View File

@ -274,6 +274,9 @@ gcli.addCommand({
description: gcli.lookup("dbgClose"),
params: [],
exec: function(args, context) {
if (!getPanel(context, "jsdebugger"))
return;
return gDevTools.closeToolbox(context.environment.target)
.then(() => null);
}

View File

@ -57,22 +57,32 @@ function test() {
cmd("dbg continue", function() {
is(output.value, "dbg continue", "debugger continued");
helpers.audit(options, [{
setup: "dbg close",
completed: false,
exec: { output: "" }
}]);
function closeDebugger(cb) {
helpers.audit(options, [{
setup: "dbg close",
completed: false,
exec: { output: "" }
}]);
let toolbox = gDevTools.getToolbox(options.target);
if (!toolbox) {
ok(true, "Debugger was closed.");
deferred.resolve();
} else {
toolbox.on("destroyed", function () {
let toolbox = gDevTools.getToolbox(options.target);
if (!toolbox) {
ok(true, "Debugger was closed.");
deferred.resolve();
});
cb();
} else {
toolbox.on("destroyed", function () {
ok(true, "Debugger was closed.");
cb();
});
}
}
// We're closing the debugger twice to make sure
// 'dbg close' doesn't error when toolbox is already
// closed. See bug 884638 for more info.
closeDebugger(() => {
closeDebugger(() => deferred.resolve());
});
});
});
});
@ -95,4 +105,4 @@ function test() {
return deferred.promise;
}).then(finish);
}
}

View File

@ -49,6 +49,9 @@ gcli.addCommand({
params: [],
exec: function (args, context) {
if (!getPanel(context, "jsprofiler"))
return;
return gDevTools.closeToolbox(context.environment.target)
.then(function () null);
}

View File

@ -26,6 +26,7 @@ function test() {
.then(testProfilerList)
.then(testProfilerStop)
.then(testProfilerClose)
.then(testProfilerCloseWhenClosed)
}).then(finishUp);
}
@ -118,6 +119,33 @@ function testProfilerClose() {
return deferred.promise;
}
function testProfilerCloseWhenClosed() {
// We need to call this test to make sure there are no
// errors when executing 'profiler close' on a closed
// toolbox. See bug 863636 for more info.
let deferred = Promise.defer();
helpers.audit(gOptions, [{
setup: "profiler close",
completed: false,
exec: { output: "" }
}]);
let toolbox = gDevTools.getToolbox(gOptions.target);
if (!toolbox) {
ok(true, "Profiler was closed.");
deferred.resolve();
} else {
toolbox.on("destroyed", function () {
ok(true, "Profiler was closed.");
deferred.resolve();
});
}
return deferred.promise;
}
function finishUp() {
gTarget = null;
gPanel = null;