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

Unified Diff: pkg/analysis_server/test/integration/analysis/update_content_test.dart

Issue 621383002: Change integration test send...() methods to use structured objects. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Reintroduce type checking of server responses Created 6 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
Index: pkg/analysis_server/test/integration/analysis/update_content_test.dart
diff --git a/pkg/analysis_server/test/integration/analysis/update_content_test.dart b/pkg/analysis_server/test/integration/analysis/update_content_test.dart
index a4b99ef670f034716edd33746fb235b766d8344f..02833060fb8f7d7e8bdb96d270a6b21ea6e07573 100644
--- a/pkg/analysis_server/test/integration/analysis/update_content_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/update_content_test.dart
@@ -4,9 +4,10 @@
library test.integration.analysis.update.content;
-import '../../reflective_tests.dart';
+import 'package:analysis_server/src/protocol.dart';
import 'package:unittest/unittest.dart';
+import '../../reflective_tests.dart';
import '../integration_tests.dart';
@ReflectiveTestCase()
@@ -24,44 +25,27 @@ main() {
// The contents on disk (badText) are missing a semicolon.
expect(currentAnalysisErrors[pathname], isNot(isEmpty));
}).then((_) => sendAnalysisUpdateContent({
- pathname: {
- 'type': 'add',
- 'content': goodText
- }
+ pathname: new AddContentOverlay(goodText)
})).then((result) => analysisFinished).then((_) {
// There should be no errors now because the contents on disk have been
// overriden with goodText.
expect(currentAnalysisErrors[pathname], isEmpty);
return sendAnalysisUpdateContent({
- pathname: {
- 'type': 'change',
- 'edits': [{
- 'offset': goodText.indexOf(';'),
- 'length': 1,
- 'replacement': ''
- }]
- }
+ pathname: new ChangeContentOverlay(
+ [new SourceEdit(goodText.indexOf(';'), 1, '')])
});
}).then((result) => analysisFinished).then((_) {
// There should be errors now because we've removed the semicolon.
expect(currentAnalysisErrors[pathname], isNot(isEmpty));
return sendAnalysisUpdateContent({
- pathname: {
- 'type': 'change',
- 'edits': [{
- 'offset': goodText.indexOf(';'),
- 'length': 0,
- 'replacement': ';'
- }]
- }
+ pathname: new ChangeContentOverlay(
+ [new SourceEdit(goodText.indexOf(';'), 0, ';')])
});
}).then((result) => analysisFinished).then((_) {
// There should be no errors now because we've added the semicolon back.
expect(currentAnalysisErrors[pathname], isEmpty);
return sendAnalysisUpdateContent({
- pathname: {
- 'type': 'remove'
- }
+ pathname: new RemoveContentOverlay()
});
}).then((result) => analysisFinished).then((_) {
// Now there should be errors again, because the contents on disk are no

Powered by Google App Engine
This is Rietveld 408576698