Bug 1481790 - Disable test steps for testing cache resetting for calendarInfo. r+a=philipp BETA_60_CONTINUATION
authorMakeMyDay <makemyday@gmx-topmail.de>
Fri, 24 Aug 2018 14:04:16 +0200
branchBETA_60_CONTINUATION
changeset 31603 5a5c21ea76a619f9cfef109fcf3308f94a52c5c4
parent 31602 52574f7002f0c3fed0d7486b4dbfbf0d5589da99
child 31604 ddb54cc8a2a19ea380cf33677ca5f0f387434f85
push id2295
push usermozilla@jorgk.com
push dateFri, 24 Aug 2018 18:24:52 +0000
treeherdercomm-beta@5a5c21ea76a6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1481790
Bug 1481790 - Disable test steps for testing cache resetting for calendarInfo. r+a=philipp
calendar/test/unit/test_l10n_utils.js
--- a/calendar/test/unit/test_l10n_utils.js
+++ b/calendar/test/unit/test_l10n_utils.js
@@ -50,17 +50,16 @@ add_task(async function calendarInfo_tes
         expected: {
             properties: [
                 "firstDayOfWeek", "minDays", "weekendStart", "weekendEnd",
                 "calendar", "locale"
             ]
         }
     }];
     let useOSLocaleFormat = Preferences.get("intl.regional_prefs.use_os_locales", false);
-    // let localeService = Cc["@mozilla.org/intl/localeservice;1"].getService(Ci.mozILocaleService);
     let osprefs = Cc["@mozilla.org/intl/ospreferences;1"].getService(Ci.mozIOSPreferences);
     let appLocale = Services.locale.getAppLocalesAsBCP47()[0];
     let rsLocale = osprefs.getRegionalPrefsLocales()[0];
 
     let i = 0;
     for (let test of data) {
         i++;
         let info = cal.l10n.calendarInfo(test.input.locale);
@@ -69,17 +68,17 @@ add_task(async function calendarInfo_tes
             test.expected.properties.length,
             "expected number of attributes (test #" + i + ")"
         );
         for (let prop of test.expected.properties) {
             ok(prop in info, prop + " exists (test #" + i + ")");
         }
 
         if (!test.input.locale && appLocale != rsLocale) {
-            // if aLoacle is null we test with the current date and time formatting setting
+            // if aLocale is null we test with the current date and time formatting setting
             // let's test the caching mechanism - this test section is pointless if app and
             // OS locale are the same like probably on automation
             Preferences.set("intl.regional_prefs.use_os_locales", !useOSLocaleFormat);
             let info2 = cal.l10n.calendarInfo();
             equal(
                 Object.keys(info).length,
                 test.expected.properties.length,
                 "caching test - equal number of properties (test #" + i + ")"
@@ -90,18 +89,23 @@ add_task(async function calendarInfo_tes
                 equal(
                     info2[prop],
                     info[prop],
                     "caching test - value for " + prop + " is equal in both objects (test #" + i + ")"
                 );
             }
             // we reset the cache and test again - it's suffient here to find one changed property,
             // so we use locale since that must change always in that scenario
-            info2 = cal.l10n.calendarInfo(null, true);
+            // info2 = cal.l10n.calendarInfo(null, true);
             Preferences.set("intl.regional_prefs.use_os_locales", useOSLocaleFormat);
+            // This is currently disabled since the code actually doesn't reset the cache anyway.
+            // When re-enabling, be aware that macOS returns just "en" for rsLocale while other
+            // OS provide "en-US".
+            /*
             notEqual(
                 info2.locale,
                 info.locale,
                 "caching retest - value for locale is different in both objects (test #" + i + ")"
             );
+            */
         }
     }
 });