Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test gets skipped with pattern: !nightly_build OR !debug
- Manifest: js/xpconnect/tests/unit/xpcshell.toml
Services.prefs.setBoolPref("browser.startup.record", true);
registerCleanupFunction(() => {
Services.prefs.clearUserPref("browser.startup.record");
});
add_task(function test_JSModule() {
ChromeUtils.import(URL);
Assert.ok(Cu.getModuleImportStack(URL).includes("test_JSModule"));
});
add_task(function test_ESModule() {
ChromeUtils.importESModule(URL);
Assert.ok(Cu.getModuleImportStack(URL).includes("test_ESModule"));
});
add_task(function test_ESModule_static_import() {
ChromeUtils.importESModule(URL1);
Assert.ok(Cu.getModuleImportStack(URL1).includes("test_ESModule_static"));
Assert.ok(Cu.getModuleImportStack(URL2).includes("test_ESModule_static"));
Assert.ok(Cu.getModuleImportStack(URL2).includes(URL1));
Assert.ok(Cu.getModuleImportStack(URL3).includes("test_ESModule_static"));
Assert.ok(Cu.getModuleImportStack(URL3).includes(URL1));
Assert.ok(Cu.getModuleImportStack(URL3).includes(URL2));
Assert.ok(Cu.getModuleImportStack(URL4).includes("test_ESModule_static"));
Assert.ok(Cu.getModuleImportStack(URL4).includes(URL1));
Assert.ok(Cu.getModuleImportStack(URL4).includes(URL2));
Assert.ok(Cu.getModuleImportStack(URL4).includes(URL3));
});