Files
sdk/pkg/analysis_server/test/integration/analysis/get_errors.dart
T
paulberry@google.com 931b0afaa6 Split analysis_domain_int_test.dart into several test files.
This test was timing out on the debug build bots because it had 6
sub-tests, each of which started a separate instance of the analysis
server.  Split it out to one test per file.

R=scheglov@google.com

Review URL: https://codereview.chromium.org//465513002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39095 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-11 17:39:10 +00:00

45 lines
1.2 KiB
Dart

// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
library test.integration.analysis.get.errors;
import 'dart:async';
import 'package:unittest/unittest.dart';
import '../integration_tests.dart';
/**
* Base class for testing the "analysis.getErrors" request.
*/
class AnalysisDomainGetErrorsTest extends
AbstractAnalysisServerIntegrationTest {
/**
* True if the "analysis.getErrors" request should be made after analysis is
* complete.
*/
final bool afterAnalysis;
AnalysisDomainGetErrorsTest(this.afterAnalysis);
test_getErrors() {
String pathname = sourcePath('test.dart');
String text = r'''
main() {
var x // parse error: missing ';'
}''';
writeFile(pathname, text);
standardAnalysisSetup();
Future finishTest() {
return sendAnalysisGetErrors(pathname).then((result) {
expect(result['errors'], equals(currentAnalysisErrors[pathname]));
});
}
if (afterAnalysis) {
return analysisFinished.then((_) => finishTest());
} else {
return finishTest();
}
}
}