michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: function run_test() { michael@0: let svc = Components.classes["@mozilla.org/charset-converter-manager;1"] michael@0: .getService(Components.interfaces.nsICharsetConverterManager); michael@0: michael@0: // Ensure normal calls to getCharsetAlias do work. michael@0: do_check_eq(svc.getCharsetAlias("Windows-1255"), "windows-1255"); michael@0: michael@0: try { michael@0: svc.getCharsetAlias("no such thing"); michael@0: do_throw("Calling getCharsetAlias with invalid value should throw."); michael@0: } michael@0: catch (ex) { michael@0: // The exception is expected. michael@0: } michael@0: }