Bug 1509493 - Provide basic test coverage for email address parsing r=BenB
☠☠ backed out by a0e0ae690520 ☠ ☠
authorFabian Henneke <fabian@henneke.me>
Thu, 29 Nov 2018 15:49:31 +0000
changeset 507961 5e4a5cf81c26fc19a52f9e39e42f0f2470d80774
parent 507960 15fb49ca9d9f1a37dfffa9af03535c40f9a4c7e0
child 507962 6498765e1d6544fc962945e2f0873356434f4bd9
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersBenB
bugs1509493
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1509493 - Provide basic test coverage for email address parsing r=BenB Differential Revision: https://phabricator.services.mozilla.com/D13389
netwerk/test/unit/test_mozTXTToHTMLConv.js
--- a/netwerk/test/unit/test_mozTXTToHTMLConv.js
+++ b/netwerk/test/unit/test_mozTXTToHTMLConv.js
@@ -11,26 +11,38 @@ function run_test() {
                      .getService(Ci.mozITXTToHTMLConv);
 
   const scanTXTtests = [
     // -- RFC1738
     {
       input: "RFC1738: <URL:http://mozilla.org> then",
       url: "http://mozilla.org"
     },
+    {
+      input: "RFC1738: <URL:mailto:john.doe+test@mozilla.org> then",
+      url: "mailto:john.doe+test@mozilla.org"
+    },
     // -- RFC2396E
     {
       input: "RFC2396E: <http://mozilla.org/> then",
       url: "http://mozilla.org/"
     },
+    {
+      input: "RFC2396E: <john.doe+test@mozilla.org> then",
+      url: "mailto:john.doe+test@mozilla.org"
+    },
     // -- abbreviated
     {
       input: "see www.mozilla.org maybe",
       url: "http://www.mozilla.org"
     },
+    {
+      input: "mail john.doe+test@mozilla.org maybe",
+      url: "mailto:john.doe+test@mozilla.org"
+    },
     // -- delimiters
     {
       input: "see http://www.mozilla.org/maybe today",  // Spaces
       url: "http://www.mozilla.org/maybe"
     },
     {
       input: "see \"http://www.mozilla.org/maybe today\"",  // Double quotes
       url: "http://www.mozilla.org/maybetoday"              // spaces ignored
@@ -81,20 +93,28 @@ function run_test() {
       input:"'http://example.org/?test=true&success=true': ok",
       url: "http://example.org/?test=true&amp;success=true"
     },
     {
       input: "bracket: http://localhost/[1] etc.",
       url: "http://localhost/"
     },
     {
+      input: "bracket: john.doe+test@mozilla.org[1] etc.",
+      url: "mailto:john.doe+test@mozilla.org"
+    },
+    {
       input: "parenthesis: (http://localhost/) etc.",
       url: "http://localhost/"
     },
     {
+      input: "parenthesis: (john.doe+test@mozilla.org) etc.",
+      url: "mailto:john.doe+test@mozilla.org"
+    },
+    {
       input: "(thunderbird)http://mozilla.org/thunderbird",
       url: "http://mozilla.org/thunderbird"
     },
     {
       input: "()http://mozilla.org",
       url: "http://mozilla.org"
     },
     {