Backed out changeset f71740ef8656 (bug 1259563) for a string of webconsole test failures starting with test_jsterm_queryselector.html

MozReview-Commit-ID: 6h3LI6fTQFT
This commit is contained in:
Wes Kocher 2016-04-08 16:54:35 -07:00
parent dfc7e5253f
commit 1a3f93d4b1
5 changed files with 6 additions and 59 deletions

View File

@ -510,10 +510,6 @@ a {
text-decoration: underline;
}
a.learn-more-link.webconsole-learn-more-link {
font-style: normal;
}
/* Open DOMNode in inspector button */
.open-inspector {
background: url("chrome://devtools/skin/images/vview-open-inspector.png") no-repeat 0 0;

View File

@ -1,5 +1,5 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* vim: set ft= javascript ts=2 et sw=2 tw=80: */
/* 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/. */
@ -1341,10 +1341,8 @@ Messages.Extended.prototype = Heritage.extend(Messages.Simple.prototype,
* The evaluation response packet received from the server.
* @param string [errorMessage]
* Optional error message to display.
* @param string [errorDocLink]
* Optional error doc URL to link to.
*/
Messages.JavaScriptEvalOutput = function(evalResponse, errorMessage, errorDocLink)
Messages.JavaScriptEvalOutput = function(evalResponse, errorMessage)
{
let severity = "log", msg, quoteStrings = true;
@ -1367,13 +1365,7 @@ Messages.JavaScriptEvalOutput = function(evalResponse, errorMessage, errorDocLin
severity: severity,
quoteStrings: quoteStrings,
};
let messages = [msg];
if (errorDocLink) {
messages.push(errorDocLink);
}
Messages.Extended.call(this, messages, options);
Messages.Extended.call(this, [msg], options);
};
Messages.JavaScriptEvalOutput.prototype = Messages.Extended.prototype;

View File

@ -1,5 +1,5 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* vim: set ft= javascript ts=2 et sw=2 tw=80: */
/* 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/. */
@ -308,22 +308,6 @@ JSTerm.prototype = {
return;
}
let errorMessage = response.exceptionMessage;
let errorDocURL = response.exceptionDocURL;
let errorDocLink;
if (errorDocURL) {
errorMessage += " ";
errorDocLink = this.hud.document.createElementNS(XHTML_NS, "a");
errorDocLink.className = "learn-more-link webconsole-learn-more-link";
errorDocLink.textContent = "[" + l10n.getStr("webConsoleMoreInfoLabel") + "]";
errorDocLink.title = errorDocURL;
errorDocLink.href = "#";
errorDocLink.draggable = false;
errorDocLink.addEventListener("click", () => {
this.hud.owner.openLink(errorDocURL);
});
}
// Wrap thrown strings in Error objects, so `throw "foo"` outputs
// "Error: foo"
if (typeof(response.exception) === "string") {
@ -372,7 +356,7 @@ JSTerm.prototype = {
return;
}
let msg = new Messages.JavaScriptEvalOutput(response, errorMessage, errorDocLink);
let msg = new Messages.JavaScriptEvalOutput(response, errorMessage);
this.hud.output.addMessage(msg);
if (callback) {

View File

@ -166,26 +166,4 @@ function* testJSTerm(hud) {
return node.parentNode.getAttribute("severity") === "error" &&
node.textContent === Object.prototype.toString();
}, "thrown object generates error message");
// check that errors with entires in errordocs.js display links
// alongside their messages.
const ErrorDocs = require("devtools/server/actors/errordocs");
const ErrorDocStatements = {
"JSMSG_BAD_RADIX": "(42).toString(0);",
"JSMSG_BAD_ARRAY_LENGTH": "([]).length = -1",
"JSMSG_NEGATIVE_REPETITION_COUNT": "'abc'.repeat(-1);",
"JSMSG_BAD_FORMAL": "var f = Function('x y', 'return x + y;');",
"JSMSG_PRECISION_RANGE": "77.1234.toExponential(-1);",
};
for (let errorMessageName of Object.keys(ErrorDocStatements)) {
let url = ErrorDocs.GetURL(errorMessageName);
jsterm.clearOutput();
yield jsterm.execute(ErrorDocStatements[errorMessageName]);
yield checkResult((node) => {
return node.parentNode.getElementsByTagName("a")[0].title == url;
}, `error links to ${url}`);
}
}

View File

@ -13,7 +13,6 @@ const { EnvironmentActor } = require("devtools/server/actors/environment");
const { ThreadActor } = require("devtools/server/actors/script");
const { ObjectActor, LongStringActor, createValueGrip, stringIsLong } = require("devtools/server/actors/object");
const DevToolsUtils = require("devtools/shared/DevToolsUtils");
const ErrorDocs = require("devtools/server/actors/errordocs");
loader.lazyRequireGetter(this, "NetworkMonitor", "devtools/shared/webconsole/network-monitor", true);
loader.lazyRequireGetter(this, "NetworkMonitorChild", "devtools/shared/webconsole/network-monitor", true);
@ -874,7 +873,7 @@ WebConsoleActor.prototype =
let evalResult = evalInfo.result;
let helperResult = evalInfo.helperResult;
let result, errorDocURL, errorMessage, errorGrip = null;
let result, errorMessage, errorGrip = null;
if (evalResult) {
if ("return" in evalResult) {
result = evalResult.return;
@ -890,7 +889,6 @@ WebConsoleActor.prototype =
errorMessage = unsafeDereference && unsafeDereference.toString
? unsafeDereference.toString()
: String(error);
errorDocURL = ErrorDocs.GetURL(error && error.errorMessageName)
}
}
@ -912,7 +910,6 @@ WebConsoleActor.prototype =
timestamp: timestamp,
exception: errorGrip,
exceptionMessage: this._createStringGrip(errorMessage),
exceptionDocURL: errorDocURL,
helperResult: helperResult,
};
},