1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 var exports1 = ChromeUtils.import("resource://test/TestBlob.jsm", scope1);
10 var exports2 = ChromeUtils.import("resource://test/TestBlob.jsm", scope2);
12 Assert.ok(exports1 === exports2);
13 Assert.ok(scope1.TestBlob === scope2.TestBlob);
15 Cu.unload("resource://test/TestBlob.jsm");
18 var exports3 = ChromeUtils.import("resource://test/TestBlob.jsm", scope3);
20 Assert.equal(false, exports1 === exports3);
21 Assert.equal(false, scope1.TestBlob === scope3.TestBlob);
23 // When the jsm was unloaded, the value of all its global's properties were
24 // set to undefined. While it must be safe (not crash) to call into the
25 // module, we expect it to throw an error (e.g., when trying to use Ci).
26 try { scope1.TestBlob.doTest(() => {}); } catch (e) {}
27 try { scope3.TestBlob.doTest(() => {}); } catch (e) {}