Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | // test that things that are expected to be in gre-resources are still there |
michael@0 | 2 | |
michael@0 | 3 | var ios = Cc["@mozilla.org/network/io-service;1"]. getService(Ci.nsIIOService); |
michael@0 | 4 | |
michael@0 | 5 | function wrapInputStream(input) |
michael@0 | 6 | { |
michael@0 | 7 | var nsIScriptableInputStream = Components.interfaces.nsIScriptableInputStream; |
michael@0 | 8 | var factory = Components.classes["@mozilla.org/scriptableinputstream;1"]; |
michael@0 | 9 | var wrapper = factory.createInstance(nsIScriptableInputStream); |
michael@0 | 10 | wrapper.init(input); |
michael@0 | 11 | return wrapper; |
michael@0 | 12 | } |
michael@0 | 13 | |
michael@0 | 14 | function check_file(file) { |
michael@0 | 15 | var channel = ios.newChannel("resource://gre-resources/"+file, null, null); |
michael@0 | 16 | try { |
michael@0 | 17 | let instr = wrapInputStream(channel.open()); |
michael@0 | 18 | do_check_true(instr.read(1024).length > 0) |
michael@0 | 19 | } catch (e) { |
michael@0 | 20 | do_throw("Failed to read " + file + " from gre-resources:"+e) |
michael@0 | 21 | } |
michael@0 | 22 | } |
michael@0 | 23 | |
michael@0 | 24 | function run_test() { |
michael@0 | 25 | for each(let file in ["charsetData.properties"]) |
michael@0 | 26 | check_file(file) |
michael@0 | 27 | } |