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

Side by Side Diff: pkg/analysis_server/test/search/abstract_search_domain.dart

Issue 492563002: Make more use of generated classes in analysis server. (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 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.search.abstract_search_domain; 5 library test.search.abstract_search_domain;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/src/computer/element.dart'; 9 import 'package:analysis_server/src/computer/element.dart';
10 import 'package:analysis_server/src/constants.dart'; 10 import 'package:analysis_server/src/constants.dart';
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 } 62 }
63 if (expected) { 63 if (expected) {
64 fail( 64 fail(
65 'Not found: "search" kind=$kind offset=$offset length=$length\nin\n' + 65 'Not found: "search" kind=$kind offset=$offset length=$length\nin\n' +
66 results.join('\n')); 66 results.join('\n'));
67 } 67 }
68 } 68 }
69 69
70 String getPathString(List<Element> path) { 70 String getPathString(List<Element> path) {
71 return path.map((Element element) { 71 return path.map((Element element) {
72 return '${element.kind} ${element.name}'; 72 return '${element.kind.name} ${element.name}';
73 }).join('\n'); 73 }).join('\n');
74 } 74 }
75 75
76 @override 76 @override
77 void processNotification(Notification notification) { 77 void processNotification(Notification notification) {
78 if (notification.event == SEARCH_RESULTS) { 78 if (notification.event == SEARCH_RESULTS) {
79 String id = notification.getParameter(ID); 79 String id = notification.getParameter(ID);
80 if (id == searchId) { 80 if (id == searchId) {
81 for (Map<String, Object> json in notification.getParameter(RESULTS)) { 81 for (Map<String, Object> json in notification.getParameter(RESULTS)) {
82 results.add(new SearchResult.fromJson(json)); 82 results.add(new SearchResult.fromJson(json));
(...skipping 10 matching lines...) Expand all
93 handler = new SearchDomainHandler(server); 93 handler = new SearchDomainHandler(server);
94 } 94 }
95 95
96 Future waitForSearchResults() { 96 Future waitForSearchResults() {
97 if (searchDone) { 97 if (searchDone) {
98 return new Future.value(); 98 return new Future.value();
99 } 99 }
100 return new Future.delayed(Duration.ZERO, waitForSearchResults); 100 return new Future.delayed(Duration.ZERO, waitForSearchResults);
101 } 101 }
102 } 102 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698