Bug 1385337 - add MDN learn more link to source map errors; r=bgrins
authorTom Tromey <tom@tromey.com>
Fri, 15 Sep 2017 14:15:10 -0600
changeset 666660 5430d402cfd5da4caf7b5b6e8fb27fe7fd7034cc
parent 666659 ec282eb58c6ca5b57162df127fd067f12abb365e
child 666661 a3c89c07aff9c9c3dcb49da4f48e0feaf8c5b350
push id80486
push userbmo:tlin@mozilla.com
push dateTue, 19 Sep 2017 03:52:30 +0000
reviewersbgrins
bugs1385337
milestone57.0a1
Bug 1385337 - add MDN learn more link to source map errors; r=bgrins MozReview-Commit-ID: 185sNVSJIrz
devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_sourcemap_nosource.js
devtools/server/actors/errordocs.js
--- a/devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_sourcemap_nosource.js
+++ b/devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_sourcemap_nosource.js
@@ -46,9 +46,11 @@ add_task(function* () {
 
   yield testOpenInDebugger(hud, toolbox, "here");
 
   info("Selecting the console again");
   yield toolbox.selectTool("webconsole");
 
   const node = yield waitFor(() => findMessage(hud, "original source"));
   ok(node, "source map error is displayed in web console");
+
+  ok(!!node.querySelector(".learn-more-link"), "source map error has learn more link");
 });
--- a/devtools/server/actors/errordocs.js
+++ b/devtools/server/actors/errordocs.js
@@ -88,25 +88,27 @@ const ErrorDocs = {
 
 const MIXED_CONTENT_LEARN_MORE = "https://developer.mozilla.org/docs/Web/Security/Mixed_content";
 const TRACKING_PROTECTION_LEARN_MORE = "https://developer.mozilla.org/Firefox/Privacy/Tracking_Protection";
 const INSECURE_PASSWORDS_LEARN_MORE = "https://developer.mozilla.org/docs/Web/Security/Insecure_passwords";
 const PUBLIC_KEY_PINS_LEARN_MORE = "https://developer.mozilla.org/docs/Web/HTTP/Public_Key_Pinning";
 const STRICT_TRANSPORT_SECURITY_LEARN_MORE = "https://developer.mozilla.org/docs/Web/HTTP/Headers/Strict-Transport-Security";
 const WEAK_SIGNATURE_ALGORITHM_LEARN_MORE = "https://developer.mozilla.org/docs/Web/Security/Weak_Signature_Algorithm";
 const MIME_TYPE_MISMATCH_LEARN_MORE = "https://developer.mozilla.org/docs/Web/HTTP/Headers/X-Content-Type-Options";
+const SOURCE_MAP_LEARN_MORE = "https://developer.mozilla.org/en-US/docs/Tools/Debugger/Source_map_errors";
 const ErrorCategories = {
   "Insecure Password Field": INSECURE_PASSWORDS_LEARN_MORE,
   "Mixed Content Message": MIXED_CONTENT_LEARN_MORE,
   "Mixed Content Blocker": MIXED_CONTENT_LEARN_MORE,
   "Invalid HPKP Headers": PUBLIC_KEY_PINS_LEARN_MORE,
   "Invalid HSTS Headers": STRICT_TRANSPORT_SECURITY_LEARN_MORE,
   "SHA-1 Signature": WEAK_SIGNATURE_ALGORITHM_LEARN_MORE,
   "Tracking Protection": TRACKING_PROTECTION_LEARN_MORE,
   "MIMEMISMATCH": MIME_TYPE_MISMATCH_LEARN_MORE,
+  "source map": SOURCE_MAP_LEARN_MORE,
 };
 
 exports.GetURL = (error) => {
   if (!error) {
     return undefined;
   }
 
   let doc = ErrorDocs[error.errorMessageName];