Bug 1509493 - Provide basic test coverage for email address parsing r=BenB
authorFabian Henneke <fabian@henneke.me>
Sun, 02 Dec 2018 22:14:11 +0000
changeset 508393 b4808c4e7d61c68cebd13865685a28a47d72b982
parent 508392 51e67c682e39c167ae275cb2a18ee31f68346a09
child 508394 00d7ff2eeb0ad9eaeb2fe79a0c275b305f26f766
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 Depends on D13511 Differential Revision: https://phabricator.services.mozilla.com/D13644
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"
     },
     {