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

Unified Diff: pkg/analyzer/test/src/dart/analysis/driver_test.dart

Issue 2491183002: Add AnalysisDriverScheduler.status and extract status support. (Closed)
Patch Set: Created 4 years, 1 month 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/lib/src/dart/analysis/status.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/dart/analysis/driver_test.dart
diff --git a/pkg/analyzer/test/src/dart/analysis/driver_test.dart b/pkg/analyzer/test/src/dart/analysis/driver_test.dart
index 8793f1c5cafb83fe70f8a31bfd25320232b894db..879a8e39a0efff346a629da51e2b9492b7d29978 100644
--- a/pkg/analyzer/test/src/dart/analysis/driver_test.dart
+++ b/pkg/analyzer/test/src/dart/analysis/driver_test.dart
@@ -16,6 +16,7 @@ import 'package:analyzer/source/package_map_resolver.dart';
import 'package:analyzer/src/dart/analysis/byte_store.dart';
import 'package:analyzer/src/dart/analysis/driver.dart';
import 'package:analyzer/src/dart/analysis/file_state.dart';
+import 'package:analyzer/src/dart/analysis/status.dart';
import 'package:analyzer/src/error/codes.dart';
import 'package:analyzer/src/generated/engine.dart' show AnalysisOptionsImpl;
import 'package:analyzer/src/generated/source.dart';
@@ -179,6 +180,38 @@ class AnalysisDriverSchedulerTest {
expect(allResults[2].path, b);
}
+ test_status() async {
+ AnalysisDriver driver1 = newDriver();
+ AnalysisDriver driver2 = newDriver();
+
+ String a = _p('/a.dart');
+ String b = _p('/b.dart');
+ String c = _p('/c.dart');
+ provider.newFile(a, 'class A {}');
+ provider.newFile(b, 'class B {}');
+ provider.newFile(c, 'class C {}');
+ driver1.addFile(a);
+ driver2.addFile(b);
+ driver2.addFile(c);
+
+ Monitor idleStatusMonitor = new Monitor();
+ List<AnalysisStatus> allStatuses = [];
+ scheduler.status.forEach((status) {
+ allStatuses.add(status);
+ if (status.isIdle) {
+ idleStatusMonitor.notify();
+ }
+ });
+
+ await idleStatusMonitor.signal;
+
+ expect(allStatuses, hasLength(2));
+ expect(allStatuses[0].isAnalyzing, isTrue);
+ expect(allStatuses[1].isAnalyzing, isFalse);
+
+ expect(allResults, hasLength(3));
+ }
+
String _p(String path) => provider.convertPath(path);
}
« no previous file with comments | « pkg/analyzer/lib/src/dart/analysis/status.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698