| OLD | NEW |
| 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 'package:analysis_server/plugin/protocol/protocol.dart'; | 5 import 'package:analysis_server/plugin/protocol/protocol.dart'; |
| 6 import 'package:test/test.dart'; | 6 import 'package:test/test.dart'; |
| 7 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 7 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
| 8 | 8 |
| 9 import '../integration_tests.dart'; | 9 import '../integration_tests.dart'; |
| 10 | 10 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 }); | 52 }); |
| 53 await analysisFinished; | 53 await analysisFinished; |
| 54 expect(currentAnalysisErrors[path], isEmpty); | 54 expect(currentAnalysisErrors[path], isEmpty); |
| 55 | 55 |
| 56 // Now there should be errors again, because the contents on disk are no | 56 // Now there should be errors again, because the contents on disk are no |
| 57 // longer overridden. | 57 // longer overridden. |
| 58 sendAnalysisUpdateContent({path: new RemoveContentOverlay()}); | 58 sendAnalysisUpdateContent({path: new RemoveContentOverlay()}); |
| 59 await analysisFinished; | 59 await analysisFinished; |
| 60 expect(currentAnalysisErrors[path], isNotEmpty); | 60 expect(currentAnalysisErrors[path], isNotEmpty); |
| 61 } | 61 } |
| 62 |
| 63 @failingTest |
| 64 test_updateContent_multipleAdds() async { |
| 65 String pathname = sourcePath('test.dart'); |
| 66 writeFile( |
| 67 pathname, |
| 68 r''' |
| 69 class Person { |
| 70 String _name; |
| 71 Person(this._name); |
| 72 String get name => this._name; |
| 73 String toString() => "Name: ${name}"; |
| 74 } |
| 75 void main() { |
| 76 var p = new Person("Skeletor"); |
| 77 p.xname = "Faker"; |
| 78 print(p); |
| 79 } |
| 80 '''); |
| 81 standardAnalysisSetup(); |
| 82 await analysisFinished; |
| 83 expect(currentAnalysisErrors[pathname], isList); |
| 84 List<AnalysisError> errors1 = currentAnalysisErrors[pathname]; |
| 85 expect(errors1, hasLength(1)); |
| 86 expect(errors1[0].location.file, equals(pathname)); |
| 87 |
| 88 await sendAnalysisUpdateContent({ |
| 89 pathname: new AddContentOverlay(r''' |
| 90 class Person { |
| 91 String _name; |
| 92 Person(this._name); |
| 93 String get name => this._name; |
| 94 String toString() => "Name: ${name}"; |
| 95 } |
| 96 void main() { |
| 97 var p = new Person("Skeletor"); |
| 98 p.name = "Faker"; |
| 99 print(p); |
| 100 } |
| 101 ''') |
| 102 }); |
| 103 await analysisFinished; |
| 104 expect(currentAnalysisErrors[pathname], isList); |
| 105 List<AnalysisError> errors2 = currentAnalysisErrors[pathname]; |
| 106 expect(errors2, hasLength(1)); |
| 107 expect(errors2[0].location.file, equals(pathname)); |
| 108 } |
| 62 } | 109 } |
| 63 | 110 |
| 64 @reflectiveTest | 111 @reflectiveTest |
| 65 class UpdateContentTest extends AbstractUpdateContentTest {} | 112 class UpdateContentTest extends AbstractUpdateContentTest {} |
| 66 | 113 |
| 67 @reflectiveTest | 114 @reflectiveTest |
| 68 class UpdateContentTest_Driver extends AbstractUpdateContentTest { | 115 class UpdateContentTest_Driver extends AbstractUpdateContentTest { |
| 69 @override | 116 @override |
| 70 bool get enableNewAnalysisDriver => true; | 117 bool get enableNewAnalysisDriver => true; |
| 71 } | 118 } |
| OLD | NEW |