From be2b3635ad7f21582a5cfd5a25fc4ec41653c1c7 Mon Sep 17 00:00:00 2001 From: JustOff Date: Mon, 23 Apr 2018 14:52:50 +0300 Subject: Fix accessing the bootstrap methods when they are declared in the new lexical scope --- .../extensions/test/xpcshell/test_bootstrap_const.js | 17 +++++++++++++++++ .../extensions/test/xpcshell/xpcshell-shared.ini | 1 + 2 files changed, 18 insertions(+) create mode 100644 toolkit/mozapps/extensions/test/xpcshell/test_bootstrap_const.js (limited to 'toolkit/mozapps/extensions/test/xpcshell') diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_bootstrap_const.js b/toolkit/mozapps/extensions/test/xpcshell/test_bootstrap_const.js new file mode 100644 index 000000000..fb02b59be --- /dev/null +++ b/toolkit/mozapps/extensions/test/xpcshell/test_bootstrap_const.js @@ -0,0 +1,17 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ + */ + +createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1"); +startupManager(); + +add_task(function*() { + let sawInstall = false; + Services.obs.addObserver(function() { + sawInstall = true; + }, "addon-install", false); + + yield promiseInstallAllFiles([do_get_addon("test_bootstrap_const")]); + + ok(sawInstall); +}); \ No newline at end of file diff --git a/toolkit/mozapps/extensions/test/xpcshell/xpcshell-shared.ini b/toolkit/mozapps/extensions/test/xpcshell/xpcshell-shared.ini index bab072e83..2a12f147a 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/xpcshell-shared.ini +++ b/toolkit/mozapps/extensions/test/xpcshell/xpcshell-shared.ini @@ -29,6 +29,7 @@ skip-if = os == "android" [test_bootstrap.js] # Bug 676992: test consistently hangs on Android skip-if = os == "android" +[test_bootstrap_const.js] [test_bootstrap_resource.js] [test_bug299716.js] # Bug 676992: test consistently hangs on Android -- cgit v1.2.3