Commit 69f20b45 authored by Jonas Sicking's avatar Jonas Sicking
Browse files

Followup for bug 575946. Enable all the tests on windows by using a different...

Followup for bug 575946. Enable all the tests on windows by using a different way of testing that the full file was written. a=NPOTB
parent 3c2e8c4c
Loading
Loading
Loading
Loading
+38 −48
Original line number Diff line number Diff line
@@ -59,10 +59,6 @@ var test_file_data;

function run_test()
{
  if ("@mozilla.org/windows-registry-key;1" in Components.classes) {
    do_check_eq("file creation fails randomly", "file creation fails randomly");
    return;
  }
  // Binary tests
  let binaryFile = do_get_file(binary_test_file_name);
  let size = binaryFile.fileSize;
@@ -176,7 +172,6 @@ function run_test()

function test_binary_portion(start, length) {
  let subFile = create_temp_file(test_file_data.substr(start, length));
  do_check_eq(subFile.fileSize, length);

  let streamTests = [
    test_4k_read,
@@ -397,7 +392,6 @@ function test_seek_then_read(fileStreamA, fileStreamB, size) {

function test_text_portion(start, length) {
  let subFile = create_temp_file(test_file_data.substr(start, length));
  do_check_eq(subFile.fileSize, length);

  let streamTests = [
    test_readline,
@@ -543,14 +537,10 @@ function create_temp_file(data) {

  let ostream = Cc["@mozilla.org/network/file-output-stream;1"].
                createInstance(Ci.nsIFileOutputStream);
  //ostream.init(file, 0x02 | 0x08 | 0x20, // write, create, truncate
  //             0666, 0);
  ostream.init(file, -1, -1, 0);
  ostream.write(data, data.length);
  ostream.init(file, 0x02 | 0x08 | 0x20, // write, create, truncate
               0666, 0);
  do_check_eq(ostream.write(data, data.length), data.length);
  ostream.close();

  dump("**** created temporary file " + file.path + " with size " +
       file.fileSize + " ****\n");

  return file;
}