Bug 1357209 - Add label=type-media to invoked webcompat URL - r?gijs draft
authorGerald Squelart <gsquelart@mozilla.com>
Tue, 18 Apr 2017 14:11:51 +1200
changeset 563911 6bcdb94293eeeaffd2658ecbdd48dd42b0fc2c49
parent 563802 a374c35469935a874fefe64d3e07003fc5bc8884
child 624617 55889b375c45e6920fffa7d40977334decfb4dc1
push id54462
push usergsquelart@mozilla.com
push dateTue, 18 Apr 2017 02:22:10 +0000
reviewersgijs
bugs1357209
milestone55.0a1
Bug 1357209 - Add label=type-media to invoked webcompat URL - r?gijs Following https://github.com/webcompat/webcompat.com/issues/1360 , WebCompat now accepts an arbitrary label (to help with sorting incoming reports), which for media issues should be "type-media". MozReview-Commit-ID: B3vaUOlhTBm
browser/base/content/browser-media.js
browser/base/content/test/general/browser_decoderDoctor.js
--- a/browser/base/content/browser-media.js
+++ b/browser/base/content/browser-media.js
@@ -341,16 +341,17 @@ let gDecoderDoctorHandler = {
             if (!clickedInPref) {
               Services.prefs.setBoolPref(buttonClickedPref, true);
               histogram.add(decoderDoctorReportId, TELEMETRY_DDSTAT_CLICKED_FIRST);
             }
             histogram.add(decoderDoctorReportId, TELEMETRY_DDSTAT_CLICKED);
 
             let params = new URLSearchParams;
             params.append("url", docURL);
+            params.append("label", "type-media");
             params.append("problem_type", "video_bug");
             params.append("src", "media-decode-error");
             params.append("details",
                           "Technical Information:\n" + decodeIssue +
                           (resourceURL ? ("\nResource: " + resourceURL) : ""));
             openUILinkIn(endpoint + "?" + params.toString(), "tab");
           }
         });
--- a/browser/base/content/test/general/browser_decoderDoctor.js
+++ b/browser/base/content/test/general/browser_decoderDoctor.js
@@ -153,27 +153,27 @@ add_task(function* test_decode_error() {
   let message = gNavigatorBundle.getString("decoder.decodeError.message");
   yield test_decoder_doctor_notification(
     {type: "decode-error", decodeIssue: "DecodeIssue",
      docURL: "DocURL", resourceURL: "ResURL"},
     message,
     gNavigatorBundle.getString("decoder.decodeError.button"),
     gNavigatorBundle.getString("decoder.decodeError.accesskey"),
     tab_checker_for_webcompat(
-      {url: "DocURL", problem_type: "video_bug",
+      {url: "DocURL", label: "type-media", problem_type: "video_bug",
        details: "Technical Information:\nDecodeIssue\nResource: ResURL"}));
 });
 
 add_task(function* test_decode_warning() {
   yield SpecialPowers.pushPrefEnv(
     { set: [["media.decoder-doctor.new-issue-endpoint",
              "http://127.0.0.1/webcompat"]] });
   let message = gNavigatorBundle.getString("decoder.decodeWarning.message");
   yield test_decoder_doctor_notification(
     {type: "decode-warning", decodeIssue: "DecodeIssue",
      docURL: "DocURL", resourceURL: "ResURL"},
     message,
     gNavigatorBundle.getString("decoder.decodeError.button"),
     gNavigatorBundle.getString("decoder.decodeError.accesskey"),
     tab_checker_for_webcompat(
-      {url: "DocURL", problem_type: "video_bug",
+      {url: "DocURL", label: "type-media", problem_type: "video_bug",
        details: "Technical Information:\nDecodeIssue\nResource: ResURL"}));
 });