Bug 1519742 - fix eslint problems in test_autoconfig*.js test files. r=jorgk
authoraceman <acelists@atlas.sk>
Tue, 15 Jan 2019 13:28:00 +0100
changeset 33357 b6ff801164a8
parent 33356 4c0e476ae818
child 33358 172542e8cd4a
push id2368
push userclokep@gmail.com
push dateMon, 28 Jan 2019 21:12:50 +0000
treeherdercomm-beta@56d23c07d815 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorgk
bugs1519742
Bug 1519742 - fix eslint problems in test_autoconfig*.js test files. r=jorgk
mail/components/test/unit/test_autoconfigFetchDisk.js
mail/components/test/unit/test_autoconfigUtils.js
mail/components/test/unit/test_autoconfigXML.js
--- a/mail/components/test/unit/test_autoconfigFetchDisk.js
+++ b/mail/components/test/unit/test_autoconfigFetchDisk.js
@@ -6,65 +6,61 @@
 /**
  * Tests getting a configuration file from the local isp directory and
  * reading that file.
  */
 
 // Globals
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-Cu.importGlobalProperties(["DOMParser"]);  // Necessary for fetchConfig.js.
 
 var kXMLFile = "example.com.xml";
 var fetchConfigAbortable;
 var copyLocation;
 
 var xmlReader =
 {
-  setTimeout : function(func, interval) {
+  setTimeout(func, interval) {
     do_timeout(interval, func);
-  }
+  },
 };
 
 Services.scriptloader.loadSubScript(
     "chrome://messenger/content/accountcreation/util.js", xmlReader);
 Services.scriptloader.loadSubScript(
     "chrome://messenger/content/accountcreation/fetchConfig.js", xmlReader);
 Services.scriptloader.loadSubScript(
     "chrome://messenger/content/accountcreation/accountConfig.js", xmlReader);
 Services.scriptloader.loadSubScript(
     "chrome://messenger/content/accountcreation/sanitizeDatatypes.js",
     xmlReader);
 Services.scriptloader.loadSubScript(
     "chrome://messenger/content/accountcreation/readFromXML.js", xmlReader);
 
-function onTestSuccess(config)
-{
+function onTestSuccess(config) {
   // Check that we got the expected config.
   xmlReader.replaceVariables(config,
                              "Yamato Nadeshiko",
                              "yamato.nadeshiko@example.com",
                              "abc12345");
 
   Assert.equal(config.incoming.username, "yamato.nadeshiko");
   Assert.equal(config.outgoing.username, "yamato.nadeshiko@example.com");
   Assert.equal(config.incoming.hostname, "pop.example.com");
   Assert.equal(config.outgoing.hostname, "smtp.example.com");
   Assert.equal(config.identity.realname, "Yamato Nadeshiko");
   Assert.equal(config.identity.emailAddress, "yamato.nadeshiko@example.com");
   do_test_finished();
 }
 
-function onTestFailure(e)
-{
+function onTestFailure(e) {
   do_throw(e);
 }
 
-function run_test()
-{
+function run_test() {
   registerCleanupFunction(finish_test);
 
   // Copy the xml file into place
   let file = do_get_file("data/" + kXMLFile);
 
   copyLocation = Services.dirsvc.get("CurProcD", Ci.nsIFile);
   copyLocation.append("isp");
 
@@ -75,14 +71,13 @@ function run_test()
   // Now run the actual test
   // Note we keep a global copy of this so that the abortable doesn't get
   // garbage collected before the async operation has finished.
   fetchConfigAbortable = xmlReader.fetchConfigFromDisk("example.com",
                                                        onTestSuccess,
                                                        onTestFailure);
 }
 
-function finish_test()
-{
+function finish_test() {
   // Remove the test config file
   copyLocation.append(kXMLFile);
   copyLocation.remove(false);
 }
--- a/mail/components/test/unit/test_autoconfigUtils.js
+++ b/mail/components/test/unit/test_autoconfigUtils.js
@@ -15,68 +15,69 @@
  * - Test the returned CMDS.
  * - Figure out what else to test.
  */
 
 // Globals
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
+/* import-globals-from ../../accountcreation/content/util.js */
+/* import-globals-from ../../accountcreation/content/accountConfig.js */
+/* import-globals-from ../../accountcreation/content/sanitizeDatatypes.js */
+/* import-globals-from ../../accountcreation/content/fetchhttp.js */
+/* import-globals-from ../../accountcreation/content/guessConfig.js */
+
 Services.scriptloader.loadSubScript("chrome://messenger/content/accountcreation/util.js");
 Services.scriptloader.loadSubScript("chrome://messenger/content/accountcreation/accountConfig.js");
 Services.scriptloader.loadSubScript("chrome://messenger/content/accountcreation/sanitizeDatatypes.js");
 Services.scriptloader.loadSubScript("chrome://messenger/content/accountcreation/fetchhttp.js");
 Services.scriptloader.loadSubScript("chrome://messenger/content/accountcreation/guessConfig.js");
 
 /*
  * UTILITIES
  */
 
-function assert(aBeTrue, aWhy)
-{
+function assert(aBeTrue, aWhy) {
   if (!aBeTrue)
     do_throw(aWhy);
   Assert.ok(aBeTrue);
-};
+}
 
-function assert_equal(aA, aB, aWhy)
-{
+function assert_equal(aA, aB, aWhy) {
   if (aA != aB)
     do_throw(aWhy);
   Assert.equal(aA, aB);
-};
+}
 
 /**
  * Test that two host entries are the same, ignoring the commands.
  */
-function assert_equal_host_entries(hostEntry, expected)
-{
+function assert_equal_host_entries(hostEntry, expected) {
   assert_equal(hostEntry.protocol, expected[0], "Protocols are different");
   assert_equal(hostEntry.ssl, expected[1], "SSL values are different");
   assert_equal(hostEntry.port, expected[2], "Port values are different");
-};
+}
 
 /**
  * Assert that the list of tryOrders are the same.
  */
-function assert_equal_try_orders(aA, aB)
-{
+function assert_equal_try_orders(aA, aB) {
   assert_equal(aA.length, aB.length, "tryOrders have different length");
-  for (let [i,subA] of aA.entries()) {
+  for (let [i, subA] of aA.entries()) {
     let subB = aB[i];
     assert_equal_host_entries(subA, subB);
   }
-};
+}
 
 /**
  * Check that the POP calculations are correct for a given host and
  * protocol.
  */
-function checkPop(host, protocol)
-{
+function checkPop(host, protocol) {
   // The list of protocol+ssl+port configurations should match
   // getIncomingTryOrder() in guessConfig.js.
   // SSL configs are separated until bug 1520283 is fixed.
 
   // port == UNKNOWN
     // [POP, TLS, 110], [POP, SSL, 995], [POP, NONE, 110]
   // port != UNKNOWN
     // ssl == UNKNOWN
@@ -114,24 +115,23 @@ function checkPop(host, protocol)
                         // [POP, SSL, port],
                            [POP, NONE, port]]);
 
   for (ssl in [TLS, SSL, NONE]) {
     tryOrder = getIncomingTryOrder(host, protocol, ssl, port);
     assert_equal_try_orders(tryOrder,
                             [[POP, ssl, port]]);
   }
-};
+}
 
 /**
  * Check that the IMAP calculations are correct for a given host and
  * protocol.
  */
-function checkImap(host, protocol)
-{
+function checkImap(host, protocol) {
   // The list of protocol+ssl+port configurations should match
   // getIncomingTryOrder() in guessConfig.js.
   // SSL configs are separated until bug 1520283 is fixed.
 
   // port == UNKNOWN
     // [IMAP, TLS, 143], [IMAP, SSL, 993], [IMAP, NONE, 143]
   // port != UNKNOWN
     // ssl == UNKNONWN
@@ -170,30 +170,29 @@ function checkImap(host, protocol)
                         // [IMAP, SSL, port],
                            [IMAP, NONE, port]]);
 
   for (ssl in [TLS, SSL, NONE]) {
     tryOrder = getIncomingTryOrder(host, protocol, ssl, port);
     assert_equal_try_orders(tryOrder,
                             [[IMAP, ssl, port]]);
   }
-};
+}
 
 /*
  * TESTS
  */
 
 /**
  * Test that getHostEntry returns the correct port numbers.
  *
  * TODO:
  * - Test the returned commands as well.
  */
-function test_getHostEntry()
-{
+function test_getHostEntry() {
   // IMAP port numbers.
   assert_equal_host_entries(getHostEntry(IMAP, TLS, UNKNOWN),
                             [IMAP, TLS, 143]);
   assert_equal_host_entries(getHostEntry(IMAP, SSL, UNKNOWN),
                             [IMAP, SSL, 993]);
   assert_equal_host_entries(getHostEntry(IMAP, NONE, UNKNOWN),
                             [IMAP, NONE, 143]);
 
@@ -207,37 +206,36 @@ function test_getHostEntry()
 
   // SMTP port numbers.
   assert_equal_host_entries(getHostEntry(SMTP, TLS, UNKNOWN),
                             [SMTP, TLS, 587]);
   assert_equal_host_entries(getHostEntry(SMTP, SSL, UNKNOWN),
                             [SMTP, SSL, 465]);
   assert_equal_host_entries(getHostEntry(SMTP, NONE, UNKNOWN),
                             [SMTP, NONE, 587]);
-};
+}
 
 /**
  * Test the getIncomingTryOrder method.
  */
-function test_getIncomingTryOrder()
-{
+function test_getIncomingTryOrder() {
   // The list of protocol+ssl+port configurations should match
   // getIncomingTryOrder() in guessConfig.js.
   // SSL configs are separated until bug 1520283 is fixed.
 
   // protocol == POP || host starts with pop. || host starts with pop3.
-  checkPop( "example.com", POP );
-  checkPop( "pop.example.com", UNKNOWN );
-  checkPop( "pop3.example.com", UNKNOWN );
-  checkPop( "imap.example.com", POP );
+  checkPop("example.com", POP);
+  checkPop("pop.example.com", UNKNOWN);
+  checkPop("pop3.example.com", UNKNOWN);
+  checkPop("imap.example.com", POP);
 
   // protocol == IMAP || host starts with imap.
-  checkImap( "example.com", IMAP );
-  checkImap( "imap.example.com", UNKNOWN );
-  checkImap( "pop.example.com", IMAP );
+  checkImap("example.com", IMAP);
+  checkImap("imap.example.com", UNKNOWN);
+  checkImap("pop.example.com", IMAP);
 
   let domain = "example.com";
   let protocol = UNKNOWN;
   let ssl = UNKNOWN;
   let port = UNKNOWN;
   let tryOrder = getIncomingTryOrder(domain, protocol, ssl, port);
   assert_equal_try_orders(tryOrder,
                           [[IMAP, TLS, 143],
@@ -264,23 +262,22 @@ function test_getIncomingTryOrder()
                            [IMAP, NONE, port],
                            [POP, NONE, port]]);
 
   ssl = SSL;
   tryOrder = getIncomingTryOrder(domain, protocol, ssl, port);
   assert_equal_try_orders(tryOrder,
                           [[IMAP, SSL, port],
                            [POP, SSL, port]]);
-};
+}
 
 /**
  * Test the getOutgoingTryOrder method.
  */
-function test_getOutgoingTryOrder()
-{
+function test_getOutgoingTryOrder() {
   // The list of protocol+ssl+port configurations should match
   // getOutgoingTryOrder() in guessConfig.js.
   // SSL configs are separated until bug 1520283 is fixed.
   let domain = "example.com";
   let protocol = SMTP;
   let ssl = UNKNOWN;
   let port = UNKNOWN;
   let tryOrder = getOutgoingTryOrder(domain, protocol, ssl, port);
@@ -292,28 +289,27 @@ function test_getOutgoingTryOrder()
                            [SMTP, NONE, 25]]);
 
   ssl = SSL;
   tryOrder = getOutgoingTryOrder(domain, protocol, ssl, port);
   assert_equal_try_orders(tryOrder,
                           [[SMTP, SSL, 465]]);
 
   ssl = UNKNOWN;
-  port = 31337
+  port = 31337;
   tryOrder = getOutgoingTryOrder(domain, protocol, ssl, port);
   assert_equal_try_orders(tryOrder,
                           [[SMTP, TLS, port],
                         // [SMTP, SSL, port],
                            [SMTP, NONE, port]]);
 
   ssl = SSL;
   tryOrder = getOutgoingTryOrder(domain, protocol, ssl, port);
   assert_equal_try_orders(tryOrder,
                           [[SMTP, SSL, port]]);
-};
+}
 
 
-function run_test()
-{
+function run_test() {
   test_getHostEntry();
   test_getIncomingTryOrder();
   test_getOutgoingTryOrder();
-};
+}
--- a/mail/components/test/unit/test_autoconfigXML.js
+++ b/mail/components/test/unit/test_autoconfigXML.js
@@ -14,155 +14,150 @@
  * values.
  */
 
 // Globals
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource:///modules/JXON.js");
 
-Cu.importGlobalProperties(["DOMParser"]);
-
 var xmlReader = {};
 Services.scriptloader.loadSubScript(
       "chrome://messenger/content/accountcreation/util.js", xmlReader);
 Services.scriptloader.loadSubScript(
       "chrome://messenger/content/accountcreation/accountConfig.js",
       xmlReader);
 Services.scriptloader.loadSubScript(
       "chrome://messenger/content/accountcreation/sanitizeDatatypes.js",
       xmlReader);
 Services.scriptloader.loadSubScript(
       "chrome://messenger/content/accountcreation/readFromXML.js", xmlReader);
 
 /*
  * UTILITIES
  */
 
-function assert_equal(aA, aB, aWhy)
-{
+function assert_equal(aA, aB, aWhy) {
   if (aA != aB)
     do_throw(aWhy);
   Assert.equal(aA, aB);
-};
+}
 
 /**
  * Test that two config entries are the same.
  */
-function assert_equal_config(aA, aB, field)
-{
+function assert_equal_config(aA, aB, field) {
   assert_equal(aA, aB, "Configured " + field + " is incorrect.");
-};
+}
 
 /*
  * TESTS
  */
 
 /**
  * Test that the xml reader returns a proper config and
  * is also forwards-compatible to new additions to the data format.
  */
-function test_readFromXML_config1()
-{
+function test_readFromXML_config1() {
   var clientConfigXML =
-    '<clientConfig>' +
+    "<clientConfig>" +
       '<emailProvider id="example.com">' +
-        '<domain>example.com</domain>' +
-        '<domain>example.net</domain>' +
-        '<displayName>Example</displayName>' +
-        '<displayShortName>Example Mail</displayShortName>' +
+        "<domain>example.com</domain>" +
+        "<domain>example.net</domain>" +
+        "<displayName>Example</displayName>" +
+        "<displayShortName>Example Mail</displayShortName>" +
 
         // 1. - protocol not supported
         '<incomingServer type="imap5">' +
-          '<hostname>badprotocol.example.com</hostname>' +
-          '<port>993</port>' +
-          '<socketType>SSL</socketType>' +
-          '<username>%EMAILLOCALPART%</username>' +
-          '<authentication>ssl-client-cert</authentication>' +
-        '</incomingServer>' +
+          "<hostname>badprotocol.example.com</hostname>" +
+          "<port>993</port>" +
+          "<socketType>SSL</socketType>" +
+          "<username>%EMAILLOCALPART%</username>" +
+          "<authentication>ssl-client-cert</authentication>" +
+        "</incomingServer>" +
         // 2. - socket type not supported
         '<incomingServer type="imap">' +
-          '<hostname>badsocket.example.com</hostname>' +
-          '<port>993</port>' +
-          '<socketType>key-from-DNSSEC</socketType>' +
-          '<username>%EMAILLOCALPART%</username>' +
-          '<authentication>password-cleartext</authentication>' +
-        '</incomingServer>' +
+          "<hostname>badsocket.example.com</hostname>" +
+          "<port>993</port>" +
+          "<socketType>key-from-DNSSEC</socketType>" +
+          "<username>%EMAILLOCALPART%</username>" +
+          "<authentication>password-cleartext</authentication>" +
+        "</incomingServer>" +
         // 3. - first supported incoming server
         '<incomingServer type="imap">' +
-          '<hostname>imapmail.example.com</hostname>' +
-          '<port>993</port>' +
-          '<socketType>SSL</socketType>' +
-          '<username>%EMAILLOCALPART%</username>' +
-          '<authentication>password-cleartext</authentication>' +
-        '</incomingServer>' +
+          "<hostname>imapmail.example.com</hostname>" +
+          "<port>993</port>" +
+          "<socketType>SSL</socketType>" +
+          "<username>%EMAILLOCALPART%</username>" +
+          "<authentication>password-cleartext</authentication>" +
+        "</incomingServer>" +
         // 4. - auth method not supported
         '<incomingServer type="imap">' +
-          '<hostname>badauth.example.com</hostname>' +
-          '<port>993</port>' +
-          '<socketType>SSL</socketType>' +
-          '<username>%EMAILLOCALPART%</username>' +
-          '<authentication>ssl-client-cert</authentication>' +
-          // Throw in some elements we don't support yet
-          '<imap>' +
-            '<rootFolder path="INBOX." />' +
-            '<specialFolder id="sent" path="INBOX.Sent Mail" />' +
-          '</imap>' +
-        '</incomingServer>' +
+          "<hostname>badauth.example.com</hostname>" +
+          "<port>993</port>" +
+          "<socketType>SSL</socketType>" +
+          "<username>%EMAILLOCALPART%</username>" +
+          "<authentication>ssl-client-cert</authentication>" +
+          // Throw in some elements we don"t support yet
+          "<imap>" +
+            '<rootFolder path="INBOX."/>' +
+            '<specialFolder id="sent" path="INBOX.Sent Mail"/>' +
+          "</imap>" +
+        "</incomingServer>" +
         // 5. - second supported incoming server
         '<incomingServer type="pop3">' +
-          '<hostname>popmail.example.com</hostname>' +
+          "<hostname>popmail.example.com</hostname>" +
           // alternative hostname, not yet supported, should be ignored
-          '<hostname>popbackup.example.com</hostname>' +
-          '<port>110</port>' +
-          '<port>7878</port>' +
+          "<hostname>popbackup.example.com</hostname>" +
+          "<port>110</port>" +
+          "<port>7878</port>" +
           // unsupported socket type
-          '<socketType>GSSAPI2</socketType>' +
+          "<socketType>GSSAPI2</socketType>" +
           // but fall back
-          '<socketType>plain</socketType>' +
-          '<username>%EMAILLOCALPART%</username>' +
-          '<username>%EMAILADDRESS%</username>' +
+          "<socketType>plain</socketType>" +
+          "<username>%EMAILLOCALPART%</username>" +
+          "<username>%EMAILADDRESS%</username>" +
           // unsupported auth method
-          '<authentication>GSSAPI2</authentication>' +
+          "<authentication>GSSAPI2</authentication>" +
           // but fall back
-          '<authentication>password-encrypted</authentication>' +
-          '<pop3>' +
-            '<leaveMessagesOnServer>true</leaveMessagesOnServer>' +
-            '<daysToLeaveMessagesOnServer>999</daysToLeaveMessagesOnServer>' +
-          '</pop3>' +
-        '</incomingServer>' +
+          "<authentication>password-encrypted</authentication>" +
+          "<pop3>" +
+            "<leaveMessagesOnServer>true</leaveMessagesOnServer>" +
+            "<daysToLeaveMessagesOnServer>999</daysToLeaveMessagesOnServer>" +
+          "</pop3>" +
+        "</incomingServer>" +
 
         // outgoing server with invalid auth method
         '<outgoingServer type="smtp">' +
-          '<hostname>badauth.example.com</hostname>' +
-          '<port>587</port>' +
-          '<socketType>STARTTLS</socketType>' +
-          '<username>%EMAILADDRESS%</username>' +
-          '<authentication>smtp-after-imap</authentication>' +
-        '</outgoingServer>' +
+          "<hostname>badauth.example.com</hostname>" +
+          "<port>587</port>" +
+          "<socketType>STARTTLS</socketType>" +
+          "<username>%EMAILADDRESS%</username>" +
+          "<authentication>smtp-after-imap</authentication>" +
+        "</outgoingServer>" +
         // outgoing server - supported
         '<outgoingServer type="smtp">' +
-          '<hostname>smtpout.example.com</hostname>' +
-          '<hostname>smtpfallback.example.com</hostname>' +
-          '<port>587</port>' +
-          '<port>7878</port>' +
-          '<socketType>GSSAPI2</socketType>' +
-          '<socketType>STARTTLS</socketType>' +
-          '<username>%EMAILADDRESS%</username>' +
-          '<username>%EMAILLOCALPART%</username>' +
-          '<authentication>GSSAPI2</authentication>' +
-          '<authentication>client-IP-address</authentication>' +
-          '<smtp/>' +
-        '</outgoingServer>' +
-        // Throw in some more elements we don't support yet
-        '<enableURL url="http://foobar" />' +
-        '<instructionsURL url="http://foobar" />' +
+          "<hostname>smtpout.example.com</hostname>" +
+          "<hostname>smtpfallback.example.com</hostname>" +
+          "<port>587</port>" +
+          "<port>7878</port>" +
+          "<socketType>GSSAPI2</socketType>" +
+          "<socketType>STARTTLS</socketType>" +
+          "<username>%EMAILADDRESS%</username>" +
+          "<username>%EMAILLOCALPART%</username>" +
+          "<authentication>GSSAPI2</authentication>" +
+          "<authentication>client-IP-address</authentication>" +
+          "<smtp/>" +
+        "</outgoingServer>" +
+        // Throw in some more elements we don"t support yet
+        '<enableURL url="http://foobar"/>' +
+        '<instructionsURL url="http://foobar"/>' +
 
-      '</emailProvider>' +
-    '</clientConfig>';
+      "</emailProvider>" +
+    "</clientConfig>";
 
   var domParser = new DOMParser();
   var config = xmlReader.readFromXML(JXON.build(
     domParser.parseFromString(clientConfigXML, "text/xml")));
 
   Assert.equal(config instanceof xmlReader.AccountConfig, true);
   Assert.equal("example.com", config.id);
   Assert.equal("Example", config.displayName);
@@ -193,46 +188,45 @@ function test_readFromXML_config1()
   Assert.equal(1, server.auth); // no auth
   // no other SMTP servers
   Assert.equal(0, config.outgoingAlternatives.length);
 }
 
 /**
  * Test the replaceVariables method.
  */
-function test_replaceVariables()
-{
+function test_replaceVariables() {
   var clientConfigXML =
-    '<clientConfig>' +
+    "<clientConfig>" +
       '<emailProvider id="example.com">' +
-        '<domain>example.com</domain>' +
-        '<displayName>example.com</displayName>' +
-        '<displayShortName>example.com</displayShortName>' +
+        "<domain>example.com</domain>" +
+        "<displayName>example.com</displayName>" +
+        "<displayShortName>example.com</displayShortName>" +
         '<incomingServer type="pop3">' +
-          '<hostname>pop.%EMAILDOMAIN%</hostname>' +
-          '<port>995</port>' +
-          '<socketType>SSL</socketType>' +
-          '<username>%EMAILLOCALPART%</username>' +
-          '<authentication>plain</authentication>' +
-          '<pop3>' +
-            '<leaveMessagesOnServer>true</leaveMessagesOnServer>' +
-            '<daysToLeaveMessagesOnServer>999</daysToLeaveMessagesOnServer>' +
-          '</pop3>' +
-        '</incomingServer>' +
+          "<hostname>pop.%EMAILDOMAIN%</hostname>" +
+          "<port>995</port>" +
+          "<socketType>SSL</socketType>" +
+          "<username>%EMAILLOCALPART%</username>" +
+          "<authentication>plain</authentication>" +
+          "<pop3>" +
+            "<leaveMessagesOnServer>true</leaveMessagesOnServer>" +
+            "<daysToLeaveMessagesOnServer>999</daysToLeaveMessagesOnServer>" +
+          "</pop3>" +
+        "</incomingServer>" +
         '<outgoingServer type="smtp">' +
-          '<hostname>smtp.example.com</hostname>' +
-          '<port>587</port>' +
-          '<socketType>STARTTLS</socketType>' +
-          '<username>%EMAILADDRESS%</username>' +
-          '<authentication>plain</authentication>' +
-          '<addThisServer>true</addThisServer>' +
-          '<useGlobalPreferredServer>false</useGlobalPreferredServer>' +
-        '</outgoingServer>' +
-      '</emailProvider>' +
-    '</clientConfig>';
+          "<hostname>smtp.example.com</hostname>" +
+          "<port>587</port>" +
+          "<socketType>STARTTLS</socketType>" +
+          "<username>%EMAILADDRESS%</username>" +
+          "<authentication>plain</authentication>" +
+          "<addThisServer>true</addThisServer>" +
+          "<useGlobalPreferredServer>false</useGlobalPreferredServer>" +
+        "</outgoingServer>" +
+      "</emailProvider>" +
+    "</clientConfig>";
 
   var domParser = new DOMParser();
   var config = xmlReader.readFromXML(JXON.build(
     domParser.parseFromString(clientConfigXML, "text/xml")));
 
   xmlReader.replaceVariables(config,
                              "Yamato Nadeshiko",
                              "yamato.nadeshiko@example.com",
@@ -253,13 +247,12 @@ function test_replaceVariables()
   assert_equal_config(config.identity.realname,
                       "Yamato Nadeshiko",
                       "user real name");
   assert_equal_config(config.identity.emailAddress,
                       "yamato.nadeshiko@example.com",
                       "user email address");
 }
 
-function run_test()
-{
+function run_test() {
   test_readFromXML_config1();
   test_replaceVariables();
-};
+}