michael@0: "use strict"; michael@0: michael@0: Components.utils.import("resource://gre/modules/osfile.jsm"); michael@0: Components.utils.import("resource://gre/modules/Task.jsm"); michael@0: michael@0: function run_test() { michael@0: do_test_pending(); michael@0: run_next_test(); michael@0: } michael@0: michael@0: /** michael@0: * Test to ensure that |File.prototype.flush| is available in the async API. michael@0: */ michael@0: michael@0: add_task(function test_flush() { michael@0: let path = OS.Path.join(OS.Constants.Path.tmpDir, michael@0: "test_osfile_async_flush.tmp"); michael@0: let file = yield OS.File.open(path, {trunc: true, write: true}); michael@0: try { michael@0: try { michael@0: yield file.flush(); michael@0: } finally { michael@0: yield file.close(); michael@0: } michael@0: } finally { michael@0: yield OS.File.remove(path); michael@0: } michael@0: }); michael@0: michael@0: add_task(do_test_finished);