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

Unified Diff: pkg/analyzer_plugin/test/plugin/plugin_test.dart

Issue 2886343002: Register files with new drivers (issue 29641) (Closed)
Patch Set: Created 3 years, 7 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
Index: pkg/analyzer_plugin/test/plugin/plugin_test.dart
diff --git a/pkg/analyzer_plugin/test/plugin/plugin_test.dart b/pkg/analyzer_plugin/test/plugin/plugin_test.dart
index 85c1c6beb813165f1c4bb03632723d6814b61d81..a9dd530de7f4356cab728ba5e5f33746a5e3a892 100644
--- a/pkg/analyzer_plugin/test/plugin/plugin_test.dart
+++ b/pkg/analyzer_plugin/test/plugin/plugin_test.dart
@@ -19,6 +19,11 @@ void main() {
}
class MockAnalysisDriver extends AnalysisDriverGeneric {
+ /**
+ * The files that have been added to this driver.
+ */
+ List<String> addedFiles = <String>[];
+
@override
bool get hasFilesToAnalyze => false;
@@ -29,6 +34,11 @@ class MockAnalysisDriver extends AnalysisDriverGeneric {
AnalysisDriverPriority get workPriority => AnalysisDriverPriority.nothing;
@override
+ void addFile(String path) {
+ addedFiles.add(path);
+ }
+
+ @override
void dispose() {}
@override
@@ -120,7 +130,9 @@ class ServerPluginTest {
var result = await plugin.handleAnalysisSetContextRoots(
new AnalysisSetContextRootsParams([contextRoot1]));
expect(result, isNotNull);
- expect(plugin.driverMap[contextRoot1], isNotNull);
+ AnalysisDriverGeneric driver = plugin.driverMap[contextRoot1];
+ expect(driver, isNotNull);
+ expect((driver as MockAnalysisDriver).addedFiles, hasLength(1));
}
test_handleAnalysisSetPriorityFiles() async {
« pkg/analyzer_plugin/lib/plugin/plugin.dart ('K') | « pkg/analyzer_plugin/lib/plugin/plugin.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698