netwerk/test/unit/test_bug336501.js

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

michael@0 1 var Cc = Components.classes;
michael@0 2 var Ci = Components.interfaces;
michael@0 3
michael@0 4 function run_test() {
michael@0 5 var f = do_get_file('test_bug336501.js');
michael@0 6
michael@0 7 var fis =
michael@0 8 Cc["@mozilla.org/network/file-input-stream;1"].
michael@0 9 createInstance(Ci.nsIFileInputStream);
michael@0 10 fis.init(f, -1, -1, 0);
michael@0 11
michael@0 12 var bis =
michael@0 13 Cc["@mozilla.org/network/buffered-input-stream;1"].
michael@0 14 createInstance(Ci.nsIBufferedInputStream);
michael@0 15 bis.init(fis, 32);
michael@0 16
michael@0 17 var sis =
michael@0 18 Cc["@mozilla.org/scriptableinputstream;1"].
michael@0 19 createInstance(Ci.nsIScriptableInputStream);
michael@0 20 sis.init(bis);
michael@0 21
michael@0 22 sis.read(45);
michael@0 23 sis.close();
michael@0 24
michael@0 25 var data = sis.read(45);
michael@0 26 do_check_eq(data.length, 0);
michael@0 27 }

mercurial