Bug 1346797 - Fix calendar eslint issues - Fix indent issues. r=MakeMyDay
authoreslint <eslint@bugzilla.kewis.ch>
Sun, 30 Jul 2017 14:10:12 +0200
changeset 22309 96bcae4b9bbcc33ce8fab8210152087c08c9e862
parent 22308 323aa523a4b0261a7a202940e29c78a7fd7b5678
child 22310 d038bfb4ca16ef6933e61af18b71dd322d2f42ae
push id13598
push usermozilla@jorgk.com
push dateSun, 08 Oct 2017 20:54:24 +0000
treeherdercomm-central@86066f04ca11 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMakeMyDay
bugs1346797
Bug 1346797 - Fix calendar eslint issues - Fix indent issues. r=MakeMyDay MozReview-Commit-ID: 8lCdycYi4lo
calendar/base/content/calendar-chrome-startup.js
calendar/base/content/preferences/alarms.js
calendar/test/unit/test_alarmservice.js
calendar/test/unit/test_ltninvitationutils.js
--- a/calendar/base/content/calendar-chrome-startup.js
+++ b/calendar/base/content/calendar-chrome-startup.js
@@ -46,21 +46,21 @@ function commonInitCalendar() {
     categoryManagement.initCategories();
 
     // Set up window pref observers
     calendarWindowPrefs.init();
 
     // Set up the available modifiers for each platform.
     let keys = document.querySelectorAll("#calendar-keys > key");
     let platform = AppConstants.platform;
-        for (let key of keys) {
-            if (key.hasAttribute("modifiers-" + platform)) {
-                key.setAttribute("modifiers", key.getAttribute("modifiers-" + platform));
-            }
+    for (let key of keys) {
+        if (key.hasAttribute("modifiers-" + platform)) {
+            key.setAttribute("modifiers", key.getAttribute("modifiers-" + platform));
         }
+    }
 
     /* Ensure the new items commands state can be setup properly even when no
      * calendar support refreshes (i.e. the "onLoad" notification) or when none
      * are active. In specific cases such as for file-based ICS calendars can
      * happen, the initial "onLoad" will already have been triggered at this
      * point (see bug 714431 comment 29). We thus inconditionnally invoke
      * calendarUpdateNewItemsCommand until somebody writes code that enables the
      * checking of the calendar readiness (getProperty("ready") ?).
--- a/calendar/base/content/preferences/alarms.js
+++ b/calendar/base/content/preferences/alarms.js
@@ -83,17 +83,17 @@ var gAlarmsPane = {
         let label = bundlePreferences.getFormattedString("filterWav", [wildmat], 1);
 
         picker.init(window, title, nsIFilePicker.modeOpen);
         picker.appendFilter(label, wildmat);
         picker.appendFilters(nsIFilePicker.filterAll);
 
         picker.open(rv => {
             if (rv != nsIFilePicker.returnOK || !picker.file) {
-               return;
+                return;
             }
             document.getElementById("calendar.alarms.soundURL").value = picker.fileURL.spec;
             document.getElementById("alarmSoundCheckbox").checked = true;
             this.readSoundLocation();
         });
     },
 
     /**
--- a/calendar/test/unit/test_alarmservice.js
+++ b/calendar/test/unit/test_alarmservice.js
@@ -264,18 +264,22 @@ function addTestItems(aCalendar) {
     let statusAlarmSequences = {
         reg: [EXPECT_NONE, EXPECT_NONE, EXPECT_FIRED, EXPECT_NONE, EXPECT_NONE],
         excep1: [EXPECT_NONE, EXPECT_FIRED, EXPECT_NONE, EXPECT_NONE, EXPECT_NONE],
         excep2: [EXPECT_NONE, EXPECT_NONE, EXPECT_NONE, EXPECT_NONE, EXPECT_NONE]
     };
     let expected = [];
     if (date.day == 1) {
         // Exceptions for missing occurrences on months with 30 days when the event starts on 31st.
-        let sequence = ["excep1", "reg", "excep2", "excep1", "reg", "excep1",
-                        "reg", "excep1", "reg", "excep2", "excep1", "reg"][date.month];
+        let sequence = [
+            "excep1", "reg", "excep2",
+            "excep1", "reg", "excep1",
+            "reg", "excep1", "reg",
+            "excep2", "excep1", "reg"
+        ][date.month];
         expected = statusAlarmSequences[sequence];
     } else if (date.day == 30 && (date.month == 2 || date.month == 3)) {
         // Exceptions for missing occurrences or different start date caused by February.
         let leapYear = date.endOfYear.yearday == 366;
         expected = leapYear ? statusAlarmSequences.reg : statusAlarmSequences.excep1;
     } else if (date.day == 31 && date.month == 2) {
         // Exceptions for missing occurrences caused by February.
         expected = statusAlarmSequences.excep1;
--- a/calendar/test/unit/test_ltninvitationutils.js
+++ b/calendar/test/unit/test_ltninvitationutils.js
@@ -444,33 +444,34 @@ add_task(function* compareInvitationOver
             },
             ignore: ""
         },
         expected: {
             // Time format is platform dependent, so we use alternative result sets here.
             // The first two are configurations running for automated tests.
             // If you get a failure for this test, add your pattern here.
             node: "imipHtml-when-content",
-            some: // For Windows.
-                  ["<span xmlns=\"\" class=\"added\">Wednesday, September 09, 2015 2:00 PM – 3:00 PM</span>" +
-                   "<br xmlns=\"\"/>" +
-                   "<span xmlns=\"\" class=\"removed\">Wednesday, September 09, 2015 1:00 PM – 2:00 PM</span>",
+            some: [ // For Windows.
+                "<span xmlns=\"\" class=\"added\">Wednesday, September 09, 2015 2:00 PM – 3:00 PM</span>" +
+                "<br xmlns=\"\"/>" +
+                "<span xmlns=\"\" class=\"removed\">Wednesday, September 09, 2015 1:00 PM – 2:00 PM</span>",
 
-                   "<span xmlns=\"\" class=\"added\">Wednesday, September 09, 2015 14:00 – 15:00</span>" +
-                   "<br xmlns=\"\"/>" +
-                   "<span xmlns=\"\" class=\"removed\">Wednesday, September 09, 2015 13:00 – 14:00</span>",
+                "<span xmlns=\"\" class=\"added\">Wednesday, September 09, 2015 14:00 – 15:00</span>" +
+                "<br xmlns=\"\"/>" +
+                "<span xmlns=\"\" class=\"removed\">Wednesday, September 09, 2015 13:00 – 14:00</span>",
 
-                   // For Linux and Mac: The same but without 2-digit day.
-                   "<span xmlns=\"\" class=\"added\">Wednesday, September 9, 2015 2:00 PM – 3:00 PM</span>" +
-                   "<br xmlns=\"\"/>" +
-                   "<span xmlns=\"\" class=\"removed\">Wednesday, September 9, 2015 1:00 PM – 2:00 PM</span>",
+                // For Linux and Mac: The same but without 2-digit day.
+                "<span xmlns=\"\" class=\"added\">Wednesday, September 9, 2015 2:00 PM – 3:00 PM</span>" +
+                "<br xmlns=\"\"/>" +
+                "<span xmlns=\"\" class=\"removed\">Wednesday, September 9, 2015 1:00 PM – 2:00 PM</span>",
 
-                   "<span xmlns=\"\" class=\"added\">Wednesday, September 9, 2015 14:00 – 15:00</span>" +
-                   "<br xmlns=\"\"/>" +
-                   "<span xmlns=\"\" class=\"removed\">Wednesday, September 9, 2015 13:00 – 14:00</span>"]
+                "<span xmlns=\"\" class=\"added\">Wednesday, September 9, 2015 14:00 – 15:00</span>" +
+                "<br xmlns=\"\"/>" +
+                "<span xmlns=\"\" class=\"removed\">Wednesday, September 9, 2015 13:00 – 14:00</span>"
+            ]
         }
     }, {
         input: {
             previous: { organizer: "ORGANIZER:mailto:organizer1@example.net\r\n" },
             current: { organizer: "ORGANIZER:mailto:organizer2@example.net\r\n" },
             ignore: ""
         },
         expected: {
@@ -831,30 +832,38 @@ add_task(function* parseCounter_test() {
                 proposed: "Test Event 2",
                 original: "Test Event"
             }, {
                 property: "LOCATION",
                 proposed: "Room 2",
                 original: "Room 1"
             }, {
                 property: "DTSTART",
-                proposed: ["Thursday, September 10, 2015 9:00 PM Europe/Berlin",
-                           "Thursday, September 10, 2015 21:00 Europe/Berlin"],
-                original: ["Wednesday, September 09, 2015 9:00 PM Europe/Berlin", // Windows
-                           "Wednesday, September 09, 2015 21:00 Europe/Berlin",
-                           "Wednesday, September 9, 2015 9:00 PM Europe/Berlin",  // Linux and Mac
-                           "Wednesday, September 9, 2015 21:00 Europe/Berlin"]
+                proposed: [
+                    "Thursday, September 10, 2015 9:00 PM Europe/Berlin",
+                    "Thursday, September 10, 2015 21:00 Europe/Berlin"
+                ],
+                original: [
+                    "Wednesday, September 09, 2015 9:00 PM Europe/Berlin", // Windows
+                    "Wednesday, September 09, 2015 21:00 Europe/Berlin",
+                    "Wednesday, September 9, 2015 9:00 PM Europe/Berlin",  // Linux and Mac
+                    "Wednesday, September 9, 2015 21:00 Europe/Berlin"
+                ]
             }, {
                 property: "DTEND",
-                proposed: ["Thursday, September 10, 2015 10:00 PM Europe/Berlin",
-                           "Thursday, September 10, 2015 22:00 Europe/Berlin"],
-                original: ["Wednesday, September 09, 2015 10:00 PM Europe/Berlin", // Windows
-                           "Wednesday, September 09, 2015 22:00 Europe/Berlin",
-                           "Wednesday, September 9, 2015 10:00 PM Europe/Berlin",  // Linux and Mac
-                           "Wednesday, September 9, 2015 22:00 Europe/Berlin"]
+                proposed: [
+                    "Thursday, September 10, 2015 10:00 PM Europe/Berlin",
+                    "Thursday, September 10, 2015 22:00 Europe/Berlin"
+                ],
+                original: [
+                    "Wednesday, September 09, 2015 10:00 PM Europe/Berlin", // Windows
+                    "Wednesday, September 09, 2015 22:00 Europe/Berlin",
+                    "Wednesday, September 9, 2015 10:00 PM Europe/Berlin",  // Linux and Mac
+                    "Wednesday, September 9, 2015 22:00 Europe/Berlin"
+                ]
             }, {
                 property: "COMMENT",
                 proposed: "Sorry, I cannot make it that time.",
                 original: null
             }]
         }
     }, {
         // #2: test with an unsupported property has been changed