modules/libjar/test/unit/test_bug589292.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/modules/libjar/test/unit/test_bug589292.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,22 @@
     1.4 +// Make sure we behave appropriately when asking for content-disposition
     1.5 +
     1.6 +const Cc = Components.classes;
     1.7 +const Ci = Components.interfaces;
     1.8 +const path = "data/test_bug589292.zip";
     1.9 +
    1.10 +function run_test() {
    1.11 +  var ios = Cc["@mozilla.org/network/io-service;1"].
    1.12 +            getService(Ci.nsIIOService);
    1.13 +  var spec = "jar:" + ios.newFileURI(do_get_file(path)).spec + "!/foo.txt";
    1.14 +  var channel = ios.newChannel(spec, null, null);
    1.15 +  instr = channel.open();
    1.16 +  var val;
    1.17 +  try {
    1.18 +    val = channel.contentDisposition;
    1.19 +    do_check_true(false, "The channel has content disposition?!");
    1.20 +  } catch (e) {
    1.21 +    // This is what we want to happen - there's no underlying channel, so no
    1.22 +    // content-disposition header is available
    1.23 +    do_check_true(true, "How are you reading this?!");
    1.24 +  }
    1.25 +}

mercurial