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 666356 365e50a885d9cc1c6d42ee96c13175d2cb7c5628
parent 666355 05ad12b87422ca2c3cfb14a9c1834d4aece72f31
child 732078 bf755d79997220e6e4d269e45989766cbf9a119d
push id80379
push userbmo:ttromey@mozilla.com
push dateMon, 18 Sep 2017 16:53:48 +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];