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

Side by Side Diff: pkg/analysis_server/test/integration/analysis/error_test.dart

Issue 2674863004: Add a test that server does not send errors when errors have been disabled (Closed)
Patch Set: Added driver version Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | pkg/analysis_server/test/integration/integration_tests.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'dart:async';
6
5 import 'package:analysis_server/plugin/protocol/protocol.dart'; 7 import 'package:analysis_server/plugin/protocol/protocol.dart';
6 import 'package:test/test.dart'; 8 import 'package:test/test.dart';
7 import 'package:test_reflective_loader/test_reflective_loader.dart'; 9 import 'package:test_reflective_loader/test_reflective_loader.dart';
8 10
9 import '../integration_tests.dart'; 11 import '../integration_tests.dart';
10 12
11 main() { 13 main() {
12 defineReflectiveSuite(() { 14 defineReflectiveSuite(() {
13 defineReflectiveTests(AnalysisErrorIntegrationTest); 15 defineReflectiveTests(AnalysisErrorIntegrationTest);
16 defineReflectiveTests(NoAnalysisErrorsIntegrationTest);
17 defineReflectiveTests(NoAnalysisErrorsIntegrationTest_Driver);
14 }); 18 });
15 } 19 }
16 20
17 class AbstractAnalysisErrorIntegrationTest 21 class AbstractAnalysisErrorIntegrationTest
18 extends AbstractAnalysisServerIntegrationTest { 22 extends AbstractAnalysisServerIntegrationTest {
19 test_detect_simple_error() { 23 test_detect_simple_error() {
20 String pathname = sourcePath('test.dart'); 24 String pathname = sourcePath('test.dart');
21 writeFile( 25 writeFile(
22 pathname, 26 pathname,
23 ''' 27 '''
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 await analysisFinished; 94 await analysisFinished;
91 expect(currentAnalysisErrors[pathname], isList); 95 expect(currentAnalysisErrors[pathname], isList);
92 List<AnalysisError> errors = currentAnalysisErrors[pathname]; 96 List<AnalysisError> errors = currentAnalysisErrors[pathname];
93 expect(errors, isEmpty); 97 expect(errors, isEmpty);
94 } 98 }
95 } 99 }
96 100
97 @reflectiveTest 101 @reflectiveTest
98 class AnalysisErrorIntegrationTest 102 class AnalysisErrorIntegrationTest
99 extends AbstractAnalysisErrorIntegrationTest {} 103 extends AbstractAnalysisErrorIntegrationTest {}
104
105 @reflectiveTest
106 class NoAnalysisErrorsIntegrationTest
107 extends AbstractAnalysisServerIntegrationTest {
108 @override
109 Future startServer(
110 {bool checked: true, int diagnosticPort, int servicesPort}) =>
111 server.start(
112 checked: checked,
113 diagnosticPort: diagnosticPort,
114 enableNewAnalysisDriver: enableNewAnalysisDriver,
115 noErrorNotification: true,
116 servicesPort: servicesPort);
117
118 test_detect_simple_error() {
119 String pathname = sourcePath('test.dart');
120 writeFile(
121 pathname,
122 '''
123 main() {
124 print(null) // parse error: missing ';'
125 }''');
126 standardAnalysisSetup();
127 return analysisFinished.then((_) {
128 expect(currentAnalysisErrors[pathname], isNull);
129 });
130 }
131 }
132
133 @reflectiveTest
134 class NoAnalysisErrorsIntegrationTest_Driver
135 extends NoAnalysisErrorsIntegrationTest {
136 @override
137 bool get enableNewAnalysisDriver => true;
138
139 @failingTest
140 @override
141 test_detect_simple_error() {
142 return super.test_detect_simple_error();
143 }
144 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/test/integration/integration_tests.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698