381812 improved testcase for storage stream behaviour when the stream hasn't been written to r=bsmedberg

This commit is contained in:
cbiesinger@gmx.at 2007-09-05 13:30:18 -07:00
parent e450a4c000
commit af888adb39

View File

@ -60,6 +60,21 @@ function test1()
var out = ss.getOutputStream(0);
var inp2 = ss.newInputStream(0);
do_check_eq(inp2.available(), 0);
do_check_true(inp2.isNonBlocking());
var sis =
Cc["@mozilla.org/scriptableinputstream;1"]
.createInstance(Ci.nsIScriptableInputStream);
sis.init(inp2);
var threw = false;
try {
sis.read(1);
} catch (ex if ex.result == Cr.NS_BASE_STREAM_WOULD_BLOCK) {
threw = true;
}
do_check_true(threw);
}
/**