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

Unified Diff: pkg/analysis_server/benchmark/perf/analysis_timing_tests.dart

Issue 1387823005: More pluggable AS benchmarks. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/benchmark/perf/analysis_timing_tests.dart
diff --git a/pkg/analysis_server/benchmark/perf/analysis_timing_tests.dart b/pkg/analysis_server/benchmark/perf/analysis_timing_tests.dart
index fd29981882f4b588a43e42e539cb56b19190987a..6f7a3c67277d0be10b1a4b5f7e631595a1e88ed8 100644
--- a/pkg/analysis_server/benchmark/perf/analysis_timing_tests.dart
+++ b/pkg/analysis_server/benchmark/perf/analysis_timing_tests.dart
@@ -37,9 +37,15 @@ main(List<String> arguments) {
case 'analysis':
defineReflectiveTests(AnalysisTimingIntegrationTest);
break;
+ case 'highlighting':
+ defineReflectiveTests(HighlightingTimingIntegrationTest);
+ break;
case 'navigation':
defineReflectiveTests(NavigationTimingIntegrationTest);
break;
+ case 'outline':
+ defineReflectiveTests(OutlineTimingIntegrationTest);
+ break;
default:
print('unrecognized test name $testName');
exit(1);
@@ -85,25 +91,65 @@ class AnalysisTimingIntegrationTest extends AbstractTimingTest {
}
@reflectiveTest
-class NavigationTimingIntegrationTest extends AbstractTimingTest {
- Future test_detect_navigation_done() {
- expect(priorityFile, isNotNull);
+class HighlightingTimingIntegrationTest extends PriorityFileTimer {
+ @override
+ String get description => 'highlighting';
+
+ @override
+ Stream get eventStream => onAnalysisHighlights;
+
+ @override
+ AnalysisService get service => AnalysisService.HIGHLIGHTS;
+}
+
+@reflectiveTest
+class NavigationTimingIntegrationTest extends PriorityFileTimer {
+ @override
+ String get description => 'navigation';
+
+ @override
+ Stream get eventStream => onAnalysisNavigation;
+
+ @override
+ AnalysisService get service => AnalysisService.NAVIGATION;
+}
+
+@reflectiveTest
+class OutlineTimingIntegrationTest extends PriorityFileTimer {
+ @override
+ String get description => 'outline';
+
+ @override
+ Stream get eventStream => onAnalysisOutline;
+
+ @override
+ AnalysisService get service => AnalysisService.OUTLINE;
+}
+
+abstract class PriorityFileTimer extends AbstractTimingTest {
+ String get description;
+ Stream get eventStream;
+ AnalysisService get service;
+
+ Future test_timing() {
+ expect(priorityFile, isNotNull,
+ reason: 'A priority file must be specified for $description testing.');
stopwatch.start();
Duration elapsed;
- onAnalysisNavigation.listen((AnalysisNavigationParams params) {
+ eventStream.listen((_) {
elapsed = stopwatch.elapsed;
});
setAnalysisRoot();
sendAnalysisSetSubscriptions({
- AnalysisService.NAVIGATION: [priorityFile]
+ service: [priorityFile]
});
sendAnalysisSetPriorityFiles([priorityFile]);
return analysisFinished.then((_) {
- print('navigation completed in ${elapsed}');
+ print('$description completed in ${elapsed}');
stopwatch.reset();
});
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698