[devFS] Use URI to represent paths on device (#8446)
* [devFS] Use URI to represent paths on device Previosuly, regular file paths in the format of the host platform were used to represent paths on device. That works when host and device share the same (POSIX) file path format. With a Windows host, this breaks. URIs are the solution as they are platform independent and the VM service on the device already interpreted the file paths as URIs anyways. * review comments * switch to file paths * fix tests on Windows * review comments
This commit is contained in:
committed by
GitHub
parent
5ce67b084a
commit
17057bb44b
@@ -95,7 +95,7 @@ class BasicMock {
|
||||
}
|
||||
|
||||
class MockDevFSOperations extends BasicMock implements DevFSOperations {
|
||||
Map<String, DevFSContent> devicePathToContent = <String, DevFSContent>{};
|
||||
Map<Uri, DevFSContent> devicePathToContent = <Uri, DevFSContent>{};
|
||||
|
||||
@override
|
||||
Future<Uri> create(String fsName) async {
|
||||
@@ -109,14 +109,14 @@ class MockDevFSOperations extends BasicMock implements DevFSOperations {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<dynamic> writeFile(String fsName, String devicePath, DevFSContent content) async {
|
||||
messages.add('writeFile $fsName $devicePath');
|
||||
devicePathToContent[devicePath] = content;
|
||||
Future<dynamic> writeFile(String fsName, Uri deviceUri, DevFSContent content) async {
|
||||
messages.add('writeFile $fsName $deviceUri');
|
||||
devicePathToContent[deviceUri] = content;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<dynamic> deleteFile(String fsName, String devicePath) async {
|
||||
messages.add('deleteFile $fsName $devicePath');
|
||||
devicePathToContent.remove(devicePath);
|
||||
Future<dynamic> deleteFile(String fsName, Uri deviceUri) async {
|
||||
messages.add('deleteFile $fsName $deviceUri');
|
||||
devicePathToContent.remove(deviceUri);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user