Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(527)

Unified Diff: pkg/analyzer/lib/file_system/memory_file_system.dart

Issue 2393663002: More fixes for testing under windows (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analyzer/test/file_system/memory_file_system_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/file_system/memory_file_system.dart
diff --git a/pkg/analyzer/lib/file_system/memory_file_system.dart b/pkg/analyzer/lib/file_system/memory_file_system.dart
index 60ad8493e70ea5d60570956aba61447d7738a165..5d4e67501c80abebbd9cfb35396f58e850c86380 100644
--- a/pkg/analyzer/lib/file_system/memory_file_system.dart
+++ b/pkg/analyzer/lib/file_system/memory_file_system.dart
@@ -36,9 +36,9 @@ class MemoryResourceProvider implements ResourceProvider {
MemoryResourceProvider(
{pathos.Context context, @deprecated bool isWindows: false})
- : _pathContext = context ?? pathos.context,
- absolutePathContext = new AbsolutePathContext(
- pathos.Style.platform == pathos.Style.windows);
+ : _pathContext = (context ??= pathos.context),
+ absolutePathContext =
+ new AbsolutePathContext(context.style == pathos.Style.windows);
@override
pathos.Context get pathContext => _pathContext;
@@ -417,10 +417,6 @@ class _MemoryFile extends _MemoryResource implements File {
File resolveSymbolicLinksSync() => this;
@override
- Uri toUri() =>
- new Uri.file(path, windows: _provider.pathContext == pathos.windows);
-
- @override
void writeAsBytesSync(List<int> bytes) {
_provider._setFileContent(this, bytes);
}
@@ -513,10 +509,6 @@ class _MemoryFolder extends _MemoryResource implements Folder {
@override
Folder resolveSymbolicLinksSync() => this;
-
- @override
- Uri toUri() =>
- new Uri.directory(path, windows: _provider.pathContext == pathos.windows);
}
/**
@@ -570,4 +562,7 @@ abstract class _MemoryResource implements Resource {
@override
String toString() => path;
+
+ @override
+ Uri toUri() => _provider.pathContext.toUri(path);
}
« no previous file with comments | « no previous file | pkg/analyzer/test/file_system/memory_file_system_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698