OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
| 5 // OtherResources=file_blocking_lock_script.dart |
| 6 |
5 // This test works by spawning a new process running | 7 // This test works by spawning a new process running |
6 // file_blocking_lock_script.dart, trading the file lock back and forth, | 8 // file_blocking_lock_script.dart, trading the file lock back and forth, |
7 // writing bytes 1 ... 25 in order to the file. There are checks to ensure | 9 // writing bytes 1 ... 25 in order to the file. There are checks to ensure |
8 // that the bytes are written in order, that one process doesn't write all the | 10 // that the bytes are written in order, that one process doesn't write all the |
9 // bytes and that a non-blocking lock fails such that a blocking lock must | 11 // bytes and that a non-blocking lock fails such that a blocking lock must |
10 // be taken, which succeeds. | 12 // be taken, which succeeds. |
11 | 13 |
12 import 'dart:async'; | 14 import 'dart:async'; |
13 import 'dart:convert'; | 15 import 'dart:convert'; |
14 import 'dart:io'; | 16 import 'dart:io'; |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 await raf.close(); | 102 await raf.close(); |
101 await directory.delete(recursive: true); | 103 await directory.delete(recursive: true); |
102 }); | 104 }); |
103 } | 105 } |
104 | 106 |
105 main() async { | 107 main() async { |
106 asyncStart(); | 108 asyncStart(); |
107 await testLockWholeFile(); | 109 await testLockWholeFile(); |
108 asyncEnd(); | 110 asyncEnd(); |
109 } | 111 } |
OLD | NEW |