1
0
Fork 0
firefox/toolkit/mozapps/extensions/test/xpinstall/browser_bug611242.js
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

34 lines
1.1 KiB
JavaScript

// ----------------------------------------------------------------------------
// Test whether setting a new property in InstallTrigger then persists to other
// page loads
add_task(async function test() {
await SpecialPowers.pushPrefEnv({
set: [
["extensions.InstallTrigger.enabled", true],
["extensions.InstallTriggerImpl.enabled", true],
],
});
await BrowserTestUtils.withNewTab(
{ gBrowser, url: TESTROOT + "enabled.html" },
async function (browser) {
await SpecialPowers.spawn(browser, [], () => {
content.wrappedJSObject.InstallTrigger.enabled.k = function () {};
});
BrowserTestUtils.startLoadingURIString(
browser,
TESTROOT2 + "enabled.html"
);
await BrowserTestUtils.browserLoaded(browser);
await SpecialPowers.spawn(browser, [], () => {
is(
content.wrappedJSObject.InstallTrigger.enabled.k,
undefined,
"Property should not be defined"
);
});
}
);
});
// ----------------------------------------------------------------------------