Bug 1146304 - Touch slider bar or tap forward button, the video got stuck 1s then...
[gecko.git] / netwerk / test / unit / test_gre_resources.js
bloba6e6251dd7f2fc0b478bff75a0a159b0a80d045d
1 // test that things that are expected to be in gre-resources are still there
3 var ios = Cc["@mozilla.org/network/io-service;1"]. getService(Ci.nsIIOService);
5 function wrapInputStream(input)
7   var nsIScriptableInputStream = Components.interfaces.nsIScriptableInputStream;
8   var factory = Components.classes["@mozilla.org/scriptableinputstream;1"];
9   var wrapper = factory.createInstance(nsIScriptableInputStream);
10   wrapper.init(input);
11   return wrapper;
14 function check_file(file) {
15   var channel = ios.newChannel("resource://gre-resources/"+file, null, null);
16   try {
17     let instr = wrapInputStream(channel.open());
18     do_check_true(instr.read(1024).length > 0)
19   } catch (e) {
20     do_throw("Failed to read " + file + " from gre-resources:"+e)
21   }
24 function run_test() {
25   for each(let file in ["ua.css"])
26     check_file(file)