Backed out changeset b71c8c052463 (bug 1943846) for causing mass failures. CLOSED...
[gecko.git] / netwerk / test / unit / test_gre_resources.js
blob4ea8d04b95b5b4cf1b9c8ff8a73e14c83c74c981
1 // test that things that are expected to be in gre-resources are still there
3 "use strict";
5 function wrapInputStream(input) {
6 var nsIScriptableInputStream = Ci.nsIScriptableInputStream;
7 var factory = Cc["@mozilla.org/scriptableinputstream;1"];
8 var wrapper = factory.createInstance(nsIScriptableInputStream);
9 wrapper.init(input);
10 return wrapper;
13 function check_file(file) {
14 var channel = NetUtil.newChannel({
15 uri: "resource://gre-resources/" + file,
16 loadUsingSystemPrincipal: true,
17 });
18 try {
19 let instr = wrapInputStream(channel.open());
20 Assert.ok(!!instr.read(1024).length);
21 } catch (e) {
22 do_throw("Failed to read " + file + " from gre-resources:" + e);
26 function run_test() {
27 for (let file of ["ua.css"]) {
28 check_file(file);