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

Unified Diff: pkg/analysis_server/test/analysis/reanalyze_test.dart

Issue 1478513002: Use async/await in all analysis domain tests. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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/analysis_server/test/analysis/notification_overrides_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/analysis/reanalyze_test.dart
diff --git a/pkg/analysis_server/test/analysis/reanalyze_test.dart b/pkg/analysis_server/test/analysis/reanalyze_test.dart
index 310e6d72d1b6085b3caa9d32ab378e06651d3e98..0b39e881ec7334c8a2eb7970c2ce7b8c423e3c1e 100644
--- a/pkg/analysis_server/test/analysis/reanalyze_test.dart
+++ b/pkg/analysis_server/test/analysis/reanalyze_test.dart
@@ -44,31 +44,32 @@ class ReanalyzeTest extends AbstractAnalysisTest {
expect(newContext, isNot(same(oldContext)));
}
- test_reanalyze_with_overlay() {
+ test_reanalyze_with_overlay() async {
createProject();
resourceProvider.newFolder(testFolder);
resourceProvider.newFile(testFile, 'main() {}');
- return waitForTasksFinished().then((_) {
- // Update the content with an overlay that contains a syntax error.
- server.updateContent('1', {testFile: new AddContentOverlay('main() {')});
- return waitForTasksFinished();
- }).then((_) {
- // Verify that the syntax error was detected.
+ await waitForTasksFinished();
+ // Update the content with an overlay that contains a syntax error.
+ server.updateContent('1', {testFile: new AddContentOverlay('main() {')});
+ await waitForTasksFinished();
+ // Verify that the syntax error was detected.
+ {
List<AnalysisError> errors = filesErrors[testFile];
expect(errors, hasLength(1));
- // Remove testFile from filesErrors so that we'll notice when the file is
- // re-analyzed.
- filesErrors.remove(testFile);
- // Reanalyze.
- server.reanalyze(null);
- return waitForTasksFinished();
- }).then((_) {
- // The file should have been reanalyzed.
- expect(filesErrors, contains(testFile));
- // Verify that the syntax error is present (this indicates that the
- // content introduced by the call to updateContent is still in effect).
+ }
+ // Remove testFile from filesErrors so that we'll notice when the file is
+ // re-analyzed.
+ filesErrors.remove(testFile);
+ // Reanalyze.
+ server.reanalyze(null);
+ await waitForTasksFinished();
+ // The file should have been reanalyzed.
+ expect(filesErrors, contains(testFile));
+ // Verify that the syntax error is present (this indicates that the
+ // content introduced by the call to updateContent is still in effect).
+ {
List<AnalysisError> errors = filesErrors[testFile];
expect(errors, hasLength(1));
- });
+ }
}
}
« no previous file with comments | « pkg/analysis_server/test/analysis/notification_overrides_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698