Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 "use strict";
3 Components.utils.import("resource://gre/modules/osfile.jsm");
4 Components.utils.import("resource://gre/modules/Task.jsm");
6 function run_test() {
7 do_test_pending();
8 run_next_test();
9 }
11 /**
12 * Test to ensure that |File.prototype.flush| is available in the async API.
13 */
15 add_task(function test_flush() {
16 let path = OS.Path.join(OS.Constants.Path.tmpDir,
17 "test_osfile_async_flush.tmp");
18 let file = yield OS.File.open(path, {trunc: true, write: true});
19 try {
20 try {
21 yield file.flush();
22 } finally {
23 yield file.close();
24 }
25 } finally {
26 yield OS.File.remove(path);
27 }
28 });
30 add_task(do_test_finished);