michael@0: // test that things that are expected to be in gre-resources are still there michael@0: michael@0: var ios = Cc["@mozilla.org/network/io-service;1"]. getService(Ci.nsIIOService); michael@0: michael@0: function wrapInputStream(input) michael@0: { michael@0: var nsIScriptableInputStream = Components.interfaces.nsIScriptableInputStream; michael@0: var factory = Components.classes["@mozilla.org/scriptableinputstream;1"]; michael@0: var wrapper = factory.createInstance(nsIScriptableInputStream); michael@0: wrapper.init(input); michael@0: return wrapper; michael@0: } michael@0: michael@0: function check_file(file) { michael@0: var channel = ios.newChannel("resource://gre-resources/"+file, null, null); michael@0: try { michael@0: let instr = wrapInputStream(channel.open()); michael@0: do_check_true(instr.read(1024).length > 0) michael@0: } catch (e) { michael@0: do_throw("Failed to read " + file + " from gre-resources:"+e) michael@0: } michael@0: } michael@0: michael@0: function run_test() { michael@0: for each(let file in ["charsetData.properties"]) michael@0: check_file(file) michael@0: }