Follow-on fix for bug 457825. Use sheet principal for agent and user sheets. r=dbaron...
[wine-gecko.git] / netwerk / test / unit / test_bug337744.js
blob0cd94b0fad43a902fc771641e8800876599e33d2
1 /* verify that certain invalid URIs are not parsed by the resource
2    protocol handler */
4 const Cc = Components.classes;
5 const Ci = Components.interfaces;
6 const Cr = Components.results;
8 const specs = [
9   "resource:////",
10   "resource:///http://www.mozilla.org/",
11   "resource:///file:///",
12   "resource:///..\\",
13   "resource:///..\\..\\",
14   "resource:///..%5C",
15   "resource:///..%5c"
18 function check_for_exception(spec)
20   var ios =
21     Cc["@mozilla.org/network/io-service;1"].
22     getService(Ci.nsIIOService);
24   try {
25     var channel = ios.newChannel(spec, null, null);
26   }
27   catch (e) {
28     return;
29   }
31   do_throw("Succesfully opened invalid URI: '" + spec + "'");
34 function run_test() {
35   for each (spec in specs) {
36     check_for_exception(spec);
37   }