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

Side by Side Diff: pkg/analysis_server/test/integration/analysis/outline_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 unified diff | Download patch | Annotate | Revision Log
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 library test.integration.analysis.outline; 5 library test.integration.analysis.outline;
6 6
7 import '../../reflective_tests.dart'; 7 import 'package:analysis_server/src/protocol.dart';
8 import 'package:unittest/unittest.dart'; 8 import 'package:unittest/unittest.dart';
9 9
10 import '../../reflective_tests.dart';
10 import '../integration_tests.dart'; 11 import '../integration_tests.dart';
11 12
12 @ReflectiveTestCase() 13 @ReflectiveTestCase()
13 class Test extends AbstractAnalysisServerIntegrationTest { 14 class Test extends AbstractAnalysisServerIntegrationTest {
14 test_outline() { 15 test_outline() {
15 String pathname = sourcePath('test.dart'); 16 String pathname = sourcePath('test.dart');
16 String text = 17 String text =
17 r''' 18 r'''
18 class Class1 { 19 class Class1 {
19 int field; 20 int field;
(...skipping 11 matching lines...) Expand all
31 set setter(value) { 32 set setter(value) {
32 } 33 }
33 } 34 }
34 35
35 class Class2 { 36 class Class2 {
36 } 37 }
37 '''; 38 ''';
38 writeFile(pathname, text); 39 writeFile(pathname, text);
39 standardAnalysisSetup(); 40 standardAnalysisSetup();
40 sendAnalysisSetSubscriptions({ 41 sendAnalysisSetSubscriptions({
41 'OUTLINE': [pathname] 42 AnalysisService.OUTLINE: [pathname]
42 }); 43 });
43 Map outline; 44 Map outline;
44 onAnalysisOutline.listen((params) { 45 onAnalysisOutline.listen((params) {
45 expect(params['file'], equals(pathname)); 46 expect(params['file'], equals(pathname));
46 outline = params['outline']; 47 outline = params['outline'];
47 }); 48 });
48 return analysisFinished.then((_) { 49 return analysisFinished.then((_) {
49 expect(outline['element']['kind'], equals('COMPILATION_UNIT')); 50 expect(outline['element']['kind'], equals('COMPILATION_UNIT'));
50 expect(outline['offset'], equals(0)); 51 expect(outline['offset'], equals(0));
51 expect(outline['length'], equals(text.length)); 52 expect(outline['length'], equals(text.length));
(...skipping 22 matching lines...) Expand all
74 for (int i = 0; i < outlineObjects.length - 1; i++) { 75 for (int i = 0; i < outlineObjects.length - 1; i++) {
75 expect(outlineObjects[i + 1]['offset'], equals(outlineObjects[i]['offset'] 76 expect(outlineObjects[i + 1]['offset'], equals(outlineObjects[i]['offset']
76 + outlineObjects[i]['length'])); 77 + outlineObjects[i]['length']));
77 } 78 }
78 } 79 }
79 } 80 }
80 81
81 main() { 82 main() {
82 runReflectiveTests(Test); 83 runReflectiveTests(Test);
83 } 84 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698