3 Assert.ok(!Cu.isModuleLoaded("resource://test/jsm_loaded-1.jsm"),
4 "isModuleLoaded returned correct value for non-loaded module");
5 ChromeUtils.import("resource://test/jsm_loaded-1.jsm");
6 Assert.ok(Cu.isModuleLoaded("resource://test/jsm_loaded-1.jsm"),
7 "isModuleLoaded returned true after loading that module");
8 Cu.unload("resource://test/jsm_loaded-1.jsm");
9 Assert.ok(!Cu.isModuleLoaded("resource://test/jsm_loaded-1.jsm"),
10 "isModuleLoaded returned false after unloading that module");
12 // Non-existing module
13 Assert.ok(!Cu.isModuleLoaded("resource://gre/modules/non-existing-module.jsm"),
14 "isModuleLoaded returned correct value for non-loaded module");
16 () => ChromeUtils.import("resource://gre/modules/non-existing-module.jsm"),
17 /NS_ERROR_FILE_NOT_FOUND/,
18 "Should have thrown while trying to load a non existing file"