| 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 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/constants.dart'; | 9 import 'package:analysis_server/src/constants.dart'; |
| 10 import 'package:analysis_server/src/protocol.dart'; | 10 import 'package:analysis_server/src/protocol.dart'; |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 return '${element.kind.name} ${element.name}'; | 70 return '${element.kind.name} ${element.name}'; |
| 71 }).join('\n'); | 71 }).join('\n'); |
| 72 } | 72 } |
| 73 | 73 |
| 74 @override | 74 @override |
| 75 void processNotification(Notification notification) { | 75 void processNotification(Notification notification) { |
| 76 if (notification.event == SEARCH_RESULTS) { | 76 if (notification.event == SEARCH_RESULTS) { |
| 77 var params = new SearchResultsParams.fromNotification(notification); | 77 var params = new SearchResultsParams.fromNotification(notification); |
| 78 if (params.id == searchId) { | 78 if (params.id == searchId) { |
| 79 results.addAll(params.results); | 79 results.addAll(params.results); |
| 80 searchDone = params.last; | 80 searchDone = params.isLast; |
| 81 } | 81 } |
| 82 } | 82 } |
| 83 } | 83 } |
| 84 | 84 |
| 85 @override | 85 @override |
| 86 void setUp() { | 86 void setUp() { |
| 87 super.setUp(); | 87 super.setUp(); |
| 88 createProject(); | 88 createProject(); |
| 89 handler = new SearchDomainHandler(server); | 89 handler = new SearchDomainHandler(server); |
| 90 } | 90 } |
| 91 | 91 |
| 92 Future waitForSearchResults() { | 92 Future waitForSearchResults() { |
| 93 if (searchDone) { | 93 if (searchDone) { |
| 94 return new Future.value(); | 94 return new Future.value(); |
| 95 } | 95 } |
| 96 return new Future.delayed(Duration.ZERO, waitForSearchResults); | 96 return new Future.delayed(Duration.ZERO, waitForSearchResults); |
| 97 } | 97 } |
| 98 } | 98 } |
| OLD | NEW |