B2G/gecko/xpcom/tests/unit/test_storagestream.js
/**
 * Checks that getting an input stream from a storage stream to which 0 bytes of
 * data have been explicitly written doesn't throw an exception.
 */
Checks that getting an input stream from a storage stream to which 0 bytes of
data have been explicitly written doesn't throw an exception.
Checks that getting an input stream from a storage stream to which 0 bytes of data have been explicitly written doesn ' t throw an exception .
function test2()
{
  var ss = Cc["@mozilla.org/storagestream;1"]
             .createInstance(Ci.nsIStorageStream);
  ss.init(1024, 1024, null);
  var out = ss.getOutputStream(0);
  out.write("", 0);
  try
  {
    var inp2 = ss.newInputStream(0);
  }
  catch (e)
  {
    do_throw("shouldn't throw exception when new input stream created");
  }
}
function test2 ( ) { var ss = Cc [ "@mozilla.org/storagestream;1" ] . createInstance ( Ci . nsIStorageStream ) ; ss . init ( 1024 , 1024 , null ) ; var out = ss . getOutputStream ( 0 ) ; out . write ( "" , 0 ) ; try { var inp2 = ss . newInputStream ( 0 ) ; } catch ( e ) { do_throw ( "shouldn't throw exception when new input stream created" ) ; } }
Checks that getting an input stream from a storage stream to which 0 bytes of
 data have been explicitly written doesn't throw an exception.
Checks that getting an input stream from a storage stream to which 0 bytes of data have been explicitly written doesn ' t throw an exception .