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

Unified Diff: pkg/analyzer/test/src/task/strong/strong_test_helper.dart

Issue 2409473002: Fix more tests on windows bots (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 | « pkg/analyzer/test/src/task/dart_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/task/strong/strong_test_helper.dart
diff --git a/pkg/analyzer/test/src/task/strong/strong_test_helper.dart b/pkg/analyzer/test/src/task/strong/strong_test_helper.dart
index 601a26ebe51bb4ad750509b490a889cb507556df..2b8314d19e63d7ed738cf82dd68f78fca33518ae 100644
--- a/pkg/analyzer/test/src/task/strong/strong_test_helper.dart
+++ b/pkg/analyzer/test/src/task/strong/strong_test_helper.dart
@@ -62,8 +62,8 @@ CompilationUnit check(
List<String> nonnullableTypes: AnalysisOptionsImpl.NONNULLABLE_TYPES}) {
_checkCalled = true;
- expect(files.getFile(files.convertPath('/main.dart')).exists, true,
- reason: '`/main.dart` is missing');
+ File mainFile = files.getFile(files.convertPath('/main.dart'));
+ expect(mainFile.exists, true, reason: '`/main.dart` is missing');
var uriResolver = new _TestUriResolver(files);
// Enable task model strong mode
@@ -74,13 +74,13 @@ CompilationUnit check(
options.implicitCasts = implicitCasts;
options.implicitDynamic = implicitDynamic;
options.nonnullableTypes = nonnullableTypes;
- var mockSdk = new MockSdk();
+ var mockSdk = new MockSdk(resourceProvider: files);
(mockSdk.context.analysisOptions as AnalysisOptionsImpl).strongMode = true;
context.sourceFactory =
new SourceFactory([new DartUriResolver(mockSdk), uriResolver]);
// Run the checker on /main.dart.
- Source mainSource = uriResolver.resolveAbsolute(new Uri.file('/main.dart'));
+ Source mainSource = uriResolver.resolveAbsolute(mainFile.toUri());
var initialLibrary = context.resolveCompilationUnit2(mainSource, mainSource);
var collector = new _ErrorCollector(context);
@@ -400,7 +400,8 @@ class _TestUriResolver extends ResourceUriResolver {
@override
Source resolveAbsolute(Uri uri, [Uri actualUri]) {
if (uri.scheme == 'package') {
- return (provider.getResource('/packages/' + uri.path) as File)
+ return (provider.getResource(
+ provider.convertPath('/packages/' + uri.path)) as File)
.createSource(uri);
}
return super.resolveAbsolute(uri, actualUri);
« no previous file with comments | « pkg/analyzer/test/src/task/dart_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698