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

Unified Diff: pkg/analysis_server/test/integration/analysis_domain_int_test.dart

Issue 449213002: Rework "analysis.updateContent" analysis server request. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 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_domain_int_test.dart
diff --git a/pkg/analysis_server/test/integration/analysis_domain_int_test.dart b/pkg/analysis_server/test/integration/analysis_domain_int_test.dart
index a99047e3cd99eaad5faaad0881f378256a1b6026..13aa2cdd9f8755ed1344a831f9dba51a80d69c7f 100644
--- a/pkg/analysis_server/test/integration/analysis_domain_int_test.dart
+++ b/pkg/analysis_server/test/integration/analysis_domain_int_test.dart
@@ -199,17 +199,35 @@ main() {
return analysisFinished.then((_) {
// The contents on disk (badText) are missing a semicolon.
expect(currentAnalysisErrors[pathname], isNot(isEmpty));
- var contentChange = {
- 'content': goodText
- };
+
if (includeOffsetAndLengths) {
- contentChange['offset'] = goodText.indexOf(';');
- contentChange['oldLength'] = 0;
- contentChange['newLength'] = 1;
+ // Before we send a ChangeContentOverlay directive we need to send an
+ // AddContentOverlay directive. So send that with badText.
+ return sendAnalysisUpdateContent({
+ pathname: {
+ 'type': 'add',
+ 'content': badText
+ }
+ }).then((_) => analysisFinished);
+ }
+ }).then((_) {
+ if (includeOffsetAndLengths) {
+ return sendAnalysisUpdateContent({
+ pathname: {
+ 'type': 'change',
+ 'offset': goodText.indexOf(';'),
+ 'oldLength': 0,
+ 'replacement': ';'
+ }
+ });
+ } else {
+ return sendAnalysisUpdateContent({
+ pathname: {
+ 'type': 'add',
+ 'content': goodText
+ }
+ });
}
- return sendAnalysisUpdateContent({
- pathname: contentChange
- });
}).then((result) => analysisFinished).then((_) {
// There should be no errors now because the contents on disk have been
// overriden with goodText.
@@ -218,9 +236,9 @@ main() {
// that isContentChange doesn't permit 'content' to be null.
return sendAnalysisUpdateContent({
pathname: {
- 'content': null
+ 'type': 'remove'
}
- }, checkTypes: false);
+ });
}).then((result) => analysisFinished).then((_) {
// Now there should be errors again, because the contents on disk are no
// longer overridden.

Powered by Google App Engine
This is Rietveld 408576698