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

Side by Side Diff: pkg/analysis_server/test/analysis_abstract.dart

Issue 346963006: Index Dart/HTML units after analysis. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 5 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.domain.analysis.abstract; 5 library test.domain.analysis.abstract;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/src/analysis_server.dart'; 9 import 'package:analysis_server/src/analysis_server.dart';
10 import 'package:analysis_server/src/domain_analysis.dart'; 10 import 'package:analysis_server/src/domain_analysis.dart';
11 import 'package:analysis_server/src/constants.dart'; 11 import 'package:analysis_server/src/constants.dart';
12 import 'package:analysis_server/src/protocol.dart'; 12 import 'package:analysis_server/src/protocol.dart';
13 import 'package:analysis_server/src/resource.dart'; 13 import 'package:analysis_server/src/resource.dart';
14 import 'package:analyzer/src/generated/source.dart'; 14 import 'package:analyzer/src/generated/source.dart';
15 import 'package:unittest/unittest.dart'; 15 import 'package:unittest/unittest.dart';
16 16
17 import 'mocks.dart'; 17 import 'mocks.dart';
18 import 'package:analyzer/src/generated/index.dart';
18 19
19 20
20 /** 21 /**
21 * An abstract base for all 'analysis' domain tests. 22 * An abstract base for all 'analysis' domain tests.
22 */ 23 */
23 class AbstractAnalysisTest { 24 class AbstractAnalysisTest {
24 MockServerChannel serverChannel; 25 MockServerChannel serverChannel;
25 MemoryResourceProvider resourceProvider; 26 MemoryResourceProvider resourceProvider;
26 MockPackageMapProvider packageMapProvider; 27 MockPackageMapProvider packageMapProvider;
27 AnalysisServer server; 28 AnalysisServer server;
(...skipping 10 matching lines...) Expand all
38 // Map<String, List<Map<String, Object>>> filesNavigation = {}; 39 // Map<String, List<Map<String, Object>>> filesNavigation = {};
39 40
40 41
41 AbstractAnalysisTest() { 42 AbstractAnalysisTest() {
42 } 43 }
43 44
44 void setUp() { 45 void setUp() {
45 serverChannel = new MockServerChannel(); 46 serverChannel = new MockServerChannel();
46 resourceProvider = new MemoryResourceProvider(); 47 resourceProvider = new MemoryResourceProvider();
47 packageMapProvider = new MockPackageMapProvider(); 48 packageMapProvider = new MockPackageMapProvider();
49 Index index = createIndex();
48 server = new AnalysisServer( 50 server = new AnalysisServer(
49 serverChannel, resourceProvider, packageMapProvider); 51 serverChannel, resourceProvider, packageMapProvider, index);
50 server.defaultSdk = new MockSdk(); 52 server.defaultSdk = new MockSdk();
51 handler = new AnalysisDomainHandler(server); 53 handler = new AnalysisDomainHandler(server);
52 // listen for notifications 54 // listen for notifications
53 Stream<Notification> notificationStream = serverChannel.notificationControll er.stream; 55 Stream<Notification> notificationStream = serverChannel.notificationControll er.stream;
54 notificationStream.listen((Notification notification) { 56 notificationStream.listen((Notification notification) {
55 processNotification(notification); 57 processNotification(notification);
56 }); 58 });
57 } 59 }
58 60
61 Index createIndex() {
62 return null;
63 }
64
59 void addAnalysisSubscription(AnalysisService service, String file) { 65 void addAnalysisSubscription(AnalysisService service, String file) {
60 // add file to subscription 66 // add file to subscription
61 var files = analysisSubscriptions[service.name]; 67 var files = analysisSubscriptions[service.name];
62 if (files == null) { 68 if (files == null) {
63 files = <String>[]; 69 files = <String>[];
64 analysisSubscriptions[service.name] = files; 70 analysisSubscriptions[service.name] = files;
65 } 71 }
66 files.add(file); 72 files.add(file);
67 // set subscriptions 73 // set subscriptions
68 Request request = new Request('0', ANALYSIS_SET_SUBSCRIPTIONS); 74 Request request = new Request('0', ANALYSIS_SET_SUBSCRIPTIONS);
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 int c = search.codeUnitAt(length); 279 int c = search.codeUnitAt(length);
274 if (!(c >= 'a'.codeUnitAt(0) && c <= 'z'.codeUnitAt(0) || 280 if (!(c >= 'a'.codeUnitAt(0) && c <= 'z'.codeUnitAt(0) ||
275 c >= 'A'.codeUnitAt(0) && c <= 'Z'.codeUnitAt(0) || 281 c >= 'A'.codeUnitAt(0) && c <= 'Z'.codeUnitAt(0) ||
276 c >= '0'.codeUnitAt(0) && c <= '9'.codeUnitAt(0))) { 282 c >= '0'.codeUnitAt(0) && c <= '9'.codeUnitAt(0))) {
277 break; 283 break;
278 } 284 }
279 length++; 285 length++;
280 } 286 }
281 return length; 287 return length;
282 } 288 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698