Bug 1335645 - part 1 - Fix JS errors in test_reopen.js and test_file_partial_inputstream.js r=junior

MozReview-Commit-ID: 2QOdvACvW8z
This commit is contained in:
Valentin Gosu 2017-02-07 16:20:18 +01:00
parent 64921de6f3
commit 57ede22306
2 changed files with 9 additions and 0 deletions

View File

@ -7,6 +7,8 @@
// do_check_eq(a, b) to avoid outputting characters which confuse
// the console
"use strict";
var CC = Components.Constructor;
const BinaryInputStream = CC("@mozilla.org/binaryinputstream;1",
"nsIBinaryInputStream",
@ -34,6 +36,7 @@ function run_test()
let binaryStream = new BinaryInputStream(new_file_input_stream(binaryFile));
test_file_data = "";
let avail = 0;
while ((avail = binaryStream.available()) > 0) {
test_file_data += binaryStream.readBytes(avail);
}

View File

@ -1,9 +1,15 @@
// This testcase verifies that channels can't be reopened
// See https://bugzilla.mozilla.org/show_bug.cgi?id=372486
"use strict";
Cu.import("resource://testing-common/httpd.js");
Cu.import("resource://gre/modules/NetUtil.jsm");
const BinaryInputStream = Components.Constructor(
"@mozilla.org/binaryinputstream;1", "nsIBinaryInputStream",
"setInputStream");
const NS_ERROR_IN_PROGRESS = 0x804b000f;
const NS_ERROR_ALREADY_OPENED = 0x804b0049;