Bug 1480943 - Fix browser_webapi_theme.js TV failure. r=robwu
authorLuca Greco <lgreco@mozilla.com>
Tue, 15 Jan 2019 12:03:48 +0000
changeset 511219 0f3543d470f269a834975f836adb3e5edcdb49e1
parent 511218 3e12097e2b601e2dd06b868e98bf7167c6c6aa94
child 511220 7c002ce6b6cc022166693ea200de66dc2ca7b811
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrobwu
bugs1480943
milestone66.0a1
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
Bug 1480943 - Fix browser_webapi_theme.js TV failure. r=robwu This patch contains a small change needed to fix the browser_webapi_theme.js failures when it runs more then once in a row (e.g. when running in TV mode). The reason for the failure is that, when running the test more then once, by installing a new webextension theme we first receive a "lightweight-theme-styling-update" observer notification message related to the unloading on the previous theme, from the ext-theme's static unload method: - https://searchfox.org/mozilla-central/rev/b29663c6c9c61b0bf29e8add490cbd6bad293a67/toolkit/components/extensions/parent/ext-theme.js#354-356,368-370 And then another "lightweight-theme-styling-update" message related to the loading on the new theme, from the ext-theme's load method: - https://searchfox.org/mozilla-central/rev/b29663c6c9c61b0bf29e8add490cbd6bad293a67/toolkit/components/extensions/parent/ext-theme.js#101-103,119-121 To fix the failure on TV, this patch ensures that the webextension theme is uninstalled before exiting the test. Differential Revision: https://phabricator.services.mozilla.com/D16546
toolkit/mozapps/extensions/test/browser/browser_webapi_theme.js
--- a/toolkit/mozapps/extensions/test/browser/browser_webapi_theme.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_webapi_theme.js
@@ -32,10 +32,13 @@ add_task(async function test_theme_insta
     ok(true, "Theme install completed");
 
     Assert.equal(updates.length, 1, "Got a single theme update");
     let parsed = JSON.parse(updates[0]);
     ok(parsed.theme.headerURL.endsWith("/testImage.png"),
        "Theme update has the expected headerURL");
     is(parsed.theme.id, "theme@tests.mozilla.org", "Theme update includes the theme ID");
     is(parsed.theme.version, "1.0", "Theme update includes the theme's version");
+
+    let addon = await AddonManager.getAddonByID(parsed.theme.id);
+    await addon.uninstall();
   });
 });