From 43a97878ce14b72f0981164f87f2e35e14151312 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 11:22:09 +0200 Subject: Adding upstream version 110.0.1. Signed-off-by: Daniel Baumann --- .../extensions/test/xpinstall/browser_bug540558.js | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 toolkit/mozapps/extensions/test/xpinstall/browser_bug540558.js (limited to 'toolkit/mozapps/extensions/test/xpinstall/browser_bug540558.js') diff --git a/toolkit/mozapps/extensions/test/xpinstall/browser_bug540558.js b/toolkit/mozapps/extensions/test/xpinstall/browser_bug540558.js new file mode 100644 index 0000000000..0004d53713 --- /dev/null +++ b/toolkit/mozapps/extensions/test/xpinstall/browser_bug540558.js @@ -0,0 +1,31 @@ +// ---------------------------------------------------------------------------- +// Tests that calling InstallTrigger.installChrome works +function test() { + // This test depends on InstallTrigger.installChrome availability. + setInstallTriggerPrefs(); + + Harness.installEndedCallback = check_xpi_install; + Harness.installsCompletedCallback = finish_test; + Harness.setup(); + + PermissionTestUtils.add( + "http://example.com/", + "install", + Services.perms.ALLOW_ACTION + ); + + gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser); + BrowserTestUtils.loadURI(gBrowser, TESTROOT + "bug540558.html"); +} + +function check_xpi_install(install, addon) { + return addon.uninstall(); +} + +function finish_test(count) { + is(count, 1, "1 Add-on should have been successfully installed"); + PermissionTestUtils.remove("http://example.com", "install"); + + gBrowser.removeCurrentTab(); + Harness.finish(); +} -- cgit v1.2.3