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/. */
5 function test_BrokenFile(path, shouldThrow, expectedName) {
8 ChromeUtils.import(path);
10 var exceptionName = ex.name;
11 print("ex: " + ex + "; name = " + ex.name);
15 Assert.equal(didThrow, shouldThrow);
17 Assert.equal(exceptionName, expectedName);
21 test_BrokenFile("resource://test/bogus_exports_type.jsm", true, "Error");
23 test_BrokenFile("resource://test/bogus_element_type.jsm", true, "Error");
25 test_BrokenFile("resource://test/non_existing.jsm",
27 "NS_ERROR_FILE_NOT_FOUND");
29 test_BrokenFile("chrome://test/content/test.jsm",
31 "NS_ERROR_FILE_NOT_FOUND");