[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor-browser] 69/311: Bug 1754126 - Skip colorway theme test if it has already expired r=pdahiya a=RyanVM



This is an automated email from the git hooks/post-receive script.

pierov pushed a commit to branch geckoview-99.0.1-11.0-1
in repository tor-browser.

commit 12621f80c177781d26cac09ee0f116860b611674
Author: Ed Lee <edilee@xxxxxxxxxxx>
AuthorDate: Tue Feb 8 22:58:52 2022 +0000

    Bug 1754126 - Skip colorway theme test if it has already expired r=pdahiya a=RyanVM
    
    Silently ignore themes that are expired and can't be enabled.
    
    Differential Revision: https://phabricator.services.mozilla.com/D138168
---
 browser/base/content/upgradeDialog.js                                 | 3 ++-
 browser/components/tests/browser/browser_browserGlue_upgradeDialog.js | 4 ++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/browser/base/content/upgradeDialog.js b/browser/base/content/upgradeDialog.js
index d29a0286260fd..3184d886531be 100644
--- a/browser/base/content/upgradeDialog.js
+++ b/browser/base/content/upgradeDialog.js
@@ -90,7 +90,8 @@ let gPrevTheme = AddonManager.getAddonsByTypes(["theme"]).then(addons => {
 // Helper to switch themes.
 async function enableTheme(id) {
   await BuiltInThemes.ensureBuiltInThemes();
-  (await AddonManager.getAddonByID(id)).enable();
+  // The UI shows a fixed set of themes even when expired, so silently skip.
+  (await AddonManager.getAddonByID(id))?.enable();
 }
 
 // Helper to show the theme in chrome with an adjusted modal backdrop.
diff --git a/browser/components/tests/browser/browser_browserGlue_upgradeDialog.js b/browser/components/tests/browser/browser_browserGlue_upgradeDialog.js
index 321b3ab636daf..7ef380651ebbf 100644
--- a/browser/components/tests/browser/browser_browserGlue_upgradeDialog.js
+++ b/browser/components/tests/browser/browser_browserGlue_upgradeDialog.js
@@ -28,9 +28,13 @@ add_task(async function double_click() {
 });
 
 add_task(async function theme_change() {
+  // Skip this test if the theme has expired.
   const theme = await AddonManager.getAddonByID(
     "foto-soft-colorway@xxxxxxxxxxx"
   );
+  if (!theme) {
+    return;
+  }
 
   await showAndWaitForDialog(async win => {
     await BrowserTestUtils.waitForEvent(win, "variations");

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits