Bug 1385337 - add MDN learn more link to source map errors; r?bgrins draft
authorTom Tromey <tom@tromey.com>
Fri, 15 Sep 2017 14:15:10 -0600
changeset 665658 37134f22a98d999e78154346da6b151e6fd89907
parent 665657 eba07bb1d697ccb0bcc822bc80e7683bc0ca1879
child 731844 565e2b886ddc0cb429e81d3d00073a96afd88562
push id80132
push userbmo:ttromey@mozilla.com
push dateFri, 15 Sep 2017 20:17:14 +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(".message-body"), "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];