| 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 // SharedOptions=--supermixin | 4 // SharedOptions=--supermixin |
| 5 | 5 |
| 6 library front_end.test.physical_file_system_test; | 6 library front_end.test.physical_file_system_test; |
| 7 | 7 |
| 8 import 'dart:async'; | 8 import 'dart:async'; |
| 9 import 'dart:convert'; | 9 import 'dart:convert'; |
| 10 import 'dart:io' as io; | 10 import 'dart:io' as io; |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 test_entityForUri() { | 120 test_entityForUri() { |
| 121 expect( | 121 expect( |
| 122 PhysicalFileSystem.instance | 122 PhysicalFileSystem.instance |
| 123 .entityForUri(Uri.parse('${tempUri}file.txt')) | 123 .entityForUri(Uri.parse('${tempUri}file.txt')) |
| 124 .uri, | 124 .uri, |
| 125 p.toUri(p.join(tempPath, 'file.txt'))); | 125 p.toUri(p.join(tempPath, 'file.txt'))); |
| 126 } | 126 } |
| 127 | 127 |
| 128 test_entityForUri_bareUri_absolute() { | 128 test_entityForUri_bareUri_absolute() { |
| 129 expect(PhysicalFileSystem.instance.entityForUri(Uri.parse('/file.txt')).uri, | 129 expect(PhysicalFileSystem.instance.entityForUri(Uri.parse('/file.txt')).uri, |
| 130 p.toUri(p.fromUri('/file.txt'))); | 130 Uri.parse('file:///file.txt')); |
| 131 } | 131 } |
| 132 | 132 |
| 133 test_entityForUri_fileUri_relative() { | 133 test_entityForUri_fileUri_relative() { |
| 134 // A weird quirk of the Uri class is that it doesn't seem possible to create | 134 // A weird quirk of the Uri class is that it doesn't seem possible to create |
| 135 // a `file:` uri with a relative path, no matter how many slashes you use or | 135 // a `file:` uri with a relative path, no matter how many slashes you use or |
| 136 // if you populate the fields directly. But just to be certain, try to do | 136 // if you populate the fields directly. But just to be certain, try to do |
| 137 // so, and make that `file:` uris with relative paths are rejected. | 137 // so, and make that `file:` uris with relative paths are rejected. |
| 138 for (var uri in <Uri>[ | 138 for (var uri in <Uri>[ |
| 139 new Uri(scheme: 'file', path: 'file.txt'), | 139 new Uri(scheme: 'file', path: 'file.txt'), |
| 140 Uri.parse('file:file.txt'), | 140 Uri.parse('file:file.txt'), |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 tempDirectory.deleteSync(recursive: true); | 190 tempDirectory.deleteSync(recursive: true); |
| 191 } on io.FileSystemException { | 191 } on io.FileSystemException { |
| 192 // Sometimes on Windows the delete fails with errno 32 | 192 // Sometimes on Windows the delete fails with errno 32 |
| 193 // (ERROR_SHARING_VIOLATION: The process cannot access the file because it | 193 // (ERROR_SHARING_VIOLATION: The process cannot access the file because it |
| 194 // is being used by another process). Wait 1 second and try again. | 194 // is being used by another process). Wait 1 second and try again. |
| 195 await new Future.delayed(new Duration(seconds: 1)); | 195 await new Future.delayed(new Duration(seconds: 1)); |
| 196 tempDirectory.deleteSync(recursive: true); | 196 tempDirectory.deleteSync(recursive: true); |
| 197 } | 197 } |
| 198 } | 198 } |
| 199 } | 199 } |
| OLD | NEW |