1 /* -*- indent-tabs-mode: nil; js-indent-level: 4 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 const util = Cc["@mozilla.org/io-util;1"].getService(Ci.nsIIOUtil);
10 util.inputStreamIsBuffered(null);
11 do_throw("inputStreamIsBuffered should have thrown");
13 Assert.equal(e.result, Cr.NS_ERROR_INVALID_POINTER);
17 util.outputStreamIsBuffered(null);
18 do_throw("outputStreamIsBuffered should have thrown");
20 Assert.equal(e.result, Cr.NS_ERROR_INVALID_POINTER);
23 var s = Cc["@mozilla.org/io/string-input-stream;1"].createInstance(
24 Ci.nsIStringInputStream
26 var body = "This is a test";
27 s.setData(body, body.length);
28 Assert.equal(util.inputStreamIsBuffered(s), true);