Pier Angelo Vendrame pushed to branch tor-browser-115.11.0esr-13.5-1 at The Tor Project / Applications / Tor Browser

Commits:

4 changed files:

Changes:

  • browser/components/preferences/dialogs/browserLanguages.js
    ... ... @@ -327,8 +327,7 @@ class SortedItemSelectList {
    327 327
      * @prop {string} id - A unique ID.
    
    328 328
      * @prop {string} label - The localized display name.
    
    329 329
      * @prop {string} value - The BCP 47 locale identifier or the word "search".
    
    330
    - * @prop {boolean} canRemove - Locales that are part of the packaged locales cannot be
    
    331
    - *                             removed.
    
    330
    + * @prop {boolean} canRemove - The default locale cannot be removed.
    
    332 331
      * @prop {boolean} installed - Whether or not the locale is installed.
    
    333 332
      */
    
    334 333
     
    
    ... ... @@ -338,7 +337,6 @@ class SortedItemSelectList {
    338 337
      */
    
    339 338
     async function getLocaleDisplayInfo(localeCodes) {
    
    340 339
       let availableLocales = new Set(await LangPackMatcher.getAvailableLocales());
    
    341
    -  let packagedLocales = new Set(Services.locale.packagedLocales);
    
    342 340
       let localeNames = Services.intl.getLocaleDisplayNames(
    
    343 341
         undefined,
    
    344 342
         localeCodes,
    
    ... ... @@ -349,7 +347,7 @@ async function getLocaleDisplayInfo(localeCodes) {
    349 347
           id: "locale-" + code,
    
    350 348
           label: localeNames[i],
    
    351 349
           value: code,
    
    352
    -      canRemove: code !== Services.locale.defaultLocale,
    
    350
    +      canRemove: code != Services.locale.defaultLocale,
    
    353 351
           installed: availableLocales.has(code),
    
    354 352
         };
    
    355 353
       });
    

  • browser/components/preferences/tests/browser_browser_languages_subdialog.js
    ... ... @@ -142,18 +142,23 @@ async function createDictionaryBrowseResults() {
    142 142
       return dir;
    
    143 143
     }
    
    144 144
     
    
    145
    -function assertLocaleOrder(list, locales) {
    
    145
    +function assertLocaleOrder(list, locales, selectedLocale) {
    
    146 146
       is(
    
    147 147
         list.itemCount,
    
    148 148
         locales.split(",").length,
    
    149
    -    "The right number of locales are selected"
    
    149
    +    "The right number of locales are in the list"
    
    150 150
       );
    
    151 151
       is(
    
    152 152
         Array.from(list.children)
    
    153 153
           .map(child => child.value)
    
    154 154
           .join(","),
    
    155 155
         locales,
    
    156
    -    "The selected locales are in order"
    
    156
    +    "The listed locales are in order"
    
    157
    +  );
    
    158
    +  is(
    
    159
    +    list.selectedItem.value,
    
    160
    +    selectedLocale,
    
    161
    +    "The selected item locale matches"
    
    157 162
       );
    
    158 163
     }
    
    159 164
     
    
    ... ... @@ -219,6 +224,11 @@ async function selectLocale(localeCode, available, selected, dialogDoc) {
    219 224
       await added;
    
    220 225
     }
    
    221 226
     
    
    227
    +// Select a locale from the list of already added locales.
    
    228
    +function selectAddedLocale(localeCode, selected) {
    
    229
    +  selected.selectedItem = selected.querySelector(`[value="${localeCode}"]`);
    
    230
    +}
    
    231
    +
    
    222 232
     async function openDialog(doc, search = false) {
    
    223 233
       let dialogLoaded = promiseLoadSubDialog(BROWSER_LANGUAGES_URL);
    
    224 234
       if (search) {
    
    ... ... @@ -283,7 +293,7 @@ add_task(async function testDisabledBrowserLanguages() {
    283 293
       // pl is not selected since it's disabled.
    
    284 294
       is(pl.userDisabled, true, "pl is disabled");
    
    285 295
       is(pl.version, "1.0", "pl is the old 1.0 version");
    
    286
    -  assertLocaleOrder(selected, "en-US,he");
    
    296
    +  assertLocaleOrder(selected, "en-US,he", "en-US");
    
    287 297
     
    
    288 298
       // Wait for the children menu to be populated.
    
    289 299
       await BrowserTestUtils.waitForCondition(
    
    ... ... @@ -313,7 +323,7 @@ add_task(async function testDisabledBrowserLanguages() {
    313 323
     
    
    314 324
       // Add pl.
    
    315 325
       await selectLocale("pl", available, selected, dialogDoc);
    
    316
    -  assertLocaleOrder(selected, "pl,en-US,he");
    
    326
    +  assertLocaleOrder(selected, "pl,en-US,he", "pl");
    
    317 327
     
    
    318 328
       // Find pl again since it's been upgraded.
    
    319 329
       pl = await AddonManager.getAddonByID(langpackId("pl"));
    
    ... ... @@ -371,12 +381,12 @@ add_task(async function testReorderingBrowserLanguages() {
    371 381
       let firstDialogId = getDialogId(dialogDoc);
    
    372 382
     
    
    373 383
       // The initial order is set by the pref, filtered by available.
    
    374
    -  assertLocaleOrder(selected, "en-US,pl,he");
    
    384
    +  assertLocaleOrder(selected, "en-US,pl,he", "en-US");
    
    375 385
     
    
    376 386
       // Moving pl down changes the order.
    
    377
    -  selected.selectedItem = selected.querySelector("[value='pl']");
    
    387
    +  selectAddedLocale("pl", selected);
    
    378 388
       dialogDoc.getElementById("down").doCommand();
    
    379
    -  assertLocaleOrder(selected, "en-US,he,pl");
    
    389
    +  assertLocaleOrder(selected, "en-US,he,pl", "pl");
    
    380 390
     
    
    381 391
       // Accepting the change shows the confirm message bar.
    
    382 392
       let dialogClosed = BrowserTestUtils.waitForEvent(dialog, "dialogclosing");
    
    ... ... @@ -404,13 +414,13 @@ add_task(async function testReorderingBrowserLanguages() {
    404 414
       selected = newDialog.selected;
    
    405 415
     
    
    406 416
       // The initial order comes from the previous settings.
    
    407
    -  assertLocaleOrder(selected, "en-US,he,pl");
    
    417
    +  assertLocaleOrder(selected, "en-US,he,pl", "en-US");
    
    408 418
     
    
    409 419
       // Select pl in the list.
    
    410
    -  selected.selectedItem = selected.querySelector("[value='pl']");
    
    420
    +  selectAddedLocale("pl", selected);
    
    411 421
       // Move pl back up.
    
    412 422
       dialogDoc.getElementById("up").doCommand();
    
    413
    -  assertLocaleOrder(selected, "en-US,pl,he");
    
    423
    +  assertLocaleOrder(selected, "en-US,pl,he", "pl");
    
    414 424
     
    
    415 425
       // Accepting the change hides the confirm message bar.
    
    416 426
       dialogClosed = BrowserTestUtils.waitForEvent(dialog, "dialogclosing");
    
    ... ... @@ -485,25 +495,42 @@ add_task(async function testAddAndRemoveSelectedLanguages() {
    485 495
         }
    
    486 496
       );
    
    487 497
       // The initial order is set by the pref.
    
    488
    -  assertLocaleOrder(selected, "en-US");
    
    498
    +  assertLocaleOrder(selected, "en-US", "en-US");
    
    489 499
       assertAvailableLocales(available, ["fr", "pl", "he"]);
    
    490 500
     
    
    501
    +  let removeButton = dialogDoc.getElementById("remove");
    
    502
    +  // Cannot remove the default locale.
    
    503
    +  is(removeButton.disabled, true, "Remove en-US should be disabled");
    
    504
    +
    
    491 505
       // Add pl and fr to selected.
    
    492 506
       await selectLocale("pl", available, selected, dialogDoc);
    
    493 507
       await selectLocale("fr", available, selected, dialogDoc);
    
    494 508
     
    
    495
    -  assertLocaleOrder(selected, "fr,pl,en-US");
    
    509
    +  assertLocaleOrder(selected, "fr,pl,en-US", "fr");
    
    496 510
       assertAvailableLocales(available, ["he"]);
    
    497 511
     
    
    512
    +  // Can remove the added locale again.
    
    513
    +  is(removeButton.disabled, false, "Remove fr should be not be disabled");
    
    514
    +
    
    515
    +  selectAddedLocale("en-US", selected);
    
    516
    +  // Cannot remove the default locale, even after adding more.
    
    517
    +  is(removeButton.disabled, true, "Remove en-us should still be disabled");
    
    518
    +
    
    498 519
       // Remove pl and fr from selected.
    
    499
    -  dialogDoc.getElementById("remove").doCommand();
    
    500
    -  dialogDoc.getElementById("remove").doCommand();
    
    501
    -  assertLocaleOrder(selected, "en-US");
    
    520
    +  selectAddedLocale("fr", selected);
    
    521
    +  is(removeButton.disabled, false, "Remove fr should be not be disabled");
    
    522
    +  removeButton.doCommand();
    
    523
    +  // Selection moves to pl.
    
    524
    +  assertLocaleOrder(selected, "pl,en-US", "pl");
    
    525
    +  is(removeButton.disabled, false, "Remove pl should be not be disabled");
    
    526
    +  removeButton.doCommand();
    
    527
    +  assertLocaleOrder(selected, "en-US", "en-US");
    
    502 528
       assertAvailableLocales(available, ["fr", "pl", "he"]);
    
    529
    +  is(removeButton.disabled, true, "Remove en-us should be disabled at end");
    
    503 530
     
    
    504 531
       // Add he to selected.
    
    505 532
       await selectLocale("he", available, selected, dialogDoc);
    
    506
    -  assertLocaleOrder(selected, "he,en-US");
    
    533
    +  assertLocaleOrder(selected, "he,en-US", "he");
    
    507 534
       assertAvailableLocales(available, ["pl", "fr"]);
    
    508 535
     
    
    509 536
       // Accepting the change shows the confirm message bar.
    
    ... ... @@ -603,7 +630,7 @@ add_task(async function testInstallFromAMO() {
    603 630
       }
    
    604 631
     
    
    605 632
       // The initial order is set by the pref.
    
    606
    -  assertLocaleOrder(selected, "en-US");
    
    633
    +  assertLocaleOrder(selected, "en-US", "en-US");
    
    607 634
       assertAvailableLocales(available, ["fr", "he", "pl"]);
    
    608 635
       is(
    
    609 636
         Services.locale.availableLocales.join(","),
    
    ... ... @@ -633,7 +660,7 @@ add_task(async function testInstallFromAMO() {
    633 660
       );
    
    634 661
     
    
    635 662
       // Verify the list is correct.
    
    636
    -  assertLocaleOrder(selected, "pl,en-US");
    
    663
    +  assertLocaleOrder(selected, "pl,en-US", "pl");
    
    637 664
       assertAvailableLocales(available, ["fr", "he"]);
    
    638 665
       is(
    
    639 666
         Services.locale.availableLocales.sort().join(","),
    
    ... ... @@ -658,7 +685,7 @@ add_task(async function testInstallFromAMO() {
    658 685
     
    
    659 686
       // Move pl down the list, which prevents an error since it isn't valid.
    
    660 687
       dialogDoc.getElementById("down").doCommand();
    
    661
    -  assertLocaleOrder(selected, "en-US,pl");
    
    688
    +  assertLocaleOrder(selected, "en-US,pl", "pl");
    
    662 689
     
    
    663 690
       // Test that disabling the langpack removes it from the list.
    
    664 691
       let dialogClosed = BrowserTestUtils.waitForEvent(dialog, "dialogclosing");
    
    ... ... @@ -683,7 +710,7 @@ add_task(async function testInstallFromAMO() {
    683 710
           target => available.itemCount > 1
    
    684 711
         );
    
    685 712
       }
    
    686
    -  assertLocaleOrder(selected, "en-US");
    
    713
    +  assertLocaleOrder(selected, "en-US", "en-US");
    
    687 714
       assertAvailableLocales(available, ["fr", "he", "pl"]);
    
    688 715
     
    
    689 716
       // Uninstall the langpack and dictionary.
    

  • browser/components/resistfingerprinting/test/browser/browser_timezone.js
    ... ... @@ -18,13 +18,13 @@ async function verifySpoofed() {
    18 18
       function test() {
    
    19 19
         let date = new Date();
    
    20 20
         const TZ_NAME = "Atlantic/Reykjavik";
    
    21
    -    const TZ_SUFFIX = "(Greenwich Mean Time)";
    
    21
    +    const TZ_SUFFIX = "Greenwich Mean Time";
    
    22 22
         ok(
    
    23
    -      date.toString().endsWith(TZ_SUFFIX),
    
    23
    +      date.toString().endsWith(`(${TZ_SUFFIX})`),
    
    24 24
           `The date toString() is in ${TZ_NAME} timezone.`
    
    25 25
         );
    
    26 26
         ok(
    
    27
    -      date.toTimeString().endsWith(TZ_SUFFIX),
    
    27
    +      date.toTimeString().endsWith(`(${TZ_SUFFIX})`),
    
    28 28
           `The date toTimeString() is in ${TZ_NAME} timezone.`
    
    29 29
         );
    
    30 30
         let dateTimeFormat = Intl.DateTimeFormat("en-US", {
    

  • js/src/vm/DateTime.cpp
    ... ... @@ -484,11 +484,12 @@ bool js::DateTimeInfo::internalTimeZoneDisplayName(char16_t* buf, size_t buflen,
    484 484
     
    
    485 485
     mozilla::intl::TimeZone* js::DateTimeInfo::timeZone() {
    
    486 486
       if (!timeZone_) {
    
    487
    -    // For resist finger printing mode we always use the Atlantic/Reykjavik time zone
    
    488
    -    // as a "real world" UTC equivalent.
    
    487
    +    // For resist finger printing mode we always use the Atlantic/Reykjavik time
    
    488
    +    // zone as a "real world" UTC equivalent.
    
    489 489
         mozilla::Maybe<mozilla::Span<const char16_t>> timeZoneOverride;
    
    490 490
         if (shouldResistFingerprinting_) {
    
    491
    -      timeZoneOverride = mozilla::Some(mozilla::MakeStringSpan(u"Atlantic/Reykjavik"));
    
    491
    +      timeZoneOverride =
    
    492
    +          mozilla::Some(mozilla::MakeStringSpan(u"Atlantic/Reykjavik"));
    
    492 493
         }
    
    493 494
     
    
    494 495
         auto timeZone = mozilla::intl::TimeZone::TryCreate(timeZoneOverride);