Backed out changeset 8ff81b6fdfb8 (bug 1317962) for frequent Windows failures in browser_console_copy_entire_message_context_menu.js

CLOSED TREE

MozReview-Commit-ID: ADIiRxXlKs1
This commit is contained in:
Phil Ringnalda 2017-05-04 20:56:39 -07:00
Родитель 76dc3f1ddf
Коммит 6ff93fd449
12 изменённых файлов: 14 добавлений и 135 удалений

Просмотреть файл

@ -35,16 +35,13 @@ const StackTrace = createClass({
stacktrace: PropTypes.array.isRequired,
onViewSourceInDebugger: PropTypes.func.isRequired,
onViewSourceInScratchpad: PropTypes.func,
// Service to enable the source map feature.
sourceMapService: PropTypes.object,
},
render() {
let {
stacktrace,
onViewSourceInDebugger,
onViewSourceInScratchpad,
sourceMapService,
onViewSourceInScratchpad
} = this.props;
let frames = [];
@ -70,8 +67,7 @@ const StackTrace = createClass({
showFullSourceUrl: true,
onClick: (/^Scratchpad\/\d+$/.test(source))
? onViewSourceInScratchpad
: onViewSourceInDebugger,
sourceMapService,
: onViewSourceInDebugger
}), "\n");
});

Просмотреть файл

@ -9,7 +9,6 @@ support-files =
[test_notification_box_03.html]
[test_sidebar_toggle.html]
[test_stack-trace.html]
[test_stack-trace-source-maps.html]
[test_tabs_accessibility.html]
[test_tabs_menu.html]
[test_tree_01.html]

Просмотреть файл

@ -1,105 +0,0 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!DOCTYPE HTML>
<html>
<!--
Test the rendering of a stack trace with source maps
-->
<head>
<meta charset="utf-8">
<title>StackTrace component test</title>
<script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script src="chrome://mochikit/content/tests/SimpleTest/SpawnTask.js"></script>
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
</head>
<body>
<script src="head.js"></script>
<script>
/* import-globals-from head.js */
"use strict";
window.onload = function () {
let ReactDOM = browserRequire("devtools/client/shared/vendor/react-dom");
let React = browserRequire("devtools/client/shared/vendor/react");
let StackTrace = React.createFactory(
browserRequire("devtools/client/shared/components/stack-trace")
);
ok(StackTrace, "Got the StackTrace factory");
add_task(function* () {
let stacktrace = [
{
filename: "https://bugzilla.mozilla.org/bundle.js",
lineNumber: 99,
columnNumber: 10
},
{
functionName: "loadFunc",
filename: "https://bugzilla.mozilla.org/bundle.js",
lineNumber: 108,
}
];
let props = {
stacktrace,
onViewSourceInDebugger: () => {},
onViewSourceInScratchpad: () => {},
// A mock source map service.
sourceMapService: {
originalPositionFor: function (url, line, column) {
let newLine = line === 99 ? 1 : 7;
// Return a phony promise-like thing that resolves
// immediately.
return {
then: function (consequence) {
consequence({
sourceId: "whatever",
sourceUrl: "https://bugzilla.mozilla.org/original.js",
line: newLine,
column,
});
},
};
}
},
};
let trace = ReactDOM.render(StackTrace(props), window.document.body);
yield forceRender(trace);
let traceEl = ReactDOM.findDOMNode(trace);
ok(traceEl, "Rendered StackTrace has an element");
// Get the child nodes and filter out the text-only whitespace ones
let frameEls = Array.from(traceEl.childNodes)
.filter(n => n.className && n.className.includes("frame"));
ok(frameEls, "Rendered StackTrace has frames");
is(frameEls.length, 2, "StackTrace has 2 frames");
checkFrameString({
el: frameEls[0],
functionName: "<anonymous>",
source: "https://bugzilla.mozilla.org/original.js",
file: "original.js",
line: 1,
column: 10,
shouldLink: true,
tooltip: "View source in Debugger → https://bugzilla.mozilla.org/original.js:1:10",
});
checkFrameString({
el: frameEls[1],
functionName: "loadFunc",
source: "https://bugzilla.mozilla.org/original.js",
file: "original.js",
line: 7,
column: null,
shouldLink: true,
tooltip: "View source in Debugger → https://bugzilla.mozilla.org/original.js:7",
});
});
};
</script>
</body>
</html>

Просмотреть файл

@ -3556,12 +3556,9 @@ Widgets.Stacktrace.prototype = extend(Widgets.BaseWidget.prototype, {
result.className = "stacktrace devtools-monospace";
if (this.stacktrace) {
const target = this.message.output.toolboxTarget;
const toolbox = gDevTools.getToolbox(target);
this.output.owner.ReactDOM.render(this.output.owner.StackTraceView({
stacktrace: this.stacktrace,
onViewSourceInDebugger: frame => this.output.openLocationInDebugger(frame),
sourceMapService: toolbox ? toolbox.sourceMapURLService : null,
onViewSourceInDebugger: frame => this.output.openLocationInDebugger(frame)
}), result);
}

Просмотреть файл

@ -38,9 +38,7 @@ var NetInfoBody = React.createClass({
data: PropTypes.shape({
request: PropTypes.object.isRequired,
response: PropTypes.object.isRequired
}),
// Service to enable the source map feature.
sourceMapService: PropTypes.object,
})
},
displayName: "NetInfoBody",
@ -78,7 +76,7 @@ var NetInfoBody = React.createClass({
},
getTabPanels() {
let { actions, sourceMapService } = this.props;
let actions = this.props.actions;
let data = this.state.data;
let {request} = data;
@ -155,8 +153,7 @@ var NetInfoBody = React.createClass({
title: Locale.$STR("netRequest.callstack")},
StackTraceTab({
data: data,
actions: actions,
sourceMapService: sourceMapService,
actions: actions
})
)
);

Просмотреть файл

@ -13,17 +13,15 @@ const StackTraceTab = createClass({
data: PropTypes.object.isRequired,
actions: PropTypes.shape({
onViewSourceInDebugger: PropTypes.func.isRequired
}),
// Service to enable the source map feature.
sourceMapService: PropTypes.object,
})
},
render() {
let { stacktrace } = this.props.data.cause;
let { actions, sourceMapService } = this.props;
let { actions } = this.props;
let onViewSourceInDebugger = actions.onViewSourceInDebugger.bind(actions);
return StackTrace({ stacktrace, onViewSourceInDebugger, sourceMapService });
return StackTrace({ stacktrace, onViewSourceInDebugger });
}
});

Просмотреть файл

@ -163,8 +163,7 @@ NetRequest.prototype = {
// As soon as Redux is in place state and actions will come from
// separate modules.
let body = NetInfoBody({
actions: this,
sourceMapService: this.owner.sourceMapURLService,
actions: this
});
// Render net info body!

Просмотреть файл

@ -30,7 +30,6 @@ const ConsoleOutput = createClass({
serviceContainer: PropTypes.shape({
attachRefToHud: PropTypes.func.isRequired,
openContextMenu: PropTypes.func.isRequired,
sourceMapService: PropTypes.object,
}),
autoscroll: PropTypes.bool.isRequired,
dispatch: PropTypes.func.isRequired,

Просмотреть файл

@ -20,7 +20,6 @@ ConsoleCommand.propTypes = {
autoscroll: PropTypes.bool.isRequired,
indent: PropTypes.number.isRequired,
timestampsVisible: PropTypes.bool.isRequired,
serviceContainer: PropTypes.object,
};
ConsoleCommand.defaultProps = {
@ -36,7 +35,6 @@ function ConsoleCommand(props) {
indent,
message,
timestampsVisible,
serviceContainer,
} = props;
const {
@ -46,6 +44,10 @@ function ConsoleCommand(props) {
messageText: messageBody,
} = message;
const {
serviceContainer,
} = props;
return Message({
source,
type,

Просмотреть файл

@ -20,7 +20,6 @@ EvaluationResult.propTypes = {
message: PropTypes.object.isRequired,
indent: PropTypes.number.isRequired,
timestampsVisible: PropTypes.bool.isRequired,
serviceContainer: PropTypes.object,
};
EvaluationResult.defaultProps = {

Просмотреть файл

@ -20,7 +20,6 @@ PageError.propTypes = {
open: PropTypes.bool,
indent: PropTypes.number.isRequired,
timestampsVisible: PropTypes.bool.isRequired,
serviceContainer: PropTypes.object,
};
PageError.defaultProps = {

Просмотреть файл

@ -148,7 +148,6 @@ const Message = createClass({
stacktrace: stacktrace,
onViewSourceInDebugger: serviceContainer.onViewSourceInDebugger,
onViewSourceInScratchpad: serviceContainer.onViewSourceInScratchpad,
sourceMapService: serviceContainer.sourceMapService,
})
);
}