Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Test for correct installation of default theme</title>
</head>
<body>
<script>
"use strict";
const {AddonManager} = ChromeUtils.importESModule(
"resource://gre/modules/AddonManager.sys.mjs"
);
const {AppConstants} = ChromeUtils.importESModule(
"resource://gre/modules/AppConstants.sys.mjs"
);
add_task(async function() {
let addon = await AddonManager.getAddonByID("default-theme@mozilla.org");
// Dev edition uses a different default theme on desktop.
const expectActive = (!AppConstants.MOZ_DEV_EDITION ||
AppConstants.MOZ_BUILD_APP !== "browser");
ok(addon != null, "Default theme exists");
is(addon.type, "theme", "Add-on type is correct");
is(addon.isActive, expectActive, "Add-on is active?");
is(addon.hidden, false, "Add-on is not hidden");
});
</script>
</body>
</html>