2009-08-27 19:35:48 +04:00
|
|
|
// test that things that are expected to be in gre-resources are still there
|
|
|
|
|
2020-04-07 19:00:03 +03:00
|
|
|
"use strict";
|
|
|
|
|
2009-08-27 19:35:48 +04:00
|
|
|
var ios = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
|
|
|
|
|
|
|
|
function wrapInputStream(input) {
|
|
|
|
var nsIScriptableInputStream = Ci.nsIScriptableInputStream;
|
|
|
|
var factory = Cc["@mozilla.org/scriptableinputstream;1"];
|
|
|
|
var wrapper = factory.createInstance(nsIScriptableInputStream);
|
|
|
|
wrapper.init(input);
|
|
|
|
return wrapper;
|
|
|
|
}
|
|
|
|
|
|
|
|
function check_file(file) {
|
2015-12-17 23:47:01 +03:00
|
|
|
var channel = NetUtil.newChannel({
|
|
|
|
uri: "resource://gre-resources/" + file,
|
|
|
|
loadUsingSystemPrincipal: true,
|
|
|
|
});
|
2009-08-27 19:35:48 +04:00
|
|
|
try {
|
2019-02-12 19:08:25 +03:00
|
|
|
let instr = wrapInputStream(channel.open());
|
2009-08-27 19:35:48 +04:00
|
|
|
Assert.ok(instr.read(1024).length > 0);
|
|
|
|
} catch (e) {
|
|
|
|
do_throw("Failed to read " + file + " from gre-resources:" + e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function run_test() {
|
2015-10-18 20:19:02 +03:00
|
|
|
for (let file of ["ua.css"]) {
|
2009-08-27 19:35:48 +04:00
|
|
|
check_file(file);
|
2019-07-05 11:55:23 +03:00
|
|
|
}
|
2009-08-27 19:35:48 +04:00
|
|
|
}
|