mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 03:15:11 +00:00
Merge m-c to inbound.
This commit is contained in:
commit
891392fbf9
@ -253,9 +253,7 @@ let DebuggerController = {
|
||||
if (aCallback) {
|
||||
aCallback();
|
||||
}
|
||||
}, {
|
||||
useSourceMaps: Services.prefs.getBoolPref("devtools.debugger.source-maps-enabled")
|
||||
});
|
||||
}, { useSourceMaps: Prefs.sourceMapsEnabled });
|
||||
},
|
||||
|
||||
/**
|
||||
@ -299,6 +297,29 @@ let DebuggerController = {
|
||||
if (aCallback) {
|
||||
aCallback();
|
||||
}
|
||||
}, { useSourceMaps: Prefs.sourceMapsEnabled });
|
||||
},
|
||||
|
||||
/**
|
||||
* Detach and reattach to the thread actor with useSourceMaps true, blow
|
||||
* away old scripts and get sources again.
|
||||
*/
|
||||
reconfigureThread: function DC_reconfigureThread(aUseSourceMaps) {
|
||||
this.client.reconfigureThread(aUseSourceMaps, (aResponse) => {
|
||||
if (aResponse.error) {
|
||||
let msg = "Couldn't reconfigure thread: " + aResponse.message;
|
||||
Cu.reportError(msg);
|
||||
dumpn(msg);
|
||||
return;
|
||||
}
|
||||
|
||||
// Update the source list widget.
|
||||
DebuggerView.Sources.empty();
|
||||
SourceUtils.clearCache();
|
||||
this.SourceScripts._handleTabNavigation();
|
||||
// Update the stack frame list.
|
||||
this.activeThread._clearFrames();
|
||||
this.activeThread.fillFrames(CALL_STACK_PAGE_SIZE);
|
||||
});
|
||||
},
|
||||
|
||||
@ -1659,6 +1680,7 @@ let Prefs = new ViewHelpers.Prefs("devtools.debugger", {
|
||||
variablesSortingEnabled: ["Bool", "ui.variables-sorting-enabled"],
|
||||
variablesOnlyEnumVisible: ["Bool", "ui.variables-only-enum-visible"],
|
||||
variablesSearchboxVisible: ["Bool", "ui.variables-searchbox-visible"],
|
||||
sourceMapsEnabled: ["Bool", "source-maps-enabled"],
|
||||
remoteHost: ["Char", "remote-host"],
|
||||
remotePort: ["Int", "remote-port"],
|
||||
remoteAutoConnect: ["Bool", "remote-autoconnect"],
|
||||
|
@ -187,6 +187,7 @@ function OptionsView() {
|
||||
this._toggleShowPanesOnStartup = this._toggleShowPanesOnStartup.bind(this);
|
||||
this._toggleShowVariablesOnlyEnum = this._toggleShowVariablesOnlyEnum.bind(this);
|
||||
this._toggleShowVariablesFilterBox = this._toggleShowVariablesFilterBox.bind(this);
|
||||
this._toggleShowOriginalSource = this._toggleShowOriginalSource.bind(this);
|
||||
}
|
||||
|
||||
OptionsView.prototype = {
|
||||
@ -201,11 +202,13 @@ OptionsView.prototype = {
|
||||
this._showPanesOnStartupItem = document.getElementById("show-panes-on-startup");
|
||||
this._showVariablesOnlyEnumItem = document.getElementById("show-vars-only-enum");
|
||||
this._showVariablesFilterBoxItem = document.getElementById("show-vars-filter-box");
|
||||
this._showOriginalSourceItem = document.getElementById("show-original-source");
|
||||
|
||||
this._pauseOnExceptionsItem.setAttribute("checked", Prefs.pauseOnExceptions);
|
||||
this._showPanesOnStartupItem.setAttribute("checked", Prefs.panesVisibleOnStartup);
|
||||
this._showVariablesOnlyEnumItem.setAttribute("checked", Prefs.variablesOnlyEnumVisible);
|
||||
this._showVariablesFilterBoxItem.setAttribute("checked", Prefs.variablesSearchboxVisible);
|
||||
this._showOriginalSourceItem.setAttribute("checked", Prefs.sourceMapsEnabled);
|
||||
},
|
||||
|
||||
/**
|
||||
@ -262,10 +265,21 @@ OptionsView.prototype = {
|
||||
this._showVariablesFilterBoxItem.getAttribute("checked") == "true";
|
||||
},
|
||||
|
||||
/**
|
||||
* Listener handling the 'show original source' menuitem command.
|
||||
*/
|
||||
_toggleShowOriginalSource: function DVO__toggleShowOriginalSource() {
|
||||
let pref = Prefs.sourceMapsEnabled =
|
||||
this._showOriginalSourceItem.getAttribute("checked") == "true";
|
||||
|
||||
DebuggerController.reconfigureThread(pref);
|
||||
},
|
||||
|
||||
_button: null,
|
||||
_pauseOnExceptionsItem: null,
|
||||
_showPanesOnStartupItem: null,
|
||||
_showVariablesOnlyEnumItem: null,
|
||||
_showOriginalSourceItem: null,
|
||||
_showVariablesFilterBoxItem: null
|
||||
};
|
||||
|
||||
|
@ -64,6 +64,8 @@
|
||||
oncommand="DebuggerView.Options._toggleShowVariablesOnlyEnum()"/>
|
||||
<command id="toggleShowVariablesFilterBox"
|
||||
oncommand="DebuggerView.Options._toggleShowVariablesFilterBox()"/>
|
||||
<command id="toggleShowOriginalSource"
|
||||
oncommand="DebuggerView.Options._toggleShowOriginalSource()"/>
|
||||
</commandset>
|
||||
|
||||
<popupset id="debuggerPopupset">
|
||||
@ -160,6 +162,11 @@
|
||||
label="&debuggerUI.showVarsFilter;"
|
||||
accesskey="&debuggerUI.showVarsFilter.key;"
|
||||
command="toggleShowVariablesFilterBox"/>
|
||||
<menuitem id="show-original-source"
|
||||
type="checkbox"
|
||||
label="&debuggerUI.showOriginalSource;"
|
||||
accesskey="&debuggerUI.showOriginalSource.key;"
|
||||
command="toggleShowOriginalSource"/>
|
||||
</menupopup>
|
||||
</popupset>
|
||||
|
||||
|
@ -97,6 +97,7 @@ MOCHITEST_BROWSER_TESTS = \
|
||||
browser_dbg_progress-listener-bug.js \
|
||||
browser_dbg_chrome-debugging.js \
|
||||
browser_dbg_source_maps-01.js \
|
||||
browser_dbg_source_maps-02.js \
|
||||
head.js \
|
||||
helpers.js \
|
||||
$(NULL)
|
||||
|
203
browser/devtools/debugger/test/browser_dbg_source_maps-02.js
Normal file
203
browser/devtools/debugger/test/browser_dbg_source_maps-02.js
Normal file
@ -0,0 +1,203 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
/**
|
||||
* Test that we can toggle between the original and generated sources.
|
||||
*/
|
||||
|
||||
const TAB_URL = EXAMPLE_URL + "binary_search.html";
|
||||
|
||||
var gPane = null;
|
||||
var gTab = null;
|
||||
var gDebuggee = null;
|
||||
var gDebugger = null;
|
||||
var gPrevPref = null;
|
||||
|
||||
function test()
|
||||
{
|
||||
let scriptShown = false;
|
||||
let framesAdded = false;
|
||||
let resumed = false;
|
||||
let testStarted = false;
|
||||
|
||||
gPrevPref = Services.prefs.getBoolPref(
|
||||
"devtools.debugger.source-maps-enabled");
|
||||
Services.prefs.setBoolPref("devtools.debugger.source-maps-enabled", true);
|
||||
|
||||
debug_tab_pane(TAB_URL, function(aTab, aDebuggee, aPane) {
|
||||
resumed = true;
|
||||
gTab = aTab;
|
||||
gDebuggee = aDebuggee;
|
||||
gPane = aPane;
|
||||
gDebugger = gPane.panelWin;
|
||||
|
||||
gDebugger.addEventListener("Debugger:SourceShown", function _onSourceShown(aEvent) {
|
||||
gDebugger.removeEventListener("Debugger:SourceShown", _onSourceShown);
|
||||
// Show original sources should be already enabled.
|
||||
is(gPrevPref, false,
|
||||
"The source maps functionality should be disabled by default.");
|
||||
is(gDebugger.Prefs.sourceMapsEnabled, true,
|
||||
"The source maps pref should be true from startup.");
|
||||
is(gDebugger.DebuggerView.Options._showOriginalSourceItem.getAttribute("checked"),
|
||||
"true", "Source maps should be enabled from startup. ")
|
||||
|
||||
ok(aEvent.detail.url.indexOf(".coffee") != -1,
|
||||
"The debugger should show the source mapped coffee script file.");
|
||||
ok(aEvent.detail.url.indexOf(".js") == -1,
|
||||
"The debugger should not show the generated js script file.");
|
||||
ok(gDebugger.editor.getText().search(/isnt/) != -1,
|
||||
"The debugger's editor should have the coffee script source displayed.");
|
||||
ok(gDebugger.editor.getText().search(/function/) == -1,
|
||||
"The debugger's editor should not have the JS source displayed.");
|
||||
|
||||
testToggleGeneratedSource();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function testToggleGeneratedSource() {
|
||||
gDebugger.addEventListener("Debugger:SourceShown", function _onSourceShown(aEvent) {
|
||||
gDebugger.removeEventListener("Debugger:SourceShown", _onSourceShown);
|
||||
|
||||
is(gDebugger.Prefs.sourceMapsEnabled, false,
|
||||
"The source maps pref should have been set to false.");
|
||||
is(gDebugger.DebuggerView.Options._showOriginalSourceItem.getAttribute("checked"),
|
||||
"false", "Source maps should be enabled from startup. ")
|
||||
|
||||
ok(aEvent.detail.url.indexOf(".coffee") == -1,
|
||||
"The debugger should not show the source mapped coffee script file.");
|
||||
ok(aEvent.detail.url.indexOf(".js") != -1,
|
||||
"The debugger should show the generated js script file.");
|
||||
ok(gDebugger.editor.getText().search(/isnt/) == -1,
|
||||
"The debugger's editor should have the coffee script source displayed.");
|
||||
ok(gDebugger.editor.getText().search(/function/) != -1,
|
||||
"The debugger's editor should not have the JS source displayed.");
|
||||
|
||||
testSetBreakpoint();
|
||||
});
|
||||
|
||||
// Disable source maps.
|
||||
gDebugger.DebuggerView.Options._showOriginalSourceItem.setAttribute("checked",
|
||||
"false");
|
||||
gDebugger.DebuggerView.Options._toggleShowOriginalSource();
|
||||
}
|
||||
|
||||
function testSetBreakpoint() {
|
||||
let { activeThread } = gDebugger.DebuggerController;
|
||||
activeThread.setBreakpoint({
|
||||
url: EXAMPLE_URL + "binary_search.js",
|
||||
line: 7
|
||||
}, function (aResponse, bpClient) {
|
||||
ok(!aResponse.error,
|
||||
"Should be able to set a breakpoint in a JavaScript file.");
|
||||
testHitBreakpoint();
|
||||
});
|
||||
}
|
||||
|
||||
function testHitBreakpoint() {
|
||||
let { activeThread } = gDebugger.DebuggerController;
|
||||
activeThread.resume(function (aResponse) {
|
||||
ok(!aResponse.error, "Shouldn't get an error resuming");
|
||||
is(aResponse.type, "resumed", "Type should be 'resumed'");
|
||||
|
||||
activeThread.addOneTimeListener("framesadded", function (aEvent, aPacket) {
|
||||
// Make sure that we have JavaScript stack frames.
|
||||
let frames = gDebugger.DebuggerView.StackFrames._container._list;
|
||||
let childNodes = frames.childNodes;
|
||||
|
||||
is(frames.querySelectorAll(".dbg-stackframe").length, 1,
|
||||
"Correct number of frames.");
|
||||
ok(frames.querySelector("#stackframe-0 .dbg-stackframe-details")
|
||||
.getAttribute("value").search(/js/),
|
||||
"First frame should be a JS frame.");
|
||||
|
||||
waitForCaretPos(6, testToggleOnPause);
|
||||
});
|
||||
|
||||
// This will cause the breakpoint to be hit, and put us back in the paused
|
||||
// stated.
|
||||
executeSoon(function() {
|
||||
gDebuggee.binary_search([0, 2, 3, 5, 7, 10], 5);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function testToggleOnPause() {
|
||||
gDebugger.addEventListener("Debugger:SourceShown", function _onSourceShown(aEvent) {
|
||||
gDebugger.removeEventListener("Debugger:SourceShown", _onSourceShown);
|
||||
|
||||
is(gDebugger.Prefs.sourceMapsEnabled, true,
|
||||
"The source maps pref should have been set to true.");
|
||||
is(gDebugger.DebuggerView.Options._showOriginalSourceItem.getAttribute("checked"),
|
||||
"true", "Source maps should be enabled. ")
|
||||
|
||||
ok(aEvent.detail.url.indexOf(".coffee") != -1,
|
||||
"The debugger should show the source mapped coffee script file.");
|
||||
ok(aEvent.detail.url.indexOf(".js") == -1,
|
||||
"The debugger should not show the generated js script file.");
|
||||
ok(gDebugger.editor.getText().search(/isnt/) != -1,
|
||||
"The debugger's editor should not have the coffee script source displayed.");
|
||||
ok(gDebugger.editor.getText().search(/function/) == -1,
|
||||
"The debugger's editor should have the JS source displayed.");
|
||||
|
||||
// Make sure that we have coffee script stack frames.
|
||||
let frames = gDebugger.DebuggerView.StackFrames._container._list;
|
||||
let childNodes = frames.childNodes;
|
||||
|
||||
is(frames.querySelectorAll(".dbg-stackframe").length, 1,
|
||||
"Correct number of frames.");
|
||||
ok(frames.querySelector("#stackframe-0 .dbg-stackframe-details")
|
||||
.getAttribute("value").search(/coffee/),
|
||||
"First frame should be a coffee script frame.");
|
||||
|
||||
waitForCaretPos(4, resumeAndFinish);
|
||||
});
|
||||
|
||||
// Enable source maps.
|
||||
gDebugger.DebuggerView.Options._showOriginalSourceItem.setAttribute("checked",
|
||||
"true");
|
||||
gDebugger.DebuggerView.Options._toggleShowOriginalSource();
|
||||
}
|
||||
|
||||
function resumeAndFinish()
|
||||
{
|
||||
let { activeThread } = gDebugger.DebuggerController;
|
||||
activeThread.resume(function (aResponse) {
|
||||
ok(!aResponse.error, "Shouldn't get an error resuming");
|
||||
is(aResponse.type, "resumed", "Type should be 'resumed'");
|
||||
|
||||
closeDebuggerAndFinish();
|
||||
});
|
||||
}
|
||||
|
||||
function waitForCaretPos(number, callback)
|
||||
{
|
||||
// Poll every few milliseconds until the source editor line is active.
|
||||
let count = 0;
|
||||
let intervalID = window.setInterval(function() {
|
||||
info("count: " + count + " ");
|
||||
if (++count > 50) {
|
||||
ok(false, "Timed out while polling for the line.");
|
||||
window.clearInterval(intervalID);
|
||||
return closeDebuggerAndFinish();
|
||||
}
|
||||
if (gDebugger.DebuggerView.editor.getCaretPosition().line != number) {
|
||||
return;
|
||||
}
|
||||
is(gDebugger.DebuggerView.editor.getCaretPosition().line, number,
|
||||
"The right line is focused.")
|
||||
// We got the source editor at the expected line, it's safe to callback.
|
||||
window.clearInterval(intervalID);
|
||||
callback();
|
||||
}, 100);
|
||||
}
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
Services.prefs.setBoolPref("devtools.debugger.source-maps-enabled", false);
|
||||
removeTab(gTab);
|
||||
gPane = null;
|
||||
gTab = null;
|
||||
gDebuggee = null;
|
||||
gDebugger = null;
|
||||
gPrevPref = null;
|
||||
});
|
@ -63,7 +63,7 @@
|
||||
</menupopup>
|
||||
</popupset>
|
||||
|
||||
<hbox flex="1">
|
||||
<box flex="1" class="devtools-responsive-container">
|
||||
<vbox flex="1">
|
||||
<toolbar id="inspector-toolbar"
|
||||
class="devtools-toolbar"
|
||||
@ -91,5 +91,5 @@
|
||||
<tabs/>
|
||||
<tabpanels flex="1"/>
|
||||
</tabbox>
|
||||
</hbox>
|
||||
</box>
|
||||
</window>
|
||||
|
@ -505,7 +505,8 @@ create({ constructor: RequestsMenuView, proto: MenuContainer.prototype }, {
|
||||
break;
|
||||
}
|
||||
case "contentSize": {
|
||||
let size = (aValue / 1024).toFixed(CONTENT_SIZE_DECIMALS);
|
||||
let kb = aValue / 1024;
|
||||
let size = L10N.numberWithDecimals(kb, CONTENT_SIZE_DECIMALS);
|
||||
let node = $(".requests-menu-size", aItem.target);
|
||||
let text = L10N.getFormatStr("networkMenu.sizeKB", size);
|
||||
node.setAttribute("value", text);
|
||||
@ -522,7 +523,7 @@ create({ constructor: RequestsMenuView, proto: MenuContainer.prototype }, {
|
||||
}
|
||||
case "totalTime": {
|
||||
let node = $(".requests-menu-timings-total", aItem.target);
|
||||
let text = L10N.getFormatStr("networkMenu.totalMS", aValue);
|
||||
let text = L10N.getFormatStr("networkMenu.totalMS", aValue); // integer
|
||||
node.setAttribute("value", text);
|
||||
node.setAttribute("tooltiptext", text);
|
||||
break;
|
||||
@ -540,7 +541,8 @@ create({ constructor: RequestsMenuView, proto: MenuContainer.prototype }, {
|
||||
*/
|
||||
_createWaterfallView: function NVRM__createWaterfallView(aItem, aTimings) {
|
||||
let { target, attachment } = aItem;
|
||||
let sections = ["blocked", "dns", "connect", "send", "wait", "receive"];
|
||||
let sections = ["dns", "connect", "send", "wait", "receive"];
|
||||
// Skipping "blocked" because it doesn't work yet.
|
||||
|
||||
let timingsNode = $(".requests-menu-timings", target);
|
||||
let startCapNode = $(".requests-menu-timings-cap.start", timingsNode);
|
||||
@ -879,9 +881,10 @@ create({ constructor: NetworkDetailsView, proto: MenuContainer.prototype }, {
|
||||
* The message received from the server.
|
||||
*/
|
||||
_addHeaders: function NVND__addHeaders(aName, aResponse) {
|
||||
let kb = (aResponse.headersSize / 1024).toFixed(HEADERS_SIZE_DECIMALS);
|
||||
let size = L10N.getFormatStr("networkMenu.sizeKB", kb);
|
||||
let headersScope = this._headers.addScope(aName + " (" + size + ")");
|
||||
let kb = aResponse.headersSize / 1024;
|
||||
let size = L10N.numberWithDecimals(kb, HEADERS_SIZE_DECIMALS);
|
||||
let text = L10N.getFormatStr("networkMenu.sizeKB", size);
|
||||
let headersScope = this._headers.addScope(aName + " (" + text + ")");
|
||||
headersScope.expanded = true;
|
||||
|
||||
for (let header of aResponse.headers) {
|
||||
|
@ -6,3 +6,15 @@
|
||||
#response-content-image-box {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
#timings-summary-blocked {
|
||||
display: none; /* This doesn't work yet. */
|
||||
}
|
||||
|
||||
/* Responsive sidebar */
|
||||
@media (max-width: 700px) {
|
||||
#details-pane-toggle,
|
||||
.requests-menu-waterfall {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
@ -17,7 +17,7 @@
|
||||
<script type="text/javascript" src="netmonitor-controller.js"/>
|
||||
<script type="text/javascript" src="netmonitor-view.js"/>
|
||||
|
||||
<hbox id="body" flex="1">
|
||||
<box id="body" flex="1" class="devtools-responsive-container">
|
||||
<vbox id="network-table" flex="1">
|
||||
<toolbar id="requests-menu-toolbar"
|
||||
class="devtools-toolbar"
|
||||
@ -262,6 +262,6 @@
|
||||
</tabpanel>
|
||||
</tabpanels>
|
||||
</tabbox>
|
||||
</hbox>
|
||||
</box>
|
||||
|
||||
</window>
|
||||
|
@ -48,7 +48,7 @@ function test() {
|
||||
statusText: "OK",
|
||||
type: "json",
|
||||
fullMimeType: "application/json; charset=utf-8",
|
||||
size: L10N.getFormatStr("networkMenu.sizeKB", 0.03),
|
||||
size: L10N.getFormatStr("networkMenu.sizeKB", 0.02),
|
||||
time: true
|
||||
});
|
||||
verifyRequestItemTarget(RequestsMenu.getItemAtIndex(4),
|
||||
@ -66,7 +66,7 @@ function test() {
|
||||
statusText: "OK",
|
||||
type: "png",
|
||||
fullMimeType: "image/png",
|
||||
size: L10N.getFormatStr("networkMenu.sizeKB", 0.76),
|
||||
size: L10N.getFormatStr("networkMenu.sizeKB", 0.75),
|
||||
time: true
|
||||
});
|
||||
|
||||
|
@ -11,7 +11,7 @@ function test() {
|
||||
|
||||
// This is receiving over 80 KB of json and will populate over 6000 items
|
||||
// in a variables view instance. Debug builds are slow.
|
||||
requestLongerTimeout(2);
|
||||
requestLongerTimeout(3);
|
||||
|
||||
let { document, L10N, SourceEditor, NetMonitorView } = aMonitor.panelWin;
|
||||
let { RequestsMenu } = NetMonitorView;
|
||||
@ -25,7 +25,7 @@ function test() {
|
||||
statusText: "OK",
|
||||
type: "json",
|
||||
fullMimeType: "text/json; charset=utf-8",
|
||||
size: L10N.getFormatStr("networkMenu.sizeKB", 83.96),
|
||||
size: L10N.getFormatStr("networkMenu.sizeKB", 83.95),
|
||||
time: true
|
||||
});
|
||||
|
||||
|
@ -73,14 +73,15 @@ function test() {
|
||||
|
||||
is(responseScope.querySelector(".name").getAttribute("value"),
|
||||
L10N.getStr("responseHeaders") + " (" +
|
||||
L10N.getFormatStr("networkMenu.sizeKB", "0.169") + ")",
|
||||
L10N.getFormatStr("networkMenu.sizeKB", L10N.numberWithDecimals(0.168, 3)) + ")",
|
||||
"The response headers scope doesn't have the correct title.");
|
||||
|
||||
ok(requestScope.querySelector(".name").getAttribute("value").contains(
|
||||
L10N.getStr("requestHeaders") + " (0."),
|
||||
// Can't test for full request headers title because the size may
|
||||
// vary across platforms ("User-Agent" header differs).
|
||||
L10N.getStr("requestHeaders") + " (0"),
|
||||
"The request headers scope doesn't have the correct title.");
|
||||
// Can't test for full request headers title because the size may
|
||||
// vary across platforms ("User-Agent" header differs). We're pretty
|
||||
// sure it's smaller than 1 MB though, so it starts with a 0.
|
||||
|
||||
is(responseScope.querySelectorAll(".variables-view-variable .name")[0].getAttribute("value"),
|
||||
"Connection", "The first response header name was incorrect.");
|
||||
|
@ -24,7 +24,7 @@ function test() {
|
||||
statusText: "Switching Protocols",
|
||||
type: "plain",
|
||||
fullMimeType: "text/plain; charset=utf-8",
|
||||
size: L10N.getFormatStr("networkMenu.sizeKB", "0.00"),
|
||||
size: L10N.getFormatStr("networkMenu.sizeKB", 0),
|
||||
time: true
|
||||
});
|
||||
verifyRequestItemTarget(requestItems[1] = RequestsMenu.getItemAtIndex(1),
|
||||
@ -42,7 +42,7 @@ function test() {
|
||||
statusText: "See Other",
|
||||
type: "plain",
|
||||
fullMimeType: "text/plain; charset=utf-8",
|
||||
size: L10N.getFormatStr("networkMenu.sizeKB", "0.00"),
|
||||
size: L10N.getFormatStr("networkMenu.sizeKB", 0),
|
||||
time: true
|
||||
});
|
||||
verifyRequestItemTarget(requestItems[3] = RequestsMenu.getItemAtIndex(3),
|
||||
|
@ -404,8 +404,8 @@ VariablesView.prototype = {
|
||||
return;
|
||||
}
|
||||
this._searchboxContainer.parentNode.removeChild(this._searchboxContainer);
|
||||
this._searchboxNode.addEventListener("input", this._onSearchboxInput, false);
|
||||
this._searchboxNode.addEventListener("keypress", this._onSearchboxKeyPress, false);
|
||||
this._searchboxNode.removeEventListener("input", this._onSearchboxInput, false);
|
||||
this._searchboxNode.removeEventListener("keypress", this._onSearchboxKeyPress, false);
|
||||
|
||||
this._searchboxContainer = null;
|
||||
this._searchboxNode = null;
|
||||
@ -1543,7 +1543,9 @@ Scope.prototype = {
|
||||
* The click listener for this scope's title.
|
||||
*/
|
||||
_onClick: function S__onClick(e) {
|
||||
if (e.target == this._inputNode) {
|
||||
if (e.target == this._inputNode ||
|
||||
e.target == this._editNode ||
|
||||
e.target == this._deleteNode) {
|
||||
return;
|
||||
}
|
||||
this.toggle();
|
||||
|
@ -201,6 +201,32 @@ ViewHelpers.L10N.prototype = {
|
||||
*/
|
||||
getFormatStr: function L10N_getFormatStr(aName, ...aArgs) {
|
||||
return this.stringBundle.formatStringFromName(aName, aArgs, aArgs.length);
|
||||
},
|
||||
|
||||
/**
|
||||
* Converts a number to a locale-aware string format and keeps a certain
|
||||
* number of decimals.
|
||||
*
|
||||
* @param number aNumber
|
||||
* The number to convert.
|
||||
* @param number aDecimals [optional]
|
||||
* Total decimals to keep.
|
||||
* @return string
|
||||
* The localized number as a string.
|
||||
*/
|
||||
numberWithDecimals: function L10N__numberWithDecimals(aNumber, aDecimals = 0) {
|
||||
// If this is an integer, don't do anything special.
|
||||
if (aNumber == (aNumber | 0)) {
|
||||
return aNumber;
|
||||
}
|
||||
// Remove {n} trailing decimals. Can't use toFixed(n) because
|
||||
// toLocaleString converts the number to a string. Also can't use
|
||||
// toLocaleString(, { maximumFractionDigits: n }) because it's not
|
||||
// implemented on OS X (bug 368838). Gross.
|
||||
let localized = aNumber.toLocaleString(); // localize
|
||||
let padded = localized + new Array(aDecimals).join("0"); // pad with zeros
|
||||
let match = padded.match("([^]*?\\d{" + aDecimals + "})\\d*$");
|
||||
return match.pop();
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -36,6 +36,11 @@
|
||||
-moz-user-focus: normal;
|
||||
}
|
||||
|
||||
.variables-view-scope > .title,
|
||||
.variable-or-property > .title {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.variables-view-scope[non-header] > .title,
|
||||
.variable-or-property[non-header] > .title,
|
||||
.variable-or-property[non-match] > .title {
|
||||
|
@ -80,6 +80,7 @@ this.TiltVisualizer = function TiltVisualizer(aProperties)
|
||||
* Save a reference to the top-level window.
|
||||
*/
|
||||
this.chromeWindow = aProperties.chromeWindow;
|
||||
this.tab = aProperties.tab;
|
||||
|
||||
/**
|
||||
* The canvas element used for rendering the visualization.
|
||||
@ -99,8 +100,6 @@ this.TiltVisualizer = function TiltVisualizer(aProperties)
|
||||
aProperties.onError || null,
|
||||
aProperties.onLoad || null);
|
||||
|
||||
this.bindToInspector(aProperties.tab);
|
||||
|
||||
/**
|
||||
* Visualization mouse and keyboard controller.
|
||||
*/
|
||||
@ -110,11 +109,12 @@ this.TiltVisualizer = function TiltVisualizer(aProperties)
|
||||
TiltVisualizer.prototype = {
|
||||
|
||||
/**
|
||||
* Initializes the visualizer
|
||||
* Initializes the visualizer.
|
||||
*/
|
||||
init: function TV_init()
|
||||
{
|
||||
this.presenter.init();
|
||||
this.bindToInspector(this.tab);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -41,6 +41,7 @@ MOCHITEST_BROWSER_FILES = \
|
||||
browser_tilt_math06.js \
|
||||
browser_tilt_math07.js \
|
||||
browser_tilt_picking.js \
|
||||
browser_tilt_picking_inspector.js \
|
||||
browser_tilt_picking_delete.js \
|
||||
browser_tilt_picking_highlight01-offs.js \
|
||||
browser_tilt_picking_highlight01.js \
|
||||
|
61
browser/devtools/tilt/test/browser_tilt_picking_inspector.js
Normal file
61
browser/devtools/tilt/test/browser_tilt_picking_inspector.js
Normal file
@ -0,0 +1,61 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
"use strict";
|
||||
|
||||
let presenter;
|
||||
|
||||
function test() {
|
||||
if (!isTiltEnabled()) {
|
||||
info("Skipping highlight test because Tilt isn't enabled.");
|
||||
return;
|
||||
}
|
||||
if (!isWebGLSupported()) {
|
||||
info("Skipping highlight test because WebGL isn't supported.");
|
||||
return;
|
||||
}
|
||||
|
||||
waitForExplicitFinish();
|
||||
|
||||
createTab(function() {
|
||||
let { TargetFactory } = Cu.import("resource:///modules/devtools/Target.jsm", {});
|
||||
let target = TargetFactory.forTab(gBrowser.selectedTab);
|
||||
|
||||
gDevTools.showToolbox(target, "inspector").then(function(toolbox) {
|
||||
let contentDocument = toolbox.target.tab.linkedBrowser.contentDocument;
|
||||
let div = contentDocument.getElementById("first-law");
|
||||
toolbox.getCurrentPanel().selection.setNode(div);
|
||||
|
||||
createTilt({
|
||||
onTiltOpen: function(instance)
|
||||
{
|
||||
presenter = instance.presenter;
|
||||
whenOpen();
|
||||
}
|
||||
}, false, function suddenDeath()
|
||||
{
|
||||
info("Tilt could not be initialized properly.");
|
||||
cleanup();
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function whenOpen() {
|
||||
ok(presenter._currentSelection > 0,
|
||||
"Highlighting a node didn't work properly.");
|
||||
ok(!presenter._highlight.disabled,
|
||||
"After highlighting a node, it should be highlighted. D'oh.");
|
||||
ok(!presenter.controller.arcball._resetInProgress,
|
||||
"Highlighting a node that's already visible shouldn't trigger a reset.");
|
||||
|
||||
executeSoon(function() {
|
||||
Services.obs.addObserver(cleanup, DESTROYED, false);
|
||||
Tilt.destroy(Tilt.currentWindowId);
|
||||
});
|
||||
}
|
||||
|
||||
function cleanup() {
|
||||
Services.obs.removeObserver(cleanup, DESTROYED);
|
||||
gBrowser.removeCurrentTab();
|
||||
finish();
|
||||
}
|
@ -67,7 +67,7 @@
|
||||
</menupopup>
|
||||
</popupset>
|
||||
|
||||
<hbox class="hud-outer-wrapper" flex="1">
|
||||
<box class="hud-outer-wrapper devtools-responsive-container" flex="1">
|
||||
<vbox class="hud-console-wrapper" flex="1">
|
||||
<toolbar class="hud-console-filter-toolbar devtools-toolbar" mode="full">
|
||||
<toolbarbutton label="&btnPageNet.label;" type="menu-button"
|
||||
@ -145,5 +145,5 @@
|
||||
<tabs/>
|
||||
<tabpanels flex="1"/>
|
||||
</tabbox>
|
||||
</hbox>
|
||||
</box>
|
||||
</window>
|
||||
|
@ -65,6 +65,12 @@
|
||||
<!ENTITY debuggerUI.showOnlyEnum "Show only enumerable properties">
|
||||
<!ENTITY debuggerUI.showOnlyEnum.key "P">
|
||||
|
||||
<!-- LOCALIZATION NOTE (debuggerUI.showOriginalSource): This is the label for
|
||||
- the checkbox that toggles the display of original or sourcemap-derived
|
||||
- sources. -->
|
||||
<!ENTITY debuggerUI.showOriginalSource "Show original sources">
|
||||
<!ENTITY debuggerUI.showOriginalSource.key "O">
|
||||
|
||||
<!-- LOCALIZATION NOTE (debuggerUI.searchPanelTitle): This is the text that
|
||||
- appears in the filter panel popup as a description. -->
|
||||
<!ENTITY debuggerUI.searchPanelTitle "Operators">
|
||||
|
@ -216,6 +216,7 @@
|
||||
background-color: transparent;
|
||||
-moz-margin-end: -3px;
|
||||
position: relative;
|
||||
cursor: e-resize;
|
||||
}
|
||||
|
||||
/* In-tools sidebar */
|
||||
|
@ -297,3 +297,19 @@
|
||||
#timings-tabpanel .requests-menu-timings-total {
|
||||
transition: transform 0.2s ease-out;
|
||||
}
|
||||
|
||||
/* Responsive sidebar */
|
||||
@media (max-width: 700px) {
|
||||
#details-pane {
|
||||
max-width: none;
|
||||
margin: 0 !important;
|
||||
/* To prevent all the margin hacks to hide the sidebar */
|
||||
}
|
||||
|
||||
.requests-menu-size {
|
||||
border-width: 0px !important;
|
||||
box-shadow: none !important;
|
||||
/* !important are required here because Timeline is not visible and thus
|
||||
the right border and box-shadow of Size column should be hidden */
|
||||
}
|
||||
}
|
||||
|
@ -230,6 +230,7 @@
|
||||
width: 3px;
|
||||
-moz-margin-end: -3px;
|
||||
position: relative;
|
||||
cursor: e-resize;
|
||||
}
|
||||
|
||||
/* In-tools sidebar */
|
||||
|
@ -297,3 +297,19 @@
|
||||
#timings-tabpanel .requests-menu-timings-total {
|
||||
transition: transform 0.2s ease-out;
|
||||
}
|
||||
|
||||
/* Responsive sidebar */
|
||||
@media (max-width: 700px) {
|
||||
#details-pane {
|
||||
max-width: none;
|
||||
margin: 0 !important;
|
||||
/* To prevent all the margin hacks to hide the sidebar */
|
||||
}
|
||||
|
||||
.requests-menu-size {
|
||||
border-width: 0px !important;
|
||||
box-shadow: none !important;
|
||||
/* !important are required here because Timeline is not visible and thus
|
||||
the right border and box-shadow of Size column should be hidden */
|
||||
}
|
||||
}
|
||||
|
@ -83,3 +83,31 @@
|
||||
.devtools-autocomplete-listbox.light-theme > richlistitem > label {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
/* Responsive container */
|
||||
|
||||
.devtools-responsive-container {
|
||||
-moz-box-orient: horizontal;
|
||||
}
|
||||
|
||||
@media (max-width: 700px) {
|
||||
.devtools-responsive-container {
|
||||
-moz-box-orient: vertical;
|
||||
}
|
||||
|
||||
.devtools-responsive-container > .devtools-side-splitter {
|
||||
border: 0;
|
||||
margin: 0;
|
||||
border-top: 1px solid black;
|
||||
min-height: 3px;
|
||||
height: 3px;
|
||||
margin-bottom: -3px;
|
||||
/* In some edge case the cursor is not changed to n-resize */
|
||||
cursor: n-resize;
|
||||
}
|
||||
|
||||
.devtools-responsive-container > .devtools-sidebar-tabs {
|
||||
min-height: 35vh;
|
||||
max-height: 75vh;
|
||||
}
|
||||
}
|
||||
|
@ -236,6 +236,7 @@
|
||||
background-color: transparent;
|
||||
-moz-margin-end: -3px;
|
||||
position: relative;
|
||||
cursor: e-resize;
|
||||
}
|
||||
|
||||
/* In-tools sidebar */
|
||||
|
@ -297,3 +297,19 @@
|
||||
#timings-tabpanel .requests-menu-timings-total {
|
||||
transition: transform 0.2s ease-out;
|
||||
}
|
||||
|
||||
/* Responsive sidebar */
|
||||
@media (max-width: 700px) {
|
||||
#details-pane {
|
||||
max-width: none;
|
||||
margin: 0 !important;
|
||||
/* To prevent all the margin hacks to hide the sidebar */
|
||||
}
|
||||
|
||||
.requests-menu-size {
|
||||
border-width: 0px !important;
|
||||
box-shadow: none !important;
|
||||
/* !important are required here because Timeline is not visible and thus
|
||||
the right border and box-shadow of Size column should be hidden */
|
||||
}
|
||||
}
|
||||
|
@ -486,6 +486,23 @@ DebuggerClient.prototype = {
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Reconfigure a thread actor.
|
||||
*
|
||||
* @param boolean aUseSourceMaps
|
||||
* A flag denoting whether to use source maps or not.
|
||||
* @param function aOnResponse
|
||||
* Called with the response packet.
|
||||
*/
|
||||
reconfigureThread: function DC_reconfigureThread(aUseSourceMaps, aOnResponse) {
|
||||
let packet = {
|
||||
to: this.activeThread._actor,
|
||||
type: "reconfigure",
|
||||
options: { useSourceMaps: aUseSourceMaps }
|
||||
};
|
||||
this.request(packet, aOnResponse);
|
||||
},
|
||||
|
||||
/**
|
||||
* Release an object actor.
|
||||
*
|
||||
|
@ -253,6 +253,18 @@ ThreadActor.prototype = {
|
||||
};
|
||||
},
|
||||
|
||||
onReconfigure: function TA_onReconfigure(aRequest) {
|
||||
if (this.state == "exited") {
|
||||
return { error: "wrongState" };
|
||||
}
|
||||
|
||||
update(this._options, aRequest.options || {});
|
||||
// Clear existing sources, so they can be recreated on next access.
|
||||
this._sources = null;
|
||||
|
||||
return {};
|
||||
},
|
||||
|
||||
/**
|
||||
* Pause the debuggee, by entering a nested event loop, and return a 'paused'
|
||||
* packet to the client.
|
||||
@ -1281,6 +1293,7 @@ ThreadActor.prototype = {
|
||||
ThreadActor.prototype.requestTypes = {
|
||||
"attach": ThreadActor.prototype.onAttach,
|
||||
"detach": ThreadActor.prototype.onDetach,
|
||||
"reconfigure": ThreadActor.prototype.onReconfigure,
|
||||
"resume": ThreadActor.prototype.onResume,
|
||||
"clientEvaluate": ThreadActor.prototype.onClientEvaluate,
|
||||
"frames": ThreadActor.prototype.onFrames,
|
||||
|
Loading…
Reference in New Issue
Block a user