diff --git a/xpcom/tests/unit/test_storagestream.js b/xpcom/tests/unit/test_storagestream.js index 9d732640715..e954c746cfc 100644 --- a/xpcom/tests/unit/test_storagestream.js +++ b/xpcom/tests/unit/test_storagestream.js @@ -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); } /**