Backed out changeset 92914b96908c (bug 1585290) for failing bc at browser_ext_themes_dynamic_getCurrent.js on a CLOSED TREE
authorAndreea Pavel <apavel@mozilla.com>
Sat, 14 Dec 2019 02:04:42 +0200
changeset 507005 28673e2781e85ebb3d54e80ad8aa81f097dad038
parent 507004 72dc29cbba410649bb27e9dfe4d9d3c8123557c0
child 507006 7942c1bd3f70e091402aa76b330ccbf6d7f74032
push id103206
push userapavel@mozilla.com
push dateSat, 14 Dec 2019 00:05:46 +0000
treeherderautoland@28673e2781e8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1585290
milestone73.0a1
backs out92914b96908c2dd96a042938456728a02c19336d
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 92914b96908c (bug 1585290) for failing bc at browser_ext_themes_dynamic_getCurrent.js on a CLOSED TREE
toolkit/components/extensions/parent/ext-theme.js
toolkit/components/extensions/test/browser/browser.ini
toolkit/components/extensions/test/browser/browser_ext_themes_reset.js
--- a/toolkit/components/extensions/parent/ext-theme.js
+++ b/toolkit/components/extensions/parent/ext-theme.js
@@ -468,21 +468,21 @@ this.theme = class extends ExtensionAPI 
           });
         },
         reset: windowId => {
           if (windowId) {
             const browserWindow = windowTracker.getWindow(windowId, context);
             if (!browserWindow) {
               return Promise.reject(`Invalid window ID: ${windowId}`);
             }
+          }
 
-            let theme = windowOverrides.get(windowId);
-            if (!theme || theme.extension !== extension) {
-              return;
-            }
+          if (!defaultTheme && !windowOverrides.has(windowId)) {
+            // If no theme has been initialized, nothing to do.
+            return;
           }
 
           Theme.unload(windowId);
         },
         onUpdated: new EventManager({
           context,
           name: "theme.onUpdated",
           register: fire => {
--- a/toolkit/components/extensions/test/browser/browser.ini
+++ b/toolkit/components/extensions/test/browser/browser.ini
@@ -4,42 +4,41 @@ support-files =
   data/**
 
 [browser_ext_downloads_referrer.js]
 [browser_ext_management_themes.js]
 skip-if = verify
 [browser_ext_test_mock.js]
 [browser_ext_themes_additional_backgrounds_alignment.js]
 [browser_ext_themes_alpha_accentcolor.js]
-[browser_ext_themes_arrowpanels.js]
-[browser_ext_themes_autocomplete_popup.js]
 [browser_ext_themes_chromeparity.js]
 [browser_ext_themes_dynamic_getCurrent.js]
 [browser_ext_themes_dynamic_onUpdated.js]
 [browser_ext_themes_dynamic_updates.js]
 [browser_ext_themes_experiment.js]
-[browser_ext_themes_findbar.js]
 [browser_ext_themes_getCurrent_differentExt.js]
-[browser_ext_themes_highlight.js]
 [browser_ext_themes_incognito.js]
 [browser_ext_themes_lwtsupport.js]
 [browser_ext_themes_multiple_backgrounds.js]
 [browser_ext_themes_ntp_colors.js]
 [browser_ext_themes_ntp_colors_perwindow.js]
 [browser_ext_themes_persistence.js]
-[browser_ext_themes_reset.js]
-[browser_ext_themes_sanitization.js]
 [browser_ext_themes_separators.js]
-[browser_ext_themes_sidebars.js]
 [browser_ext_themes_static_onUpdated.js]
 [browser_ext_themes_tab_line.js]
 [browser_ext_themes_tab_loading.js]
-[browser_ext_themes_tab_selected.js]
 [browser_ext_themes_tab_separators.js]
 [browser_ext_themes_tab_text.js]
 [browser_ext_themes_toolbar_fields_focus.js]
 [browser_ext_themes_toolbar_fields.js]
-[browser_ext_themes_toolbarbutton_colors.js]
+[browser_ext_themes_toolbars.js]
 [browser_ext_themes_toolbarbutton_icons.js]
-[browser_ext_themes_toolbars.js]
+[browser_ext_themes_toolbarbutton_colors.js]
 [browser_ext_themes_theme_transition.js]
+[browser_ext_themes_arrowpanels.js]
+[browser_ext_themes_tab_selected.js]
+[browser_ext_themes_autocomplete_popup.js]
+[browser_ext_themes_sanitization.js]
+[browser_ext_themes_sidebars.js]
+[browser_ext_themes_findbar.js]
 [browser_ext_themes_warnings.js]
+[browser_ext_themes_highlight.js]
 [browser_ext_windows_popup_title.js]
deleted file mode 100644
--- a/toolkit/components/extensions/test/browser/browser_ext_themes_reset.js
+++ /dev/null
@@ -1,88 +0,0 @@
-"use strict";
-
-add_task(async function test_theme_reset_api() {
-  let extension = ExtensionTestUtils.loadExtension({
-    manifest: {
-      permissions: ["theme"],
-    },
-    async background() {
-      let theme = {
-        colors: {
-          frame: "#CF723F",
-        },
-      };
-
-      await browser.theme.update(theme);
-      await browser.theme.reset();
-      let reset_theme = await browser.theme.getCurrent();
-
-      browser.test.assertEq(
-        undefined,
-        reset_theme.colors,
-        "Should reset when extension had replaced the global theme"
-      );
-
-      let { id: winId } = await browser.windows.getCurrent();
-
-      await browser.theme.update(winId, theme);
-      let update_theme = await browser.theme.getCurrent(winId);
-      await browser.theme.reset(winId);
-      reset_theme = await browser.theme.getCurrent(winId);
-
-      browser.test.assertEq(
-        undefined,
-        reset_theme.colors,
-        "Should reset when window id is exist"
-      );
-
-      let { id: anotherWindId } = await browser.windows.create();
-      await browser.windows.remove(anotherWindId);
-      await browser.test.assertRejects(
-        browser.theme.reset(anotherWindId),
-        /Invalid window/,
-        "Invalid window should throw"
-      );
-
-      browser.test.onMessage.addListener(async () => {
-        reset_theme = await browser.theme.getCurrent(winId);
-        browser.test.assertEq(
-          update_theme.colors.frame,
-          reset_theme.colors.frame,
-          "Should not reset where another extension try reset"
-        );
-
-        browser.test.sendMessage("done");
-      });
-
-      await browser.theme.update(winId, theme);
-      browser.test.sendMessage("ready", winId);
-    },
-  });
-
-  let anotherExtension = ExtensionTestUtils.loadExtension({
-    manifest: {
-      permissions: ["theme"],
-    },
-    background() {
-      browser.test.onMessage.addListener(async winId => {
-        await browser.theme.reset(winId);
-        browser.test.sendMessage("done");
-      });
-    },
-  });
-
-  await extension.startup();
-  let winId = await extension.awaitMessage("ready");
-
-  await anotherExtension.startup();
-
-  // theme.reset should be ignored if the theme was set by another extension.
-  anotherExtension.sendMessage(winId);
-  await anotherExtension.awaitMessage("done");
-
-  extension.sendMessage();
-  await extension.awaitMessage("done");
-
-  await anotherExtension.unload();
-  await extension.unload();
-});