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

Unified Diff: pkg/analyzer/test/generated/analysis_context_factory.dart

Issue 2397933006: Get more tests passing on 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/generated/compile_time_error_code_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/generated/analysis_context_factory.dart
diff --git a/pkg/analyzer/test/generated/analysis_context_factory.dart b/pkg/analyzer/test/generated/analysis_context_factory.dart
index e5b60f0a8491d2b1b0fc94373f5dbf00d94a58b4..b2c197548656f311ceae61851d98a53dbaf4c367 100644
--- a/pkg/analyzer/test/generated/analysis_context_factory.dart
+++ b/pkg/analyzer/test/generated/analysis_context_factory.dart
@@ -25,7 +25,6 @@ import 'package:analyzer/src/generated/testing/ast_factory.dart';
import 'package:analyzer/src/generated/testing/element_factory.dart';
import 'package:analyzer/src/generated/testing/test_type_provider.dart';
import 'package:analyzer/src/generated/utilities_dart.dart';
-import 'package:analyzer/src/source/source_resource.dart';
import 'package:analyzer/src/string_source.dart';
import 'package:test/test.dart';
@@ -489,24 +488,24 @@ class AnalysisContextForTests extends AnalysisContextImpl {
* Helper for creating and managing single [AnalysisContext].
*/
class AnalysisContextHelper {
- ResourceProvider resourceProvider;
+ MemoryResourceProvider resourceProvider;
AnalysisContext context;
/**
* Creates new [AnalysisContext] using [AnalysisContextFactory].
*/
AnalysisContextHelper(
- [AnalysisOptionsImpl options, ResourceProvider provider]) {
+ [AnalysisOptionsImpl options, MemoryResourceProvider provider]) {
resourceProvider = provider ?? new MemoryResourceProvider();
- if (options == null) {
- options = new AnalysisOptionsImpl();
- }
- context = AnalysisContextFactory.contextWithCoreAndOptions(options,
+ context = AnalysisContextFactory.contextWithCoreAndOptions(
+ options ?? new AnalysisOptionsImpl(),
resourceProvider: resourceProvider);
}
Source addSource(String path, String code) {
- Source source = new FileSource(resourceProvider.getFile(path));
+ Source source = resourceProvider
+ .getFile(resourceProvider.convertPath(path))
+ .createSource();
if (path.endsWith(".dart") || path.endsWith(".html")) {
ChangeSet changeSet = new ChangeSet();
changeSet.addedSource(source);
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/compile_time_error_code_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698